#include<stdio.h>
#include<conio.h>
int power(int,int); //function declaration
int main()
{
int a,b,result;
clrscr();
printf("enter two no.s");
scanf("%d%d",&a,&b);
result=power(a,b); //function Calling
printf("the result is %d",result);
getch();
return 0;
}
int power(int x,int y) //function definition
{
int p=1,i;
for(i=1;i<=y;i++)
{
p=p*x;
}
return p;
}
0 comments:
Post a Comment