#include<stdio.h>
#include<stdlib.h>
float exp1(float x, int n)
{
float c;
for (c=1.0; n>0; n--)
c *= x;
return c;
}
main()
{
float x;
int n;
printf("donner x : \n");
scanf("%f",&x);
printf("donner n : \n");
scanf("%d",&n);
printf("%f a la puissance %d egal a : %f \n",x,n,exp1(x,n));
system ("pause");
}
#include<stdlib.h>
float exp1(float x, int n)
{
float c;
for (c=1.0; n>0; n--)
c *= x;
return c;
}
main()
{
float x;
int n;
printf("donner x : \n");
scanf("%f",&x);
printf("donner n : \n");
scanf("%d",&n);
printf("%f a la puissance %d egal a : %f \n",x,n,exp1(x,n));
system ("pause");
}