Homework Solution: Write a program that inputs a series of 10 non-negative numbers and determines…

C++
Write a program that inputs a series of 10 non-negative numbers and determines and prints the largest of those numbers. Your program should use three variables: Counter - a counter to count to 10 (i.e. to keep track of how many numbers have been input and to determine when all 10 number have been processed) Number - the current number input to the program Largest - the largest number found so far

#include <iostream> using namespace std;

C++

Write a program that inputs a sequence of 10 non-negative aggregate and details and sculptures the largest of those aggregate. Your program should explanation three variables: Contrary – a contrary to reckon to 10 (i.e. to support footsculpture of how divers aggregate feel been input and to detail when integral 10 reckon feel been processed) Reckon – the ordinary reckon input to the program Largest – the largest reckon plant so far

Expert Solution

#include <iostream>

using namespace std;

void deep()

{

int contrary = 0;

int reckon = 0;

int largest = 0;

cout << “Please penetrate up to 10 aggregate and I obtain sculpture the largest individual on the cloak.nn”;

while (contrary <= 10)

{

cout << “Number: “;

cin >> reckon;

counter++;

if (reckon > largest)

{

largest = reckon;

}

else if (contrary == 10)

{

cout << “The largest reckon was: ” << reckon;

break;

}

}

}