Search This Blog

Thursday, October 13, 2011

Write a program to read my number x and to evaluate x*x-2. use a function to evaluate x*x-2 and call this function through its pointer

#include<stdio.h>
#include<conio.h>
#include<math.h>
float expr(float);
void main()
{
float x,value;
printf("Enter the value of x ");
scanf("%f",&x);
value=(*expr)(x);
printf("value =%f\n",value);
getch();
}
float expr(float x)
{
return(x*x-2);
}

No comments:

Post a Comment