Hi i have this program and have a problem it is a basic program for exponents and now i need to add a while loop so that if the user enters a number greater that 10 it asks them to input a number lower or equal to 10, here is my code can someone help me?.
#include <stdio.h>
main( )
{
/* y */
/* calculate x */
/* */
/* where x and y are integers and y >= 0 */
int base, power;
long result = 1;
int counter = 0;
while ( x <= 10);
printf("Enter the base number : ");
scanf("%d",&base);
printf("Enter the nth power to which base will be raised");
scanf("%d",&power);
{
for (counter++ < power)
result = result * base;
}
printf("The base of %d raised to",base the %dth power is %
ld\n",power,result);
return 0;
}}}