Tuesday, April 7, 2015

39. What is difference between library function and user-define function” Write a program using user define function to calculate y raise to power x. [2067]


#include <stdio.h>
#include <conio.h>
#include <math.h>
long int yraisex(int, int);
void main()
{
int bese,exp;
long int result;
clrscr();
pr1ntf(”\n Input base and exponent values:-);
scanf("%d%d",&base,&exp);
result=yraisex(base,exp);
printf("\n Result = %ld",result);
getch();
long int yraisex(int x,int y)
{
long int z;
z=pow(x,y);
return (z);
}

No comments:

Post a Comment