In imperative programming, a "go to" statement is an unconditional jump instruction that changes the flow of control to the point of the program referenced by the "go to" statement.
Questions tagged [goto]
1057 questions
-7
votes
2 answers
Some kind of 'goto' function for C++
#include
using namespace std;
int main()
{
float a, b, result;
char operation, response;
cin >> a >> operation >> b;
switch(operation)
{
case '+':
result = a + b;
break;
case '-':
result =…

SoLux
- 162
- 1
- 9
-7
votes
2 answers
When I use the goto module,it works but I got an error: Exception TypeError
The goto module I install is form:the module I installed
Here is the error:
Exception TypeError: "argument of type 'NoneType' is not iterable" in
ignored
Here is the code:
from goto import goto,label
for i in range(1,10) :
print i
if i…

hellowanger
- 29
- 5
-7
votes
2 answers
(C++) Goto statement not working. Beginner
I'm making a USD to MXN converter and I want to have it work both ways. The if statement works (tryed cout << "test"; and it worked) but it wont work when I replace it with the goto statement.
#include "stdafx.h"
#include
…

user3547330
- 1
- 1
- 4
-8
votes
2 answers
Replacing the goto Statement
I have a very limited experience with C++ and i wanted to replace the "goto" construct from my code. Any suggestion for refactoring too
int main()
{
int count;
int countSub = 0;
int userCount = 0;
int roleCount = 0;
int…

ephti2000
- 17
- 1
- 9
-8
votes
3 answers
using goto keyword in C
# include
int main()
{
int a=5;
begin:
if(a)
printf("%d\n",a);
a--;
goto begin;
return 0;
}
When a becomes 0 then if condition will not execute then why the output is going to be infinty in this code means
output…

Aman Singh
- 743
- 1
- 10
- 20
-9
votes
1 answer
How do I properly specify a label for the goto statement?
I used the goto statement in my program. However when I was trying to compile the program an error message showed: expected primary-expression before ‘:’ token.
#include
using namespace std;
int main(void)
{
int num1, ans;
cout…

haward79
- 31
- 1
- 2
-11
votes
1 answer
How to go to initial stage of Program without using "goto" and using "do while" loop?
goto is useful FOR BEGINNERS but not recommended !!!!
I am editing my post as I got the right answer on this website.
In this program where user enters subject marks, (after entering marks)he/she is asked whether he/she wants to enter more marks of…