JavaScript Arithmetic Operators
JavaScript Arithmetic Operators
1] Addition (+)
2] Subtraction (-)
3] Multiplication (*)
4] Exponentiation (**)
5] Division (/)
6] Modulus (%)
7] Increment (++)
8] Decrement (--)
Example :-
Operators | Name | Example | Result |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
1] Addition (+)
Example (Source Code) :-
let a= 1000 b= 2000; document.write( "Addition of two number =",a+b);
let a= 1000
b= 2000;
document.write( "Addition of two number =",a+b);
Output :-
2] Subtraction (-)
Example (source Code) :-
let a= 4000
b= 2000;
document.write( "Subtraction of two number =",a-b);
Output :-
3] Multiplication (*)
Example :-
let a= 4000 b= 2000; document.write( "Multiplication of two number =",a*b);
let a= 4000
b= 2000;
document.write( "Multiplication of two number =",a*b);
Output :-
4] Exponentiation (**)
Example :-
let a= 4 b= 2; document.write( "Exponentiation of two number =",a**b);
Output :-
let a= 4
b= 2;
document.write( "Exponentiation of two number =",a**b);
5] Division (/)
Example :-
let a= 4 b= 2; document.write( "Division of two number =",a/b);
Output :-
let a= 4
b= 2;
document.write( "Division of two number =",a/b);
6] Modulus (%)
Example :-
let a= 4 b= 2; document.write( "Modulus of two number =",a%b);
Output :-
let a= 4
b= 2;
document.write( "Modulus of two number =",a%b);
7] Increment (++)
Example :-
let a= 4 document.write( "Increment of two number =",++a);
let a= 4
document.write( "Increment of two number =",++a);
Output :-
8] Decrement (--)
Example :-
let a= 4 document.write( "Decrement of two number =",--a);
let a= 4
document.write( "Decrement of two number =",--a);








Post a Comment