Write a program that takes a 5 digit number and calculates 2
power that number and prints it
Answer Posted / manish soni bca 3rd year jaipu
#include<stdio.h>
#include<conio.h>
void main()
{
int n,p;
long int ans;
printf("Enter the number ans power");
scanf("%d %d",&n,&p);
ans=1;
while(p>0)
{
ans*=n;
p--;
}
printf("%ld",ans);
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the modulus operator?
Write a code to generate a series where the next element is the sum of last k terms.
Explain output of printf("Hello World"-'A'+'B'); ?
What is I ++ in c programming?
What is pointer to pointer in c language?
What is the difference between array and linked list in c?
What is wrong with this declaration?
Are pointers integer?
What does main () mean in c?
What's the total generic pointer type?
What is difference between structure and union in c programming?
What is a lookup table in c?
Is c object oriented?
Is it fine to write void main () or main () in c?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none