Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int myInt = 6;
- int otherInt = 12;
- int userInt;
- //'go1:' sets the point where to jump to
- go1: printf ( "Please put in the number '6' or the number '12': " );
- scanf ( "%d",&userInt );getchar();
- if ( userInt == myInt )
- {
- printf("You entered: 6!\n");
- }
- else if (userInt == otherInt)
- {
- printf ( "You entered 12!\n" );
- }
- else
- {
- printf( "Can't you read? Try again!" );
- getchar();
- // This is where I want it to go back to the VERY first 'printf'. Thanks for your help
- // Please :P
- // 'goto go1' = jump to where 'go1:' is
- goto go1;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment