Write a program that takes a 5 digit number and calculates
2 power that number and prints it

Answer Posted / s.sivarajan

question :
Write a program that takes a 5 digit number and calculates
2 power that number and prints it

answer:

that question ask the exponential.
In the compute clause we use the ** for exponential
so write a program using this.

example:

IDENTIFICATION DIVISION.
PROGRAM-ID. SIVARAJAN.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 A PIC 9(10) VALUE 2.
01 B PIC 9(10) VALUE 12345.
01 EXP PIC 9(25).
PROCEDURE DIVISION.
START-PARA.
COMPUTE EXP=A**B.
DISPLAY EXP.
STOP RUN.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are different storage class specifiers in c?

588


Explain the use of fflush() function?

597


In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)

1610


What is a void * in c?

573


What is pragma in c?

604






What is null character in c?

656


What is the correct code to have following output in c using nested for loop?

595


When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.

1491


Explain how can you avoid including a header more than once?

581


What is console in c language?

586


Is register a keyword in c?

606


write a c program in such a way that if we enter the today date the output should be next day's date.

1660


what do you mean by inline function in C?

597


What is the c value paradox and how is it explained?

551


What is array in c with example?

582