Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- /*=================================================*/
- void sort_asc() {
- //code
- return;
- }
- /*=================================================*/
- void sort_des() {
- //code
- return;
- }
- /*=================================================*/
- void data_input() {
- //code
- return;
- }
- /*=================================================*/
- void data_display() {
- //code
- return;
- }
- /*=================================================*/
- int prompt_for_choice() {
- char choice[10];
- printf("\t\t========Menu========\n\r");
- printf("\n\r");
- printf("Type '1' to display the input data in ascending order.\n\r");
- printf("Type '2' to display the input data in descending order.\n\r");
- printf("Type '3' to input data.\n\r");
- printf("Type '4' to display the saved data.\n\r");
- printf("\n\r");
- printf("Please make your choice now:\n\r");
- printf("\n\r");
- fgets(choice, sizeof(choice), stdin);
- return strtol(choice, NULL, 10);
- }
- /*=================================================*/
- int main(int argc, char* argv[]) {
- int choice;
- int data[100][2];
- choice = prompt_for_choice();
- if (choice == 1) {
- sort_asc();
- } else if (choice == 2) {
- sort_des();
- } else if (choice ==3) {
- data_input();
- } else if (choice ==4) {
- data_display();
- } else {
- printf("Error, %d is an invalid choice\n\r", choice);
- exit(1);
- }
- exit(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement