From 5e47cfb7613fe70d73fcc75f9170a0486c50409d Mon Sep 17 00:00:00 2001 From: shubhsiro <47056040+shubhsiro@users.noreply.github.com> Date: Fri, 4 Oct 2019 22:36:59 +0530 Subject: [PATCH] Create --- C/power of a number | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 C/power of a number diff --git a/C/power of a number b/C/power of a number new file mode 100644 index 0000000..f803bfa --- /dev/null +++ b/C/power of a number @@ -0,0 +1,19 @@ +#include +using namespace std; +void power(int,int); +int main() +{ + int x,y; + cout<<"Enter the value of x and y"<>x>>y; + power(x,y); + return 0; +} +void power(int a,int b) +{ + int i,pro=1; + for(i=1;i<=b;i++) + pro=a*pro; + cout<<"X raised to the power y: "<