Write the missing statements in the following program so that it prompts the user to input two numbers. If one of the numbers is 0 or negative, the program outputs both numbers must be positive. If both the numbers are equal, it outputs the sum of the numbers; if the first number is less than or equal to 2 and both the numbers are not equal, it outputs second number to the power of the first number; otherwise it outputs the product of the numbers. #include <iostream>//Include additional header files, if necessaryusing namespace std;int main(){double firstNum, secondNum;cout << "Enter two nonzero numbers: ";cin >> firstNum >> secondNum;cout << endl;//Missing statementsreturn 0;}
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Write the missing statements in the following
#include <iostream>
//Include additional header files, if necessary
using namespace std;
int main()
{
double firstNum, secondNum;
cout << "Enter two nonzero numbers: ";
cin >> firstNum >> secondNum;
cout << endl;
//Missing statements
return 0;
}
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images