Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. /*=================================================*/
  5. void sort_asc() {
  6. //code
  7. return;
  8. }
  9. /*=================================================*/
  10. void sort_des() {
  11. //code
  12. return;
  13. }
  14. /*=================================================*/
  15. void data_input() {
  16. //code
  17. return;
  18. }
  19. /*=================================================*/
  20. void data_display() {
  21. //code
  22. return;
  23. }
  24. /*=================================================*/
  25. int prompt_for_choice() {
  26. char choice[10];
  27. printf("\t\t========Menu========\n\r");
  28. printf("\n\r");
  29. printf("Type '1' to display the input data in ascending order.\n\r");
  30. printf("Type '2' to display the input data in descending order.\n\r");
  31. printf("Type '3' to input data.\n\r");
  32. printf("Type '4' to display the saved data.\n\r");
  33. printf("\n\r");
  34. printf("Please make your choice now:\n\r");
  35. printf("\n\r");
  36. fgets(choice, sizeof(choice), stdin);
  37. return strtol(choice, NULL, 10);
  38. }
  39. /*=================================================*/
  40. int main(int argc, char* argv[]) {
  41. int choice;
  42. int data[100][2];
  43.  
  44. choice = prompt_for_choice();
  45.  
  46. if (choice == 1) {
  47. sort_asc();
  48. } else if (choice == 2) {
  49. sort_des();
  50. } else if (choice ==3) {
  51. data_input();
  52. } else if (choice ==4) {
  53. data_display();
  54. } else {
  55. printf("Error, %d is an invalid choice\n\r", choice);
  56. exit(1);
  57. }
  58. exit(0);
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement