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

Answers were Sorted based on User's Feedback



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

Answer / makthar basha

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

Is This Answer Correct ?    103 Yes 24 No

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

Answer / ashlesha

take no and define array take each letter n then use pow(no,2)

Is This Answer Correct ?    23 Yes 11 No

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

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

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

Answer / nikita

#include<stdio.h>
#include<math.h>
void main()
{
int a;
double c;
scanf("%5d",&a);
c=pow(a,2);
printf("%f",c);
}

Is This Answer Correct ?    5 Yes 3 No

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

Answer / amarnathreddy

take one array and that one initilize to n[10]=pow(no,2).
here no =given five digits no

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More C Interview Questions

1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures

0 Answers   KPIT,


why we need function pointers?

3 Answers  


What is cohesion and coupling in c?

0 Answers  


PLS U SENS ME INTERVIEW O. MY EMAIL ADD, SOFIYA.SINGH@GMAIL.COM

0 Answers  


What is hash table in c?

0 Answers  






What does the format %10.2 mean when included in a printf statement?

0 Answers  


Explain Basic concepts of C language?

0 Answers   EXL,


two progs are given. one starts counting frm 0 to MAX and the other stars frm MAX to 0. which one executes fast.

5 Answers   Verifone,


what are non standard function in c

0 Answers  


What is an identifier?

0 Answers  


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

0 Answers  


write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.

0 Answers   HCL,


Categories