In this, we are going to write a program to find a number(base) raised to a number(exponent/power) with the help of C Programming Language.
#include <stdio.h>
#include <math.h>
int main()
{
double base, expo, res;
printf("Enter a base number: ");
scanf("%lf", &base);
printf("Enter an exponent: ");
scanf("%lf", &expo);
res = pow(base, expo);
printf("%.1lf^%.1lf = %.2lf", base, expo, res);
return 0;
}
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP