answersLogoWhite

0


Best Answer

1. (B) WRITE A PROGRAM TO FIND THE SUM OF INDIVIDUAL DIGITS IN THE GIVEN 'n'

DIGIT DECIMAL NUMBER.

IDENTIFICATION DIVISION.

PROGRAM-ID. PRO.

ENVIRONMENT DIVISION.

DATA DIVISION.

WORKING-STORAGE SECTION.

77 NUM PIC ZZZ9.

77 N PIC 9999.

77 SUM PIC 9(4) VALUE 0.

77 R PIC 9.

77 SUM1 PIC Z(4)9.

PROCEDURE DIVISION.

PARA1.

DISPLAY " ENTER THE NUMBER ".

ACCEPT N.

MOVE N TO NUM.

DISPLAY " ".

DISPLAY " THE NUMBER IS : " NUM.

PERFORM PARA2 UNTIL N = 0.

MOVE SUM TO SUM1.

DISPLAY " ".

DISPLAY " THE SUM OF NUM IS " SUM1.

STOP RUN.

PARA2.

DIVIDE N BY 10 GIVING N REMAINDER R.

COMPUTE SUM = SUM + R.

OUTPUT:

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write cobol program to find sum of two numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write an assembly language program to find the sum of n numbers using array?

write an assembly language program to find sum of N numbers


How to write a C program to find largest 2 numbers using pointers?

program to find maximum of two numbers using pointers


How do you write a VBnet program to find the prime numbers between 100 to 200?

VBnet program to find the prime numbers between 100 to 200?


Write a Shell program to find the smallest number from a set of numbers?

k


Second sem cobol question paper previous year?

Each question carries 10 marks. Explain the environment Division with example. Explain the Data Division with an example. Explain the various types of Move statements. Write a COBOL program to find a given integer is odd or even. An input file consists of the following Employee name, Employee number, Basic pay. Write a COBOL program to create an Indexed file which consists of Employee-name, Employee-number, Basic-pay and DA (DA = 25% of Basic-pay) Assume that an organisation has 20 departments. Each department has 5 stores. You are provided with total monthly sales of each stores for the month December 2000. Write a COBOL program to read the data, to write the sales report department wise and also write the total sales of the organisation.


Write a program to find the product of two numbers using Halving and Doubling method?

i need this answer


Write a C program to find the square of two numbers?

Please visit http://talentsealed.blogspot.com/2009/10/to-find-sqaure-of-numbers-using-c.htmlfor the answer.


Write a C program to find the sum of all prime numbers?

Since there is an infinite set of prime numbers the answer would be infinity.


Write a java program to find sum of even and odd numbers in given array?

for(int i = 1; i < 100; i+=2) { System.out.println(i); }


Where can a person find information about COBOL?

COBOL was originally designed by Grace Hopper and is on of the oldest programming languages. The name stands for Common Business Orientated Language. More information can be found at websites such as Wikipedia.


How do you write Square program using vb?

write a vb program to find the magic square


Write a Program in c to find palindrome numbers between any two numbers?

please somebody should help me answer this question..I have a project on it even! It seems almost impossible at the moment.