T
Three Headed Monkey
write a program in "C" language that computes 9^(8^(7^(6^(5^(4^(3^(2^1)))))))
I tried
#include <stdio.h>
int pow(int n)
{
int i,power;
power=n;
for(i=0;i<n;i=i+1)
power=power*power;
return power;
}
void main()
{
int result;
char ignore;
result= pow(9,pow(8,pow(7,pow(6,pow(5,pow(4,pow(3,pow(2,1))))))));
printf("\nresult is %d", result);
printf("\nPress ENTER");
gets(&ignore);
}
but it does not work.
how to do that in "C" standard language?
I am using lcc-win32 compiler & windows 98.
help!
I tried
#include <stdio.h>
int pow(int n)
{
int i,power;
power=n;
for(i=0;i<n;i=i+1)
power=power*power;
return power;
}
void main()
{
int result;
char ignore;
result= pow(9,pow(8,pow(7,pow(6,pow(5,pow(4,pow(3,pow(2,1))))))));
printf("\nresult is %d", result);
printf("\nPress ENTER");
gets(&ignore);
}
but it does not work.
how to do that in "C" standard language?
I am using lcc-win32 compiler & windows 98.
help!