Explain the meaning and output of each line of the following in the context of programming:
(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");
Answers
Answered by
3
Answer:
y contains an odd number
EXPLANATION
integer x,y,Z =31 so
- x= 31/2 ( here we use '/' not modulus so neglect remainder )
- X=15
- Z=15*2
- z=30
- if (z is equal to y) ( but not )
- so else will be printed as output.
Similar questions