The use of else is a continuation of the idea of the conditional if statement. The if statement tells the compiler to do a certain thing only if it is in the conditions given. But the else statement used with a condition is telling the compiler that if the conditions of the if statement are not met then do this
else
cout << “Insert Text Here”;
or whatever you want the functionto do. The else statement is another very helpful tool when trying to use conditions in a program.
Use of else With a Conditional by Asa Puls is licensed under a Creative Commons Attribution 4.0 International License.