Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.75 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3.  
  4. int menu();
  5.  
  6. int main()
  7. {
  8.     menu();
  9.     return 0;
  10. }
  11.  
  12. int menu()
  13. {
  14.     char option;
  15.     int flag = 1;
  16.    
  17.     printf("*****OPTION*****MENU*****\n");
  18.     printf("L: Load image\n");
  19.     printf("R: Remove image\n");
  20.     printf("P: Print image\n");
  21.     printf("A: Average image\n");
  22.     printf("H: Horizontal derivative\n");
  23.     printf("V: Vertical derivative\n");
  24.     printf("T: compute hisTogram\n");
  25.     printf("D: search Digram\n");
  26.     printf("M: local Maxima\n");
  27.     printf("Q: Quit program\n");
  28.     printf("*************************\n");
  29.     printf("Select an option: ");
  30.     scanf("%c", &option);
  31.    
  32.     if(option == 'q' || option == 'Q')
  33.     {
  34.         printf("Program Terminated\n");
  35.         flag = 0;
  36.     }
  37.    
  38.     if(flag == 1)
  39.     {
  40.         menu();
  41.     }
  42.     else
  43.     {
  44.         return 0;
  45.     }
  46.    
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement