Write a program that asks the user to enter 3 numbers then displays the following menu:
a- Display the maximum
b- Display the minimum
c- Display the numbers sorted in decreasing order
d- Display odd numbers
e- Display even numbers
f- Write the numbers in a file.
The program then asks the user to enter his choice and executes the required task.
If the user enters option ‘f’ ,the program will have to ask the user to enter the name of the file.
Important :
1- Use a switch to handle the different options of the menu.
2- All numbers need to be displayed with 2 decimals precision.
cout<<"a- Display the maximum "<<endl; cout<<"b- Display the minimum "<<endl; cout<<"c- Display the numbers sorted in decreasing order "<<endl; cout<<"d- Display odd numbers "<<endl; cout<<"e- Display even numbers "<<endl; cout<<"f- Write the numbers in a file. \n"; char choise; cin>>choise;
Comments
Leave a comment