You Are The Visitor Number

Sunday, March 16, 2008

/* Program to evaluate the expression (ax+b)/(ax-b) */

This Program Evaluates the expression (ax+b)/(ax-b) . As this program uses the Associativity of operators , an important topic while using so many arithmetic operators in an equation. So note this ….. Also this program uses division , obviously you have to be careful about choosing integer or float . Especially while considering the output. You take these variables as integer & see what happens??!!


 

/* Program to Evaluate the expression (ax+b)/(ax-b) */

/* Author Mitochondria Technologies Inc. (Regd.)*/

#include<stdio.h>

#include<conio.h>

void main()

{

float a,b,x,sum;

clrscr();

printf("Enter the values of a,b & x : ");

scanf("%f%f%f",&a,&b,&x);

sum=((a*x+b)/(a*x-b));

printf("The Result of the Expression is : %f",sum);

getch();

}

No comments: