+ 1
Why is this coding giving if condition true?
6 odpowiedzi
+ 3
Yes actually when 25 is divided by 5 the it will live no remainder means it will return null value but you had defined again null value as number and you know that compilers always return 0 or 1 so it will consider null as 0 and because of your 4th line code null (0) become 0 which is an int.
if you want that second condition should print then directly use z there instead of zero because zero contain 0 and z contains null value
+ 4
If zero have any value then it will return true . But if zero will contain null value then it will go for else
+ 4
hay Jyoti Rani Who said 0 is a null value . Infact 0 is a value itself . If you want to give it null just use "" double quote without any string or space in it because spaces may also considered as values
+ 1
https://code.sololearn.com/W66Lg72ROtMK/?ref=app
But why this is giving false
0
It is not clear yet. I am not under standing if zero var have value 0 then condition gives true but when x var have value 0 condition gives false why?
0
Okkk now i got it thankew😋