C++ goto Statement
C++ goto Statement In C++ programming, goto statement is used for altering the normal sequence of program execution by transferring control to some other part of the program. Syntax of goto Statement goto label; ... .. ... ... .. ... ... .. ... label: statement; ... .. ... In the syntax above, label is an identifier. When goto label; is encountered, the control of program jumps to label: and executes the code below it. Example: goto Statement // This program calculates the average of numbers entered by user. // If user enters negative number, it ignores the number and // calculates the average of number entered before it. # include <iostream> using namespace std ; int main () { float num , average , sum = 0.0 ; int i , n ; cout << "Maximum number of inputs: " ; cin >> n ; for ( i = 1 ; i <= n ; ++ i ) { cout << "Enter n" << i << ...