compute value of one number raised to another in c
compute value of one number raised to another in c
#include<stdio.h>
int main()
{
float x,power;
int y, i ;
printf("\n Enter two number :");
scanf("%f%f",&x<&y);
power =i=1;
while(i<=y)
{
power=power*x;
i++;
}
printf("%f to the power %d is %f\n",x,y,power);
retrun 0;
}
or
//compute value of one number raised to another in c
#include<stdio.h>
int main()
{
float x,power;
int y, i ;
printf("\n Enter two number :");
scanf("%f%f",&x,&y);
power =i=1;
while(i<=y)
{
power=power*x;
i++;
}
printf("%f to the power %d is %f\n",x,y,power);
return 0;
}
related program
1.whether a character entered through the keyboard is a special symbol or not
2.calculate of simple interest for 3 sets of p,n and r..
4.calculation of factorial value of a number in c.
Comments
Post a Comment