I started doing the tutorial about noon today. After 6 hours of reading, rereading, and trial and error with Dec-C++, I finally managed to write something that works.
Code:
#include <stdio.h>
int main()
{
int input;
printf( "Choose a door, or keep your prize!\n" );
printf( "1. Door1\n" );
printf( "2. Door2\n" );
printf( "3. Door3\n" );
printf( "4. Keep your prize of $100\n" );
printf( "Selection: " );
scanf( "%d", &input );
switch ( input ) {
case 1: /* Note the colon, not a semicolon */
printf( "You Win $20!\n" );
getchar();
break;
case 2:
printf( "You Win $0!\n" );
getchar();
break;
case 3:
printf( "You Win $300!\n" );
getchar();
break;
case 4:
printf( "You keep your $100!\n" );
getchar();
break;
default:
printf( "Wrong Key! Exiting Now!\n" );
getchar();
break;
}
printf( "Thanks for playing!\nGoodbye!\n" );
getchar();
}
It's horribly basic, I know... I'm just currently proud of myself for writing it and it not borking my computer.