If Statements in C++
If Statements in C++
"using namespace std”, This line tells the compiler to use a group of functions that are part of the
standard library (std).
The next important line is int main(). This line tells the compiler that there is a function named main, and
that the function returns an integer, hence int.
If statements in C++
The ability to control the flow of your program, letting it make decisions on what code to execute, is
valuable to the programmer. The if statement allows you to control if a program enters a section of code
or not based on whether a given condition is true or false.
If (a=10)
if ( TRUE ) {
// Execute these statements if TRUE
}
else {
// Execute these statements if FALSE
}