Posted by : ANIMESH SHAW
Tuesday, 1 May 2012
POWER
OF A NUMBER PROGRAM;
//C
Program To FIND POWER OF A NUMBER USING C PROGRAM
#include<conio.h>
#include<stdio.h>
main(){
int pow,num,i=1;
long int sum=1;
printf("\n Enter a number: ");
scanf("%d",&num);
printf("\n Enter Value for power:
");
scanf("%d",&pow);
while(i<=pow){
sum=sum*num;
i++;
}
printf("\n %d to the power %d is :
%ld",num,pow,sum);
getch();
}

Post a Comment