Saturday, August 11, 2018

Arithmetic Operators in C++

In this article I would like to share with you simple program that I wrote to show how to use basic arithmetic operators in C++. I am using Dev C++ in writing this program.

I am currently accepting programming work, it project, school 

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 in my website kindly contact me also in my email address also. Thank you.
My email address are the following jakerpomperada@gmail.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.


arithmetic.cpp

#include <iostream>
#include<conio.h>

using namespace std;

int main()
{
            int a=0,b=0,c=0,d=0,e=0,f=0,g=0;
            
            cout << "Arithmetic Operators in C++";
            cout << "\n";
            cout<<"\n Enter First Number a : ";
            cin>>a;
            cout<<"\n Enter Second Number b : ";
            cin>>b;
            c=a+b;
            d=a-b;
            e=a*b;
            f=a/b;
            g=a%b;
            cout<<" Addition = "<<c<<"\n";
            cout<<" Subtraction = "<<d<<"\n";
            cout<<" Multiplication = "<<e<<"\n";
            cout<<" Division = "<<f<<"\n";
            cout<<" Modulus = "<<g<<"\n";
            getch();
}

No comments:

Post a Comment