Program To Perform Basic Arithmetic On The Given Two Integer Float Values
/* Program To Perform Basic Arithmetic On The Given Two Integer Float Values Based On The Users Choice */ #include
#include
void main() { float x,y,z; char ch; clrscr(); printf("\nEnter any two integer or float values\n\n"); scanf("%f%f",&x,&y); printf("\nEnter (a)ddition, (s)ubstraction, (m)ultiplication, (d)ivision : \n"); fflush(stdin); ch=getchar(); switch(ch) { case 'A': case 'a': z = x+y; printf("\naddition = %f",z); break; case 'S': case 's': z = x-y; printf("\nsubstraction = %f",z); break; case 'M': case 'm': z = x*y; printf("\nmultiplication = %f",z); break; case 'D': case 'd': z = x/y; printf("\ndivision = %f",z); break; default : printf("\ninvalid option\n"); break; } getch(); }
Please send comments to
vgdarur.javafive@blogger.com
Copyright © 2008 - iForeRunner.com
http://www.iforerunner.com/