Created
June 8, 2020 07:22
-
-
Save LokeshKumarES/e6abd9b4112b124972ba2dc57536cdf8 to your computer and use it in GitHub Desktop.
Write a function power (a, b), to calculate the value of a raised to b.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
#include<math.h> | |
int power(int a, int b); | |
int main() | |
{ | |
int a, b, res; | |
printf("Enter a: "); | |
scanf("%d", &a); | |
printf("Enter b: "); | |
scanf("%d", &b); | |
res = power(a, b); | |
printf("Result: %d", res); | |
} | |
int power(int a, int b) | |
{ | |
int x; | |
x = pow(a, b); | |
return x; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment