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

What is getche() function?

0 Answers  


What are the types of assignment statements?

0 Answers  


I have an array of 100 elements. Each element contains some text. i want to: append a star character to the end of every fifth element remove every second character from every tenth element, and… add a line feed (ascii 10) after the 30th character of every array element whose length is greater than 30 characters.

1 Answers  


pgm to reverse string using arrays i.e god is love becomes love is god) (assumption:only space is used for seperation of words) no addtional memory used.i.e no temporary arrays can used.

4 Answers   Persistent, Valyoo,


What tq means in chat?

0 Answers  






How to swap 3 numbers without using 4th variable?

5 Answers  


What is an array in c?

0 Answers  


why the execution starts from main function

9 Answers  


Explain how can you tell whether a program was compiled using c versus c++?

0 Answers  


What is Lazy evaluation in C? Give an example.

1 Answers  


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

0 Answers  


What is a sequential access file?

0 Answers  


Categories