Arithmetic Operator Examples with source code:
- Take input from user and perform the arithmetic operation on the input:
Source Code:
#include<iostream>
using namespace std;
int main(){
int x;
int y;
cout<<"Enter the value of 1st number"<<endl;
cin>>x;
cout<<"Enter the value of 2nd number"<<endl;
cin>>y;
cout<<"The sum is :"<<x+y;
return 0;
}
Output:
- If multiple operators appear in the same expression, multiplication, division, modulus ,addition and subtraction.
Source Code:
0 Comments