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
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 |
Answer / ashlesha
take no and define array take each letter n then use pow(no,2)
| Is This Answer Correct ? | 23 Yes | 11 No |
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 |
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 |
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 |
What is difference between %d and %i in c?
Which of the Following is not defined in string.h? A)strspn() B)strerror() C)memchr() D)strod()
what are the advantage of pointer variables? write a program to count the number of vowels and consonants in a given string
What's wrong with "char *p = malloc(10);" ?
what is difference between overriding and overloading?
How to add two numbers without using arithmetic operators?
18 Answers College School Exams Tests, e track, Infosys, Pan Parag, Sapient, TCS,
How can I read in an object file and jump to locations in it?
can we declare a function inside the structure? ex: struct book { int pages; float price; int library(int,float); }b; is the above declaration correct? as it has function declaration?
When would you use a pointer to a function?
What is class and object in c?
write a program that accepts 3 numbers from the user. dispaly the values in a descending order.
Is javascript based on c?