A C++ Program that takes three inputs from the user, stores them in variables,performs 4 mathematical operation on them and then displays the result to user.[In addition it also stores the values of mathematical expression used in the code i.e + , -, *,/]
Page 1 of 1
A C++ Program that takes three inputs from the user, stores them in variables,performs 4 mathematical operation on them and then displays the result to user.[In addition it also stores the values of mathematical expression used in the code i.e + , -, *,/]
- Code:
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
int a,b,c,Sum,Subtraction,Multiplication,Division;
clrscr();
cout<<"\n Enter First Number: ";
cin>>a;
cout<<"\n Enter Second Number:";
cin>>b;
cout<<"\n Enter Third Number:";
cin>>c;
Sum=a+b+c;
Subtraction=a-b-c;
Multiplication=(a*b)*c;
Division=(a/b)/c;
cout<<"\n The Sum Is = "<<Sum;
cout<<"\n The Subtraction is ="<<Subtraction;
cout<<"\n The Multiplication is ="<<Multiplication;
cout<<"\n The Division is ="<<Division;
getch();
}
Code Maestro- Posts : 100
Join date : 2012-10-31
Similar topics
» A C++ Program that takes three inputs from the user, stores them in variables, performs 4 mathematical operation on them and then displays the result to user.
» Structure of a program
» What Is a Computer Program?
» What Is Source Code?
» What Is a Source Code Editor?
» Structure of a program
» What Is a Computer Program?
» What Is Source Code?
» What Is a Source Code Editor?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|