netoops blog

Saturday, 24 August 2013

A_Power_M

#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();
}

Tech Knowledege
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments :

Post a Comment

 
Subscribe For Free Updates!

We'll not spam mate! We promise.

Become Our Fan on Social Sites!