Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- double returnBiggest();
- int main() {
- double biggest = returnBiggest();
- cout << "The biggest one is:" << biggest << endl;
- return 0;
- }
- double returnBiggest() {
- double aBiggest;
- double cValue;
- cout << "Please, insert first value: ";
- if (!(cin >> aBiggest)) {
- cout << "At least one value is needed" << endl;
- exit(1);
- }
- cout << endl;
- cout << "Please, insert value (insert any other character for finish program): ";
- while (cin >> cValue) {
- if (cValue > aBiggest)
- aBiggest = cValue;
- cout << endl;
- cout << "Please, insert value (insert any other character for finish program): ";
- }
- return aBiggest;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement