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
FILE STATUS clause: This clause has been involved in the above syntax for completeness. The ORGANIZATION, REVERSE, ACCESS and STATUS clause can be specified in any order.

STATEMENTS FOR SEQUENTIAL FILES: A basic operation on a file includes the reading and writing of its records. Whenever the file is sequential, there are three verbs for the

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

Block Size: The normal practice is to group a number of consecutive records to form that is termed as a block or a physical record. The number of records in a block is frequen

SIMPLE MERGE VERB: Like sorting, the merging of files is often required in different commercial application. It is likely to merge two or more files with the help of one MERGE

Numeric -   Literals : The numeric literal can be created with the help of digits only. It can have a sign (+ or -) and can also have a decimal point. If no sign is specifi

Comparing features of oracle rdbms with Mysql

TO WRITE A QUADRATIC EQN ROOTS ARE COMPLEX IN COBOL PROGRAM

Occurs Clause: Let us establish tables with the help of an illustration. Assume that there are ten different types of income-tax rates that are read from some input medium and

Introduction to COBOL: In the year 1959, a new language named the COBOL ( CO mmon B usiness O riented L anguage) was introduced remembering the business purpose application