C Online Compiler
Example: C Program to Find Power of a Number using While loop
C
C++
C#
Java
Python
PHP
main.c
STDIN
Run
// C Program to Find Power of a Number using While loop #include <stdio.h> int main() { int base, exponent, result = 1, i = 1; printf("Enter the Base & Exponent values:\n"); scanf("%d%d", &base, &exponent); // It will finding the power of Base value // by equiping Exponent value while(i <= exponent) { result *= base; i++; } printf("\nResult: %d^%d = %d\n", base, exponent, result); return 0; }
5 7
Output
Clear
ADVERTISEMENTS