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

VALUE CLAUSE: The value clause defines the preliminary value of the data item. Normally initialization will be completed just before the first statement in the procedure di

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

Character Set: To study any language, first one should know the alphabets of the language and they are termed as character set in general. There are 50 different characters in

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

PROGRAM FOR INVENTORY  We have to write a program to update the inventory file. Consider 2 files,viz, invfile an tranfile. Invfile has 3 fields pno,name,qty. Tranfile has 3 fil

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

Example of Perform statement: PERFORM BEGIN-CALCULATION THRU END-CALCULATION. Assume, BEGIN-CALCULATION and END-CALCULTION is paragraph names. The execution of the PERFORM

Configuration Section: This section holds an overall specification of the computer used for the purpose of the compilation and execution of the program. There are in all 3 par

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