Responsive Ads Here

Monday, November 17, 2014

power(using math.h function)

 
power(using math.h function)

 
#include<stdio.h>
#include<math.h>
int main()
{
double base,exp;
printf("Enter base number: ");
scanf("%lf",&base);
printf("Enter power number: ");
scanf("%lf",&exp);
if(base==0&&exp==0)
{
printf("Math Error\n");
}
else
{
double power=pow(base,exp);
printf("%.3lf^%.3lf = %lf\n", base,exp,power);
}

return 0;
}

No comments:

Post a Comment

php4

<?php    // Start the session  session_start();  ?>  <!DOCTYPE html>  <html>  <head>       <link rel=&q...