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


Please Help Members By Posting Answers For Below Questions

can we have joblib in a proc ?

1650


When a c file is executed there are many files that are automatically opened what are they files?

589


How can I swap two values without using a temporary?

611


How do c compilers work?

603


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.

714






What is ## preprocessor operator in c?

609


How to compare array with pointer in c?

615


Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?

665


How do you declare a variable that will hold string values?

666


What is the difference between int main and void main?

571


Find MAXIMUM of three distinct integers using a single C statement

622


What does it mean when a pointer is used in an if statement?

598


List some applications of c programming language?

546


Explain what is the advantage of a random access file?

659


What are header files and what are its uses in C programming?

625