Program for divide verb, COBOL Programming

PROGRAM FOR DIVIDE VERB:

 We have to write an easy program to elaborate DIVIDE verb. You can also use edit characters in the program.

Identification division.

Program- id. Divverb.

Environment division.

Data division.

Working-storage section.

77  a  pic    s9(3)v9(2) value 0.

77   b  pic     s9(3)v9(2) value 0.

77   c pic      s9(4)v9(2) value 0.

77   e-c pic   -z(4).z(2).

Procedure division.

Para-1.

Display(1 1) erase.

   Display(3 5) "Enter first number :".

  Accept a.

  Display(5 5) "Enter second number :".

  Accept b.

            Divide a by b giving c.

       Move c to e-c.

          Display(15 5) "Answer = " e-c.

  Stop run.

Description:   This program gets 2 inputs from the user.

                      It divides them by using the DIVIDE verb. 

                      a/b is computed and stored in c.

                      The unedited result is accessible in c.

                      We move c to e-c, where the edit characters are accessible.

                      Keep in mind that the variable e-c makes use of the - edit character.

                      The e-c will always be exhibited with result.

Posted Date: 10/17/2012 1:30:13 AM | Location : United States







Related Discussions:- Program for divide verb, Assignment Help, Ask Question on Program for divide verb, Get Answer, Expert's Help, Program for divide verb Discussions

Write discussion on Program for divide verb
Your posts are moderated
Related Questions
INDEXED SEQUENTIAL FILES: In the indexed sequential files which are also known as indexed files, the records are stored in the sequence order generally in ascending order. In

PERFORM WITH VARYING OPTION: The format is as shown below:

ADD VERB: The ADD Verb can be used to find the sum of two or more numbers and to store the sum.  The ADD verb takes any one of the two forms as shown below:

Label Records / Disk Directory: The most important information stored in the header label is what is termed as the file title. In the situation of magnetic-disk files the labe

Illustration of Multiply verb: (a)  MULTIPLY A BY B. In this situation the value of A & B will be multiplied and the product will be stored in B.  The decimal point locatio

Example of compound condition: In common, a compound condition has the form which is as shown below: Where condition-1 & condition-2 can be any one of the below:

OCCURS CLAUSE - PROGRAM: We have to write a program to demonstrate the occurs clause. Get names of the students and show them on the screen.  identification division.

PICTURE specification: The size of a group item is equivalent to the total of the sizes of all the subordinate elementary items. The group item class is alphanumeric. The i

Transaction file : A transaction file is a file which contains new records those changes to old records which are used to update the master file. The problem of file updatio

WRITE STATEMENT: The records are written to be logical place as determined from the value of the record key. The INVALID KEY condition occurs in the cases shown below: (i)