good morning ;
this programme is created to find x^y
but it show every time an random number !!!
could you help me please
and thank you so much ....
Code:
#include <stdio.h>
int nbpos (int x)
{
int c,cpt ;
do
{
x=x/10;
c++;
}
while (x!=0);
return c;
}
int puiss (int x , int y)
{
int i=1,s=1;
printf ("\n--- x == %d --- s == %d---- y == %d\n",x,s,y);
/*
for (i=1;i<y;i++)
{
s=s+1;
}
*/
return s;
}
main()
{
int x=10,y,e;
scanf("%d",&y);
printf (" %d ********** \n",nbpos(y));
e=nbpos(y);
e=puiss (x,e);
printf("////// %d \n",e);
}