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
can we have joblib in a proc ?
When a c file is executed there are many files that are automatically opened what are they files?
How can I swap two values without using a temporary?
How do c compilers work?
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.
What is ## preprocessor operator in c?
How to compare array with pointer in c?
Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?
How do you declare a variable that will hold string values?
What is the difference between int main and void main?
Find MAXIMUM of three distinct integers using a single C statement
What does it mean when a pointer is used in an if statement?
List some applications of c programming language?
Explain what is the advantage of a random access file?
What are header files and what are its uses in C programming?