Using the mathematical library functions.

#include <stdio.h>
#include <math.h>

int main(void)
{
float num, base, index, res;

printf("\nEnter a number : ");
scanf("%f", &num);

res = sqrt(num);

printf("\nSquare root of %f is %f", num, res);

printf("\nEnter base and index : ");
scanf("%f%f", &base, &index);

res = pow(base, index);

printf("\n%f raised to %f is %f", base, index, res);

return 0;
}

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin