Program for multiply verb, COBOL Programming

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.

Program- id. Mulverb.

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.

 Multiply a by b giving  c.

 Move c to e-c.

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

  Stop run.

Description:   This program gets 2 inputs from the user.

                      It multiplies them by using the MULTIPLY verb. 

                      a*b is found 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:29:26 AM | Location : United States







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

Write discussion on Program for multiply verb
Your posts are moderated
Related Questions
Example of Sign condition: The illustration below describes the use of the sign condition. Illustration:     77  BALANCE  PIC  S9 (6) V99.       .       .     I

OPEN STATEMENT: Whenever a READ or a WRITE operation is executed on a file, then it should be open. The opening of a file may be completed with the help of the OPEN verb. With

PROGRAM FOR PERFORM - VARYING: We have to write a program to elaborate PERFORM ...VARYING Identification division. Program- id. PerfVary. Environment division. Dat

Illustration of Search verb: To illustrate the other use of SEARCH verb, assume we wish to search the similar tab to find the number of persons whose deposited amount is more

CONDITION - COBOL Programming: The condition is an entity which at one point of time can have only one of the two values - true or false. As we already know that, the IF verb

File- Section &Working-Storage Section: a) FILE SECTION: The FILE SECTION includes the explanation of all data items that must be read from or written onto some external

We have input file, record layout is EMP ID (6 char) , EMP NAME (20 char), Designation (3 char),Salary (5 digit) Base Branch (10char) Grade (3 Alphanumeric). This is the input f

Valid and Invalid Word - Cobol words: Valid Word             Invalid Word & Reason emp-sal                  -pay   ( it starts with a hyphen)  TOTAL MARK (blank space em

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,

Structure of a COBOL Program: Every COBOL program should have the 4 divisions in the order in which they are specified below: 1. Identification division 2. Environment D