-->

Facebook

Jasper Roberts - Blog

Tuesday, April 28, 2015

Write a function power that computes x raised to the power y for integer x and y and returns double type value.

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

int power(int a,int b);
void main()
 {
  int x,y;
  clrscr();
  printf("enter the x:");
  scanf("%d",&x);
  printf("enter the y:");
  scanf("%d",&y);
  power(x,y);
  getch();
 }
int power(int a,int b)
 {
  double c;
  c=pow(a,b);
  printf("\n ans=%lf",c);
  return 0;
 }

4 comments: