Show the result of evaluating each of the following expressions. (a) (4 * 3) ==
ID: 3851991 • Letter: S
Question
Show the result of evaluating each of the following expressions. (a) (4 * 3) == (3 * 4) (b) 4 * (3 == 3) * 4 (e) (('h' + 'i') && '') (f) (13 = 13) || (13 = 13) || (7 = 7) (g) (13 = 13) && (13 = 13) && (7 = 7) For each of the following, determine how many times the function event() will be called, and the final value of the loop variable i. a) for (i = 4: i > = 0: --i) { event(): } # of times: ___________ final value of i: __________ b) i = 0: while (--i) { event (): --i: } # of times: _______ final value of i: ________ c) for (i = 0: iExplanation / Answer
2.a) here i = 4 the loop executes until i values becomes 0 so the loop iterates 5 times abd the value of i is 0
b) here
Initially i value is 0 so after loop iteration until normal console. Limit reached
So loop iterates infinite times and the value of i also infinity
So in my console the last value of i is - 2422
C) in this double loop the loop iterates 6 times and the value of i is 4
1)here the given expression is 4*3==3*4
So 12==12 which is true
B) here 4*(3==3)*4 which is also true because the association also the value Is true
e) first (h+i) value is evaluated and this value can be evaluated with && condition with null operator
F) (13<7||7>=13)
False or false is false
(13<7&&7>=13)
False and false is true
(7<13&&13>=7)
True and false is true
From statements 1 and 2 is false or true will evaluates true
Now from true or true will lead to TRUE
G)
13<7||7>=13)
False or false is false
(13<7&&7>=13)
False and false is true
(7<13&&13>=7)
True and false is true
From statements 1 and 2 is false and true will evaluates true
Now from true and true will lead to FALSE
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.