PROGRAMMING SEEKERS
.
Friday, May 5, 2017
C program to calculate power of number.
#include<stdio.h>
#include<conio.h>
int main()
{
int num,pow,res=1;
printf("\nEnter number and power : ");
scanf("%d %d",&num,&pow);
while(pow>=1)
{
res=res*num;
pow--;
}
printf("%d",res);
return 0;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment