Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<iomanip>
- using namespace std;
- int main() {
- double number;
- while (true) {
- cin >> number;
- if (number >= 0) {
- cout << "Result: " << fixed << setprecision(2) << number * 2 << endl;
- }
- else {
- cout << "Negative number!";
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement