scanf_s("%d", &choice); if (choice == 1) { choice = 0; goto label2; } else if (choice == 2) { choice = 0; goto label3; } else { choice = 0; printf("\aError please enter 1 or 2\n"); goto label4; } } } else { printf("\aWrong password\n"); printf("If you want to try again Press 1 , if you want to end the process Press 2\n"); scanf_s("%d", &choice); if (choice == 1) { choice = 0; goto label2; } else if (choice == 2) { choice = 0; goto label3; } else { choice = 0; printf("\aError please enter 1 or 2\n"); goto label4; } } } } else { printf("\aError, Enter 1 or 2:\n"); goto label; } label3: printf("\n\nThank you"); } else { printf("\aError, Enter 1 or 2:\n"); goto label0; } return 0; } Flowchart for that part
scanf_s("%d", &choice);
if (choice == 1)
{
choice = 0;
goto label2;
}
else if (choice == 2)
{
choice = 0;
goto label3;
}
else
{
choice = 0;
printf("\aError please enter 1 or 2\n");
goto label4;
}
}
}
else
{
printf("\aWrong password\n");
printf("If you want to try again Press 1 , if you want to end the process Press 2\n");
scanf_s("%d", &choice);
if (choice == 1)
{
choice = 0;
goto label2;
}
else if (choice == 2)
{
choice = 0;
goto label3;
}
else
{
choice = 0;
printf("\aError please enter 1 or 2\n");
goto label4;
}
}
}
}
else {
printf("\aError, Enter 1 or 2:\n");
goto label;
}
label3:
printf("\n\nThank you");
}
else {
printf("\aError, Enter 1 or 2:\n");
goto label0;
}
return 0;
}
Flowchart for that part
Step by step
Solved in 2 steps with 1 images