Skip to main content

C++ Arithmetic Operators Visual Studio

C++ Arithmetic Operators



Arithmetic Operators use to perform Arithmetic( + , - , * , /, % ) tasks between two or more numbers like Addition , Subtraction , Multiplication , Division and Remainder.

+ Operator also use to concatenation of strings and it will add 2+2 = 4 between numbers

In below example we'll use all basic Arithmetic Operators to perform basic tasks.
Simple Example of Arithmetic Operators
Example

Arithmetic Operators

  1. #include <iostream>
  2. using namespace std; 
  3. int main(){ 
  4.     int x = 10 ; 
  5.     int y = 5 ; 
  6.     cout <<" X + Y = " << ( x + y ) << endl ;
  7.     cout <<" X - Y = " << ( x - y ) << endl ;
  8.     cout <<" X * Y = " << ( x * y ) << endl ;
  9.     cout <<" X / Y = " << ( x / y ) << endl ;
  10.     cout <<" X % Y = " << ( x % y ) << endl ; 
  11. return 0; 
  12. }
Console :
X + Y = 15
X - Y = 5
X * Y = 50
X / Y = 2
X & Y = 0

Watch Video

C++ in Urdu Hindi Arithmetic Operators Beginners Tutorial 2017

Comments