I cant understand if | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

I cant understand if

25th Feb 2017, 8:32 AM
dhivya
dhivya - avatar
4 Answers
0
If you are dead you will respawn in the game.That it's!
25th Feb 2017, 8:39 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 7
how can you not understand "if"? if x equals 5 or y is less than 7 do some stuff, else do other stuff. where's the difference to sentences like: if your shirt is black you're cool, else if your shirt is blue you should have a pizza, else take a nap.
25th Feb 2017, 8:57 AM
Mario L.
Mario L. - avatar
+ 4
"If statements" checks Two Conditions 1) True . 2) False. if your condition is true then your statements inside if satement will execute otherwise your else statement will execute. Ex. int a=1; If (a==1) { cout<< "Hello"; } else { cout<<"Bye"; } Look at the above example, in the first statement a is assigned with a value 1 ,then we are checking the condition inside the brackets of if statement that is " Is a is really 1?". since a is 1 ,so the statement inside if statement is executed that is Hello is given as output.If the if statement condition is wrong then you would get Bye as output. Hope this info helps!!! Keep coding!!
25th Feb 2017, 8:41 AM
G Hemanth
G Hemanth - avatar
+ 2
I know now who dislike at me,LoL
25th Feb 2017, 8:42 AM
Yanothai Chaitawat
Yanothai Chaitawat - avatar