Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ============================================================================
- Name : main.c
- Author : Michael Park
- Version : 1.0
- Copyright : Copyright Notice Here (2013)
- Description : Multiple C programming exercises in a single project
- ============================================================================
- */
- #include <stdio.h>
- void hello()
- {
- puts("Hello, World!");
- }
- void ex1()
- {
- puts("Run exercise 1");
- }
- void ex2()
- {
- puts("Run exercise 2");
- }
- void ex3()
- {
- puts("Run exercise 3");
- }
- void ex4()
- {
- puts("Run exercise 4");
- }
- void ex5()
- {
- puts("Run exercise 5");
- }
- void ex6()
- {
- puts("Run exercise 6");
- }
- void ex7()
- {
- puts("Run exercise 7");
- }
- void ex8()
- {
- puts("Run exercise 8");
- }
- int main()
- {
- int choice;
- puts( "Choose an exercise between 0 and 8 (0 is Hello, World!):" );
- scanf( "%d", &choice );
- switch ( choice ) {
- case 0:
- hello();
- break;
- case 1:
- ex1();
- break;
- case 2:
- ex2();
- break;
- case 3:
- ex3();
- break;
- case 4:
- ex4();
- break;
- case 5:
- ex5();
- break;
- case 6:
- ex6();
- break;
- case 7:
- ex7();
- break;
- case 8:
- ex8();
- break;
- default:
- puts( "Please enter a number between 0 and 8!" );
- break;
- }
- getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement