Explain the meaning and output of each line of the following in the context of programming: (i) int i; int x, | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Explain the meaning and output of each line of the following in the context of programming: (i) int i; int x,

(i)int i; int x, y, z=31; (ii) x = y / 2; (iii) z=x*2; (iv) if (z==y) (v) printf("y contains an EVEN number"); (vi) else printf("y contains an ODD number");

13th Mar 2021, 3:34 PM
Kalicharan
Kalicharan - avatar
2 Answers
+ 2
i) declare variables and initialize it with value ii) make a division and assign the result to variable x iii) double this variable x and assign to z iv - vi) forms a conditional sentence if-else if (condition) //instructions executed when condition evaluates to true.... else //instructions executed when condition evaluates to false.... iv) So after do previous operations if z is equals to y, v) print this message in console vi) if not... print this another If this solve your question remember mark this answer as valid
13th Mar 2021, 4:33 PM
David Ordás
David Ordás - avatar
0
Thank you
14th Mar 2021, 6:10 AM
Kalicharan
Kalicharan - avatar