0
Whats the point of if statements
1 Réponse
+ 2
An if statement is used to decide whether an expression evaluates to true or not, and if it does, then the corresponding block of code will run.
int a = 10;
if (a == 10)
{
cout << "a is 10";
}
Logical operators can be used in the parentheses, these include:
== equal to
!= not equal to
> greater than
< less than
>= greater than or equal to
<= less than or equal to
|| or
&& and