MUstar

IoT C언어 0424 - 실습4

Apr 24th, 2017
149
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int disp_menu(void);
  4. int main(void)
  5. {
  6.     int sel;
  7.  
  8.     sel = disp_menu();
  9.     printf("선택된 메뉴는 %d번 입니다.\n", sel);
  10.  
  11.     return 0;
  12. }
  13.  
  14. int disp_menu(void)
  15. {
  16.     int num;
  17.     printf("1. 볶음짱봉\n2. 콩나물국밥\n3. 바지락칼국수\n\n\n");
  18.     printf("# 메뉴를 선택하세요. : ");
  19.     scanf("%d", &num);
  20.     return num;
  21. }
RAW Paste Data