Home   Easy-Code    Forum  Updater 
Twitter Facebook



Program to find the roots and nature of roots of a quadratic equation using cobol

Critics Rating:

Users Rating:

* PROGRAM TO FIND THE ROOTS AND NATURE OF ROOTS OF A QUADRATIC EQUATION

***********************************************************************

   IDENTIFICATION DIVISION.

   PROGRAM-ID.

   ENVIRONMENT DIVISION.

   DATA DIVISION.

   WORKING-STORAGE SECTION.

   77 A PIC 9(2).

   77 B PIC 9(2).

   77 C PIC 9(2).

   77 D PIC S99V.

   77 R PIC S99V.

   77 S PIC S99V.

   PROCEDURE DIVISION.

   MAIN-PARA.

      DISPLAY "ENTER THE VALUES FOR A,B,C".

      ACCEPT A.

      ACCEPT B.

      ACCEPT C.

      IF ( A = 0 )

       DISPLAY "THERE IS ONLY ONE ROOT "

       COMPUTE R = C / B

       MOVE R TO S         

       DISPLAY "THE ROOT IS " R.

      STOP RUN.

Courtesy, Source, References & Regards: Kishore AVGK

While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright@2009-2011 by KuGuNi.com. All Rights Reserved.