#include <stdio.h>
#include <conio.h>
int main()
{
float a,b,max,c=0,temp;
int ch;
clrscr();
do
{
clrscr();
printf("\nEnter the two values : \n");
scanf("%f",&a);
scanf("%f",&b);
printf("Enter\n1: addition\n2: subraction\n3: multilication\n4: division\n5: To check maximum number entered till now \n6: Exit");
scanf("%d",&ch);
if((a>temp)||(b>temp))
{
if(a>b)
{
max=a;
temp=max;
}
if(b>a)
{
max=b;
temp=max;
}
}
switch (ch)
{
case 1:
printf("\nThe addition of those two values are : %f",(a+b));
break;
case 2:
printf("\nThe subraction of those two values are : %f",(a-b));
break;
case 3:
printf("\nThe multiplication of those two values are : %f",(a*b));
break;
case 4:
printf("\nThe division of those two values are : %f",(a/b));
break;
case 5:
printf("\nThe maximum number entered from the begning of the program is : %f",max);
break;
case 6:
printf("\nPress any key.......");
c=1;
break;
}
}while (c!=1);
getch();
return 0;
}
Here is the code....for u....if any thing to know more please send me a mail
Regards
Rajesh G
rajeshg@infotechsw.com