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..

3.Demonstrates the use of new and delete operators for dynamic allocation and de-allocation of memory of C++. 

4.calculation of factorial value of a number in c. 




Comments

Popular posts from this blog

class with array in c++ (memory allocatin & using array in classes)

constructor with default arguments

constructor overloading in c++ programming