Write a program that asks the user to enter three real numbers. if all three numbers are positives, print the sum else if one number is negative print the product of the two positive numbers. you will then ask the user to enter two real numbers. if both numbers are negative print the quotient, otherwise terminate the program. use fixed mode and format the output, in other words, specify the width and the number of digits meaningful variable names and informative prompts
#include <iostream>
#include <iomanip>
usingnamespace std;
int main()
{
int x, y;
cout << "Enter 2 intergers";
cin >> x >> y;
//simple ifs
if (x > 0) cout << "The firs number is positive";
if (x > 0 && y > 0) cout << "Both are positive";
if (x > 0 || y > 0) cout << "At least one number is positive";
//if-else
if (x > 0)cout << "The firs number is positive";
else cout << "The first number is not positive";
if (x > 0 || y > 0) cout << "at least one number is positive";
else cout << "Both number are negative";
//nested ifs
if (x > 0) if (y > 0) cout << "Both are positive";
else cout << "First number is positive, Second not positive";
else cout << "First not positive, Second don't know";
float a, b;
cout << "Enter 2 real numbers";
cin >> a >> b;
cout << fixed << setprecision(2);
if (a > 0 && b > 0) cout << "sum" << setw(12) << a + b << endl;
return 0;
}