Advertisement
Guest User

a2

a guest
Nov 22nd, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #include <string.h>
  4.  
  5. int main() // main function
  6. {
  7. const int measurement = 100;
  8. char num[50];
  9. char option;
  10.  
  11.  
  12. getchar(num, measurement);
  13. displaychar(num, measurement);
  14.  
  15.  
  16. do
  17. {
  18.  
  19. printf(" Enter another value? Type Y to enter or type N to exit/n : " );
  20. scanf( "%c%*c", &option);
  21. option=tolower(option);
  22.  
  23. switch (option)
  24. {
  25. case 'y' : getchar(num,measurement);
  26. displaychar(num, measurement);
  27. break;
  28.  
  29. case 'n': printf(" Good Bye have a nice day \n");
  30. break;
  31.  
  32. default: printf(" invalid selection \n");
  33. }
  34.  
  35. } while(option!='n');
  36. getchar();
  37.  
  38. return(0);
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement