Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I know for sure I did something wrong. I a m sorry to bother. 3.23 (Find the Largest Number) The process of finding the largest

image text in transcribed

image text in transcribed

I know for sure I did something wrong. I am sorry to bother.

3.23 (Find the Largest Number) The process of finding the largest number (i.e., the maximum of a group of numbers) is used frequently in computer applications. For example, a program that determines the winner of a sales contest would input the number of units sold by each salesperson. The salesperson who sells the most units wins the contest. Write a pseudocode program and then a program that inputs a series of 10 non-negative numbers and determines and prints the largest of the numbers. [Hint: Your program should use three variables as shown below.] 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 numbers have been processed) number: The current number input to the program largest: The largest number found so far Note that the names of the variables you use don't have the match the above of course. SAMPLE RUN #4: /largest_number Show Highlighted Only Interactive Session Hide Invisibles Highlight: None Enter a non-negative integer number: 1230. Enter a non-negative integer number:492509. Enter a non-negative integer number:2435. Enter.a. non-negative integer number: 3249084. Enter.a. non-negative integer number: 183109065. Enter a non-negative integer number: 3432094. Enter a non-negative integer number: 49084024. Enter a non-negative integer number: 193240702. Enter a non-negative integer number:312079048. Enter a non-negative integer . number: 277022157. The largest number .entered was: 312079048. SUBMIT x 2 of 2: 2020-02-08 18:10:57 - W 1 #include 2 int main() { 3 int counter = 0, number = 0, largest = 0; 4 while ( counter = largest ) { largest = number; 8 9 counter++; 11 12 printf("The largest number is %d ", largest ); 13 return 0; 74 }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions

Question

5. Recognize your ability to repair and let go of painful conflict

Answered: 1 week ago