#include<stdio.h>
#include<conio.h>
long Power(int a, int b)
{
long p=1;
int i;
for(i=1;i<=b;i++)
for(i=1;i<=b;i++)
p=p*a;
return p;
}
void main ()
{
int a,b;
clrscr();
printf("Enter any positive integer: ");
scanf ("%d", &a);
{
int a,b;
clrscr();
printf("Enter any positive integer: ");
scanf ("%d", &a);
printf("Enter any positive integer: ");
scanf ("%d", &b);
printf("%d to the Power of %d=%d",a,b,Power(a,b)) ;
getch ();
}
scanf ("%d", &b);
printf("%d to the Power of %d=%d",a,b,Power(a,b)) ;
getch ();
}
No comments:
Post a Comment