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.
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.
Source Code 1
Source Code 2
- Code:
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
int a,b,c;
clrscr();
cout<<"\n Enter First Number: ";
cin>>a;
cout<<"\n Enter Second Number:";
cin>>b;
cout<<"\n Enter Third Number:";
cin>>c;
cout<<"\n The Sum Is = "<<a+b+c;
cout<<"\n The Subtraction is ="<<a-b-c;
cout<<"\n The Multiplication is ="<< (a*b)*c;
cout<<"\n The Division is ="<<(a/b)/c;
getch();
}
Source Code 2
- Code:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c;
cout<<"Enter First Integer";
cin>>a;
cout<<"Enter Second Integer";
cin>>b;
cout<<"Enter Third Integer";
cin>>c;
cout<<"\ The Sum ="<<a+b+c<<endl;
cout<<"The Subtraction ="<<a-b-c<<endl;
cout<<"The Multiplication ="<<a*b*c<<endl;
cout<<"The Division ="<<(a/b)/c<<endl;
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.[In addition it also stores the values of mathematical expression used in the code i.e + , -, *,/]
» Structure of a program
» What Is a Computer Program?
» Structure of a program
» What Is a Computer Program?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|