Program for compute verb, COBOL Programming

PROGRAM FOR COMPUTE VERB:

We have to write an easy program to elaborate the COMPUTE verb. 

Identification division.

Program- id. compverb.

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.

7  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.

            Compute c= a+b.

       Move c to e-c.

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

  Stop run.

Posted Date: 10/17/2012 1:31:41 AM | Location : United States







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

Write discussion on Program for compute verb
Your posts are moderated
Related Questions
PROGRAM FOR MULTIPLY VERB: We have to write a simple program to elaborate MULTIPLY verb. You can also use the edit characters in the program. Identification division. Pr

PROGRAM FOR ELECTRICITY BILL: An electricity company supplies electricity to 4 types of customers coded 1, 2, 3 & 4.The rate schedule for customers is shown in one table as

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

What is the difference between subscript and index

FILE-CONTROL: The FILE-CONTROL paragraph names each and every file and identifies the first medium through file control entries. The basic format of a file control entry is gi

B (Blank Insertion) : The occurrence of a B anyplace in the picture will insert a space character in the edited data. There can be more than one B in the picture. Examples:

PROGRAM FOR PERFORM ...UNTIL We have to write a program to find the sum of "n" natural numbers. Identification division. Program- id. PerfUntil. Environment division.

Evaluate is like a case statement & Evaluate  stamenet can be used to replace nested Ifs. The difference b/w EVALUATE and case is that there is no 'break' is required for EVALUATE

PROGRAM FOR ADD VERB: We have to write a simple program to elaborate the ADD verb. You can also use edit characters in the program. Identification division. Program- id.

FILE-CONTROL paragraph for the indexed files: The common format for the SELECT clause for a file is as shown below: SELECT  file-name  ASSIGN   TO  implementor -name