Saturday, August 20, 2011

Program to find the power b of entered number a.

//Program to find the power b of entered number a.
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
 float a;
 int b;
 double cu;
 char c;
 clrscr();
 printf("program to find the power b of entered number a");
 while(1)
 {
 printf("\n Enter the number a: ");
 scanf("%f",&a);

 printf("\n Enter the number b: ");
 scanf("%d",&b);
  cu=pow(a,b);
    printf(" \nThe %d power of the %f is %.2lf",b,a,cu);

  printf("\n wheather you want perform more calculations please press y for \"Yes\" or n for \"No\": ");
 c=getche();
 if(c=='y'||c=='Y')
  continue;
  else
  break;
}
 getch();
}

Previous Next Home
0 Comments
Comments

Leave a Comment

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Twitter Delicious Facebook Favorites More