HTML Tutorial || Networking Assignment || Computer Full Forms || Ms-Office Shortcut Keys || Ms-Office Notes || Number System Notes || Internet Assignment
JavaScript Tutorial || CSS Tutorial || Operating System Notes || History of Computer Assignment || Netwoking Notes || Computer Fundamentals Notes

C Program to Find Power of any Number X^Y ?


Q:- Write a C Program to Find Power of any Number X^Y ?
Input
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
int base,expo,power;
clrscr();
printf(“Enter a Base=”);
scanf(“%d”,&base);
printf(“Enter a Exponent=”);
scanf(“%d”,&expo);
power=pow(base,expo);
printf(“%d^%d=%d”,base,expo,power);
getch();
}


Output

Enter a Base = 5
Enter a Exponent = 3
5^3 = 125

Comments