C++ Program For Addition, Subtraction, Multiplication, Division, Modulus, And Average

Write a C++ Program For Addition, Subtraction, Multiplication, Division, Modulus, And Average.  Programming Is Nothing But Just a line of Code in Computer Language, As we Speak Multi language's same our system has its own Language like C, C++, and Java. You have to know that our Computer Knows Only '0' (Zeros) And '1' (Ones). C++ code for addition subtraction multiplication division

C++ Program For Addition, Subtraction, Multiplication, Division, Modulus, And Average

Your First Step is To Analysis The Following Code and Write And Modify it By Own. Below are some basic programs in C++ for understanding the syntax of C++

``````#include <iostream> //header file for input output
using namespace std;	// for initilize input output statement
int main()	//starting a program
{
long a, b, c;	// long is a data type you can use float,double,and int
cout << "enter the two nuber :" << endl;
cin >> a >> b;	//enter value a nad then b
c = a + b;	//store sum in c
cout << "sum is = " << c << endl;	//print sum
return 0;
}``````

C++ Program to Subtraction Two Numbers

``````#include <iostream> //header file for input output
using namespace std;	// for initilize input output statement
int main()	//starting a program
{
long a, b, c;	// long is a data type you can use float, double, and int
cout << "enter the two numbers :" << endl;
cin >> a >> b;	//enter value a nad then b
c = a - b;	//store sum in c
cout << "subtraction is = " << c << endl;	//print sum
return 0;
}``````

C++ Program to Multiplication Two Numbers

``````#include <iostream> //header file for input-output
using namespace std;	// for initialise input-output statement
int main()	//starting a program
{
long a, b, c;	// long is a data type you can use float,double,and int
cout << "enter the two nuber :" << endl;
cin >> a >> b;	//enter value a nad then b
c = a * b;	//store sum in c
cout << "multiple is = " << c << endl;	//print sum
return 0;
}``````

C++ Program to Division Two Numbers

``````#include <iostream>	//header file for input output
using namespace std;	// for initilize input output statement
int main()	//starting a program
{
long a, b, c;	// long is a data type you can use float,double,and int
cout << "enter the two nuber :" << endl;
cin >> a >> b;	//enter value a nad then b
c = a / b;	//store sum in c
cout << "devision is = " << c << endl;	//print sum
return 0;
}``````

C++ Program to Modulus Two Numbers

``````#include <iostream> 	//header file for input output
using namespace std;	// for initilize input output statement
int main()	//starting a program
{
long a, b, c;	// long is a data type you can use float,double,and int
cout << "enter the two nuber :" << endl;
cin >> a >> b;	//enter value a nad then b
c = a % b;	//store sum in c
cout << "modulus is = " << c << endl;	//print sum
return 0;
}``````

C++ Program to Average Two Numbers

``````#include <iostream>  	//header file for input output
using namespace std;	// for initilize input output statement
int main()	//starting a program
{
long a, b, c;	// long is a data type you can use float,double,and int
cout << "enter the two nuber :" << endl;
cin >> a >> b;	//enter value a nad then b
c = (a + b) / 2;	//store sum in c
cout << "avg is = " << c << endl;	//print sum
return 0;
}``````

Previous Post
Next Post