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 the difference between arrays and linked list

26 Answers   MAHINDRA, Tech Mahindra, Wipro,


How can I invoke another program or command and trap its output?

0 Answers  


Write a code to generate divisors of an integer?

0 Answers   Ericsson,


what are the advantage and disadvantage of recursion

5 Answers  


Why doesn't C support function overloading?

2 Answers  






In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]

0 Answers   Infosys,


What is the hardest programming language?

0 Answers  


Disadvantages of C language.

0 Answers   Impetus,


What is a program flowchart and how does it help in writing a program?

0 Answers  


who will call your main function in c under linux?

2 Answers  


What does static variable mean in c?

0 Answers  


what will be the output: main(){char ch;int a=10;printf("%d",ch);}

36 Answers   Accenture, TCS, Wipro,


Categories