Power of Number in C. The power of a number determines how many times it should be multiplied. The product of multiplying a number by itself is called power. What number is being multiplied is indicated by the base number. The exponent, which is a little number printed above and to the right of the base number, indicates the number of times the base number is multiplied.
int base, exp;
long double value = 1.0;
printf("Enter a base number");
printf("Enter an exponent");
while (exp != 0)
value *= base;
printf("Answer = %.0Lf", value);
Enter a base number4
Enter an exponent5
Solution is 1024
Power of Number in C to Calculate Decimal Number
What is Exponent Number in C Program
Predecrement Operator in C Program
What is Format Specifier in C
During input and output, the format specifier is utilised. It’s a technique to notify the compiler what kind of data is in a variable when using scanf() or printf() to take input (). Percentages such as c, d, and f are some instances.
Long integer values are represented using the percent ld format specifier. For printing the lengthy integer value contained in the variable, the printf() function is used.