SCHOOL OF CODE BUILDERS
Learn To CODE. Become A DEVELOPER.
Pages
HOME
DATA STRUCTURES
STRINGS
ARRAYS
MATRIX
BINARY TREES
LINKED LIST
STACK
QUEUE
SORTING
SEARCHING
C
PYTHON
PSEUDOCODE
CONTEST PROBLEMS
ALGORITHMS
PATTERNS
PHP
C PUZZLES
C INTERVIEW QUESTIONS
JAVA
C++
HASHING
RECURSION
BASIC C PROGRAMS
TCS-CODEVITA
FACEBOOK
CONTACT US
C program to find nth power of a number
C program to find nth power of a number
Input:
Enter the number:
5
Enter the power to find pth power of n:
3
Output:
result of raising 5 to power of 3 is 125
Implementation:
#include
#include
#include
int main(void) { int n,p,res; printf("Enter the number:\n"); scanf("%d",&n); printf("Enter the power to find pth power of n:\n"); scanf("%d",&p); /* finding pth power of n i.e., (n)^p */ res=pow(n,p); printf("result of raising %d to power of %d is %d",n,p,res); return 0; }
PREVIOUS
NEXT
HOME