Question: so far i have #include using namespace std; int main() { double num; double inputs; double max=0; cout cin >> num; cout cin >> inputs;

 so far i have #include using namespace std; int main() {

so far i have

#include

using namespace std;

int main() {

double num;

double inputs;

double max=0;

cout

cin >> num;

cout

cin >> inputs;

cout

cin >> inputs;

cout

cin >> inputs;

cout

cin >> inputs;

cout

for(double i=1;i

cin>>inputs;

if(inputs>max)

max=inputs;

}

}

but i do not know if im completely right or wrong. need help.

Problem 1: (Maximum) Write a program that reads in n floating-point numbers and prints the largest of them. (Largest means most positive. So 5.1 is larger than -12.44.) The input and output should be exactly: How many numbers do you have? USER ENTERS A POSITIVE INTEGER] Input number (count 1): [USER ENTERS A DECIMAL NUMBER] Input number (count 2): [USER ENTERS A DECIMAL NUMBER] Input number (count X) [USER ENTERS A DECIMAL NUMBER] The maximum value is x For example, if the input is 4 -1.1 2.2 5.5 -99.0 the output should be 5.5 Assume the first input is indeed a positive integer. You may not use any libraries aside from iostream and string. Name your file my_max.cpp. Hint. Use either a for or while loop

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!