JavaScript - Arithmetic Operators

Published: 28 February 2020
on channel: EdYoda
206
0

For more courses, visit: https://www.edyoda.com/

Hey guys, in this video we will learn about Arithmetic Operators in JavaScript.

Practice Problems:
================
Try to answer the following questions without executing the code in codepen. Post your answers in the comment section below. Also, explain why do you think your answer is correct. Best of Luck!!

Q.
What will be printed in the console?
var num1 = 1 + 5;
var num2 = num1 / 4;
var num3 = 1 + 5;
var num4 = num3 / 4;
console.log(num2 + " " + num4);

Q.
What will be printed in the console?
var a = 1;
var b = 2;
var c;
var d;
c = ++b;
d = a++;
c++;
b++;
++a;
console.log(a + " " + b + " " + c);

Q.
What will be printed in the console?
var input = 7;
var output1 = ++input + ++input + ++input;
var output2 = input++ + input++ + input++;
var output3 = input++ + ++input + input++;
console.log(output1 + ' ' + output2 + ' ' + output3);


Codepen URL: https://codepen.io/qaifikhan/pen/RzwLWd

Previous Video: https://www.edyoda.com/course/1496?ep...

My Twitter Handle: @qaifikhan


On this page of the site you can watch the video online JavaScript - Arithmetic Operators with a duration of hours minute second in good quality, which was uploaded by the user EdYoda 28 February 2020, share the link with friends and acquaintances, this video has already been watched 206 times on youtube and it was liked by 0 viewers. Enjoy your viewing!