Monday, 2 March 2015

C++ Program To Find Addition, Subtraction , Multiply, Divide And Average

Problem :- C++ Program To Find Addition, Subtraction , Multiply, Divide And Average .

Solution :-

#include<iostream>                      
using namespace std;                    
int main()                                    
{
long a,b,c;                                 

cout<<"enter the two number :"<<endl;
cin>>a>>b;                              

c=a+b;

cout<<"sum is = "<<c<<endl;

cout<<"enter the two nuber :"<<endl;
cin>>a>>b;                                           

c=a-b;

cout<<"sub is = "<<c<<endl;

cout<<"enter the two nuber :"<<endl;
cin>>a>>b;

c=a*b;

cout<<"mul is = "<<c<<endl; 

cout<<"enter the two nuber :"<<endl;
cin>>a>>b;

c=a/b;

cout<<"dev is = "<<c<<endl; 

cout<<"enter the two nuber :"<<endl;
cin>>a>>b;

c=a%b;

cout<<"modulus is = "<<c<<endl; 

cout<<"enter the two nuber :"<<endl;
cin>>a>>b;

c=(a+b)/2;  

cout<<"avg is = "<<c<<endl; 
return 0;
}

Output:-



C++ Program To Find Addition, Subtraction , Multiply, Divide And Average

1 comment:
Write comments

Recommended Posts × +