Calculate Power of a number using Function

/* Write a program to Calculate Power of a number using Function*/

#include<stdio.h>
#include<conio.h>
void main()
{
float power (float,int);
int b;
float a,p;
clrscr();
printf("Enter two numbers");
scanf(%f%d",&a,&b);
p=power(a,b);
printf("\n %f raise to %d =%f,a,b,p);
getch();
}
float power(float x,int y)
{
if(y==0)
return(1);
else
return(x*power (x,y-1));
}

Who's online

We have 20 guests and no members online

About Us

Harsimran Singh

Hello

This website is a special gift for Programming Lovers , which want to learn basic Programming Languages and want to develop there skills Read More....

Our work

Find Us

This email address is being protected from spambots. You need JavaScript enabled to view it.

Harsimran Singh(Facebook)

Harsimran Singh(about.me)

Harsimran Singh(G+)