|
| 1 | + var num1 = 50; |
| 2 | + var num2 = 100; |
| 3 | + |
| 4 | + var addition = num1 + num2 //Output : 150 |
| 5 | +// alert(addition) |
| 6 | +console.log(addition); //Show result output in console |
| 7 | + |
| 8 | + var substraction = num1 - num2 |
| 9 | + console.log(substraction); //Output : -50 |
| 10 | + |
| 11 | + var multiplication = num1 * num2 |
| 12 | + console.log(multiplication); // Output : 5000 |
| 13 | + |
| 14 | + var division = num1 / num2 |
| 15 | + console.log(division); // Output : 0.5 |
| 16 | + |
| 17 | + var modulous = num1 % num2 //Check Even Or Odd |
| 18 | + console.log(modulous); //Output = 50 |
| 19 | + |
| 20 | +//BODMAS Rule |
| 21 | + |
| 22 | +var bodmas = multiplication / substraction + addition; |
| 23 | +console.log(bodmas); //Output : 50 |
| 24 | + |
| 25 | +//Unfimilar Operator |
| 26 | + |
| 27 | +//Pre Increament |
| 28 | +// ++num , --num Value First Assign Then Update |
| 29 | + |
| 30 | +//Post Increament |
| 31 | +// num++ , num-- Value First Update Then Assign |
| 32 | + |
| 33 | +var number = 50 ; |
| 34 | +var numberAfter = number++ |
| 35 | +// var numberAfter = number-- |
| 36 | + |
| 37 | +console.log(number); // Output : 51 |
| 38 | +console.log(numberAfter); // Output : 50 |
| 39 | + |
| 40 | +var number1 = 10 ; |
| 41 | +var numberAfter1 = ++number1 ; |
| 42 | +//var numberAfter1 = --number1 ; |
| 43 | + |
| 44 | +console.log(numb); |
| 45 | + |
| 46 | + |
0 commit comments