Computer Science, asked by UTKARSHN2094, 1 year ago

Write a cobol program to illustrate add,multiply,divide,subtract,compute

Answers

Answered by missverma
0
Code for Program to perform arithmetic operations addition, subtraction, division and multiplication in Cobol

IDENTIFICATION DIVISION. PROGRAM-ID. addpro. DATA DIVISION. WORKING-STORAGE SECTION. 77 num1 . 77 num2 . 77 res . PROCEDURE DIVISION. disres. *ACCEPT THE NUMERS FROM USER. DISPLAY "ENTER NUM1". ACCEPT num1. DISPLAY "ENTER NUM2". ACCEPT num2. *ADDITION OF TWO NUMBER. ADD num1,num2 TO res. DISPLAY "ADDITION OF " num1 " AND " num2 " IS " res. *MULTIPLICATION OF TWO NUMBERS. MULTIPLY num1 BY num2 GIVING res. DISPLAY "MULTIPLICATION OF " num1 " AND " num2 " IS " res. *SUBTRACTION OF TWO NUMBERS. SUBTRACT num1 FROM num2 GIVING res. DISPLAY "SUBTRACTION Of " num1 " FROM " num2 " IS " res. *DIVITION OF TWO NUMBERS. DIVIDE num1 BY num2 GIVING res. DISPLAY num1 " DEVIDE BY " num2 " IS " res. STOP RUN. ********************************************************************** ENTER NUM1 12 ENTER NUM2 12 ADDITION OF 12 AND 12 IS 24 MULTIPLICATION OF 12 AND 12 IS 144 SUBTRACTION Of 12 FROM 12 IS 0 12 DEVIDE BY 12 IS 1
Similar questions