Write a program to find the sum, difference, product and quotient of two numbers using C++
#include
#include
#include
void main()
{
char ch;
float a,b,r;
clrscr();
cout<<”\n1. Sum”; cout<<”\n2. Difference”; cout<<”\n3. Product”; cout<<”\n4. Quotient”; cout<<”\n\nEnter your choice……”; ch=getchar(); switch(ch) { case ‘1’: cout<<”Enter two numbers : “; cin>>a>>b;
r=a+b;
cout<<”Sum : “<
r=a-b;
cout<<”Difference : “<
r=a*b;
cout<<”Product : “<
r=a/b;
cout<<”Quotient : “<
default:
cout<<”Invalid choice “;
}
getch();
}
Saturday, December 5, 2009
Home »
AND QUOTIENT PROGRAM USING C++
,
DIFFERENCE PROGRAM USING C++
,
EXAMPLE SWITCH CASE IN C++
,
PRODUCT PROGRAM USING C++
,
SUM PROGRAM USING C++
» C++->SUM DIFFERENCE PRODUCT AND QUOTIENT
C++->SUM DIFFERENCE PRODUCT AND QUOTIENT
4:56 AM
AND QUOTIENT PROGRAM USING C++, DIFFERENCE PROGRAM USING C++, EXAMPLE SWITCH CASE IN C++, PRODUCT PROGRAM USING C++, SUM PROGRAM USING C++
No comments
0 comments:
Post a Comment