Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example program
- #include <iostream>
- #include <string>
- using namespace::std;
- int main()
- {
- int option;
- cout << "Select option:" << endl;
- cout << "--1--Enter real numbers F(K) (K <= 25)"<< endl;
- cout << "--2--Calculate average of array numbers"<< endl;
- cout << "--3--Calculate sum of zeroes and non-zeroes"<< endl;
- cin >> option;
- while(true){
- switch(option){
- case 1:
- int n;
- double currNum;
- double arr[n];
- cout << "---- Enter size of the array: ";
- cin >> n;
- cout << "---- Fill the array: " << endl;
- for(int i = 0; i < n; i++)
- {
- double currNum;
- cin>>currNum;
- while(currNum>25)
- {
- cout<<"The number must be > 25" << endl;
- cin>>currNum;
- }
- arr[i] = currNum;
- }
- break;
- case 2:
- double min, max;
- cout<< "Enter min"<<endl;
- cin >> min;
- cout<< "Enter max"<<endl;
- cin >> max;
- for(int i = 0; i < n; i++)
- {
- }
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment