0

are there "if" "then" lines and if so then what are they

"if" "then" statements

10th Aug 2016, 3:01 PM
Super Root#
Super Root# - avatar
3 odpowiedzi
+ 1
there is, but the {} is used for the word "then"
11th Aug 2016, 10:27 AM
ed taylor
ed taylor - avatar
+ 1
There are not if then lines but there are if else lines. After the first part of an if statement you can put an else statement which runs if the if statement is false. There are also else if statements which will run if the their statement is true but the if statement isn't. For example: if (a==b) { cout << "A and B are equal"; } else if (a < b) { cout << "A is less than B"; } else { cout << "B is less than A"; }
13th Aug 2016, 6:05 PM
Zachary Akzin
Zachary Akzin - avatar
0
I'm am confused what you mean. If a condition is true, then run a certain bit of code? If so, it's literally just an if statement: int a = 5; if (a == 5) std::cout << "a is 5"; else std::cout << "a is not 5";
10th Aug 2016, 3:08 PM
Cohen Creber
Cohen Creber - avatar