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
Identification Division: The Identification Division is the first division of each and every COBOL source program. The paragraph PROGRAM-ID is necessary in most of the mac

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


READ STATEMENTS: The common format for the read statements is as shown bellow. Format 1: READ file-name RECORD [ INTO   identifier ] [  ;  AT   END     imperative-s

Record Description for the Variable-length Records: When the variable- length records consists of records of various lengths, each record type is to be explained at level 01 f

DELETE STATEMENT : The file should be opened in the I-O mode. If the access is SEQUENTIAL, the INVALID KEY phrase must be specified. Rather than, the last input-output state

I uploaded a file from PC to Mainframe, variable LRCL 256. In my COBOL program I defined it as FD INPUT-FILE LABEL RECORDS ARE OMITTED BLOCK CONTAINS 0 RECORDING MODE

Abbreviation: The Consecutive relational conditions in a compound condition can be abbreviated in many cases as shown: (i) When the subjects in the consecutive relational c

MULTIPLY VERB:   The Multiply Verb causes one or more multiplicands to be multiplied by the multiplier and to store the products. The form of the MULTIPLY verb is as shown be

Rules for apply for the condition name: The rules below apply for the condition name. (i) The Condition names should be explained at level 88. The level number starts in ma