There is no such thing as a fall through statement in C++. You are probably referring to switch statement fall through. With a switch statement, execution begins at the case label that matches the evaluation of the controlling expression and falls through all subsequent statements and case labels until a break statement is encountered (break, return or goto) or the end of the switch statement is reached. For example:
switch (x) {
case 0:
// When x is 0, execution begins at this point.
// ...
break; // We jump to the end of the switch at this point (exiting the switch statement).
case 1:
// When x is 1, execution begins at this point.
// ...
// There is no break statement, so execution falls through to case 2.
case 2:
// When x is 2, execution begins at this point, unless we fell through from case 1.
// ...
// There is no break statement, so execution falls through to case 3.
case 3:
// When x is 4, execution begins at this point unless we fell through from case 3.
// ... // There is no break statement, so execution falls through to the default case.
default:
// Execution begins at this point for all values x other than 0, 1, 2, 3 and 4 (all other cases)
// unless we fell through from case 3.
// Note that the default case needn't be the last case in a switch.
// ...
// Again, no break statement so we fall through to case 4.
case 4:
// When x is 4, execution begins at this point unless we fell through from the default case.
// ...
// No break is required in the final case...
} // ...we simply fall off the end of the statement, just as we would with all compound statements.
In the above example, case 0 behaves in the usual way, while all others fall through to the end. The value of x simply determines at which point in the switch execution starts from. The value 1 executes every statement other than those defined by case 0, while the value 2 executes every statement other than those specific to case 0 and 1.
Note that if every case has a break statement to prevent fall through then the order of the cases is immaterial. However, when using fall through, the order of the case labels is vital. Break statements may be placed anywhere in the switch, but are not required at the end of the final case.
The goto statement.
If statement is single selection statement,whereas the switch statement is multiple selective.
The basic control structure in C++ is the if statement.
...a function call.
if (condition) statement else statement;
The switch / case statement.
The semi-colon converts a C++ expression into a statement.
I believe, you can use C-function - printf().
You can not print your name in C without a semi colon because according to the rules of C every statement should end with a semi colon.In fact without the semi colon it fails to be a valid C statement.
No. That would be a syntax error. Only a right semicolon (;) can go at the end of a statement.
It is an equation in two variables, c and g.
Statements that check an expression then may or may not execute a statement or group of statements depending on the result of the condition.