Here in this Program we shall discussed about the Arithmetical Operation but with different value. In this Program we can enter the different values in execution time.
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b;
int sum,difference,product,quotient;
cout<<"enter the value of a ";
cin>>a;
cout<<" \n enter the value of b";
cin>>b;
sum=a+b;
difference=a-b;
product=a*b;
quotient=a/b;
cout<<"\n the sum of "<<a<<" & "<<b<<" is ="<<sum<<endl;
cout<<"\n the difference of "<<a<<" & "<<b<<" is ="<<difference<<endl;
cout<<"\n the product of "<<a<<" & "<<b<<" is ="<<product<<endl;
cout<<"\n the quotient of "<<a<<" & "<<b<<" is ="<<quotient<<endl;
getch();
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b;
int sum,difference,product,quotient;
cout<<"enter the value of a ";
cin>>a;
cout<<" \n enter the value of b";
cin>>b;
sum=a+b;
difference=a-b;
product=a*b;
quotient=a/b;
cout<<"\n the sum of "<<a<<" & "<<b<<" is ="<<sum<<endl;
cout<<"\n the difference of "<<a<<" & "<<b<<" is ="<<difference<<endl;
cout<<"\n the product of "<<a<<" & "<<b<<" is ="<<product<<endl;
cout<<"\n the quotient of "<<a<<" & "<<b<<" is ="<<quotient<<endl;
getch();
}
OUTPUT WILL BE:
No comments:
Post a Comment