create a loop of your choice that will subtract the number from itself the number of times equal to the number itself.
for example if i enter a 3 it will do 3-3-3 = -3 or 4 4-4-4-4= -8
thank you for the help in advance
Code:
#include <stdio.h>
int main()
{
int base, exponent, counter, result = 1;
printf("The number you entered is \n");
scanf("%d", &base);
for(counter = 0; counter <base; counter++)
{
result = result-base; // this giving me the wrong number
}
printf("The result is %d" , result);
return 0;
}