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
Data types available in COBOL are given below Alpha-numeric (X), numeric (9), alphabetic (A)

NONSTANDARD CLAUSES: The various clauses explained above are as per the ANSI standard. Also, most compilers provide for additional nonstandard clauses to meet the specific nec

BLANK WHEN ZERO: BLANK WHEN ZERO is an editing clause that may be used along with a picture. This will set the whole data item to blanks of its value is equal to zero. Though,

Example of Nested if statement: Illustration: Consider the following sentence The nested IF sentence holds two IFs and one ELSE. The IF-ELSE couple has been marke

How do i write a simple cobol programming that works

Rules of read statements: The next record is identified according to the rules as shown below: (i) Whenever the READ NEXT statement is the initial statement to be executed

How do I move a single QUOTE to a field or set the value clause? "''" does not work?

PROGRAM FOR INDEXED SEQUENTIAL FILE CREATION: We have to write a program to create an Indexed Sequential File in a dynamic mode for Student particulars. Suppose just 3 fields:

Picture Clause: The picture clause explains the general characteristics of an elementary data item. These characteristics are elaborated below: Class: In COBOL the

INPUT-OUTPUT SECTION: This section holds information regarding the files to be used in the program. There are 2 paragraphs in this section- FILE-CONTROL & I-O-CONTROL. The