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

if the marks obtain by a student in five different subjects are input through the keyboard write a program to find out the aggregate marks and percentage marks obtained by the student. assume that the maximum marks that can be obtained by a student in each subject is 100.

If lengths of three sides of a tringle are input through the keyboard write a program to find the area of tringle.

the length and breadth of a rectangle and radius of a circle are input through the keyboard. write a program to calculate the area and perimeter of the rectangle, and the area and circumference of the circle