Sunday, October 6, 2019

Basic Arithmetic Operations in C++

In this article I will share you guys a sample program that I created using C++ that will ask the user to give two numbers and then the program will perform basic arithmetic operations such as addition, subtraction, multiplication and division. The code is very simple and easy to understand.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.


My personal website is http://www.jakerpomperada.com.



Sample Program Output


Program Listing

basic_math.cpp

#include <iostream>

using namespace std;


int main() {
int a=0,b=0, sum=0, difference=0;
int product=0, quotient=0;
cout <<"\n\n";
cout << "\tBasic Arithmetic Operations in C++";
cout <<"\n\n";
cout << "\tEnter two numbers :";
cin >> a >> b;
sum = (a+b);
difference = (a-b);
product = (a*b);
quotient= (a/b);
cout <<"\n";
cout << "\tThe sum of " << a << " and "
      << b << " is " << sum << ".\n";
      
cout << "\tThe difference of " << a << " and "
      << b << " is " << difference << ".\n";
cout << "\tThe product of " << a << " and "
      << b << " is " << product << ".\n";
cout << "\tThe quotient of " << a << " and "
      << b << " is " << quotient << ".\n";
cout <<"\n";
cout <<"\tEnd of the Program";
}



No comments:

Post a Comment