0

Whats the point of if statements

16th Nov 2016, 1:21 AM
Sunako Nacahara
Sunako Nacahara - avatar
1 Resposta
+ 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
16th Nov 2016, 2:03 AM
Cohen Creber
Cohen Creber - avatar