in this examples we used c++ goto statement in replacement  of c++    for loop 
Algorithm :
the user enter the number of numbers he want to add  then and if he enterted a positive number he uses c++goto statement to go the next interation , and skip what is in red when he reach the number of numbers he uses goto to go to jojo  label  to pring the sum at end of the program


 

 

 

 

 

 

 

 


#include <iostream>
using namespace std ;

int main (){
int n , sum ;
int c[222] ;
sum = 0 ;
// This program let you calculate sum of only positive numbers

cout<<" Enter the number of positive numbers you want to add\n" ;
cin>> n ;

int i = 0 ;

int g = -1 ;
lolo :
++g ;
i = g ;
if(i == n )
goto dodo ; // escape the lope and goto dodo to print the sum

cout<<" Enter number "<< i+1 <<" you want to add \n";

cin>>c[i];
sum +=c[i] ;// Addition

if(c[i]>0)
goto jojo ;  // got to the next iteration similar of for statement and skip what is in red
cout<<" \nYou entered anegative number \n";
sum-= c[i] ;// cancel the addiction

--i; // decremetnt the counter to cancel the increment
--g ;

goto jojo ;  // next iteration

dodo :
cout <<"The sum of the positive numbers is "<<sum <<endl <<endl<<endl;
return 0 ;

}
i hope that this explained what meaning of goto