#include <stdio.h>
#include <conio.h>
void main()
{
float a, ans =1.0;
int i,m;
clrscr();
printf ("ENTER A & M : ");
scanf ("%f %d",&a,&m);
for (i=1;i<=abs(m);i++)
ans = ans * a;
if (m < 0)
ans = 1/ans;
printf ("%f POWER %d = %f ",a, m, ans);
getch();
}
#include <conio.h>
void main()
{
float a, ans =1.0;
int i,m;
clrscr();
printf ("ENTER A & M : ");
scanf ("%f %d",&a,&m);
for (i=1;i<=abs(m);i++)
ans = ans * a;
if (m < 0)
ans = 1/ans;
printf ("%f POWER %d = %f ",a, m, ans);
getch();
}
0 comments :
Post a Comment