A simple program that I wrote using COBOL that will ask the user to give three numbers and then our program will find the average of the three numbers given by our user.
Program Listing
******************************************************************
Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
My mobile number here in the Philippines is 09173084360.
Sample Program Output
Program Listing
******************************************************************
* Author: MR. JAKE R. POMPERADA
* Date: AUGUST 27, 2016 SATURDAY
* Purpose: AVERAGE OF THREE NUMBERS
******************************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. AVERAGE_THREE_NUMBERS.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 NUM_1 PIC 9(4).
77 NUM_2 PIC 9(4).
77 NUM_3 PIC 9(4).
77 SOLVE_AVERAGE PIC 9(4).
PROCEDURE DIVISION.
PARA.
DISPLAY "AVERAGE OF THREE NUMBERS IN COBOL".
DISPLAY "".
DISPLAY "ENTER THE FIRST VALUE : ".
ACCEPT NUM_1.
DISPLAY "ENTER THE SECOND VALUE : ".
ACCEPT NUM_2.
DISPLAY "ENTER THE THIRD VALUE : ".
ACCEPT NUM_3.
COMPUTE SOLVE_AVERAGE = (NUM_1 + NUM_2 + NUM_3)/3.
DISPLAY "THE AVERAGE IS " SOLVE_AVERAGE.
STOP RUN.