0
How to use "if"
2 Respostas
+ 3
You use "if" to check a condition, if this condition is true, the code inside the wavy brackets will be triggered, if it is false it just skips it. You can also use "else" to execute another block of code if the condition is false.
Example:
if (6>10) {
cout << "True";
}else{
cout << "False";
}
Outputs: False
+ 2
if(condition)
{
DoSomething();
}