C Program For FINDING POWER VALUE OF GIVEN NUMBER
Here's a C program to find power of a number using pow() Function. This pow() function is not available to use by default, you first have to
include the Math.H Header File to use this function.
CODE:
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,r,c=1;
clrscr();
printf("Enter the n value:");
scanf("%d",&n);
printf("Enter the r value:");
scanf("%d",&r);
for(i=1;i<=r;i++)
{
c=c*n;
}
printf("the power value is=%d",c);
getch();
}
0 comments:
Post a Comment