+ 1
What is if statement when we use it and where we use
2 Answers
+ 1
If statement are used to check conditions
Its syntax is
If(condition){code to execute}
It will only execute the code in curly braces if the condition is true
Example
if(2 == 2){
//Will execute the code which is written here
}