4.16 LAB: Varied amount of input data Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input and outputs the max and average. A negative integer ends the input and is not included in the statistics. Ex: When the input is: 15 20 0 5 -1 the output is: 20 10 You can assume that at least one non-negative integer is input. 324758.2040686.qx3zqy7 LAB 4.16.1: LAB: Varied amount of input data 0/ 10 АCTIVITY main.c Load default template... 1 #include 3 int main(void) { 4. /* Type your code here. */ 6 return 0; 8

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter2: Basic Elements Of C++
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question
4.16 LAB: Varied amount of input data
Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input,
and outputs the max and average. A negative integer ends the input and is not included in the statistics.
Ex: When the input is:
15 20 0 5 -1
the output is:
20 10
You can assume that at least one non-negative integer is input.
324758.2040686.qx3zqy7
LAB
4.16.1: LAB: Varied amount of input data
0/ 10
ACTIVITY
main.c
Load default template...
1 #include <stdio.h>
3 int main(void) {
4
/* Type your code here. */
7
return 0;
8.
Transcribed Image Text:4.16 LAB: Varied amount of input data Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the max and average. A negative integer ends the input and is not included in the statistics. Ex: When the input is: 15 20 0 5 -1 the output is: 20 10 You can assume that at least one non-negative integer is input. 324758.2040686.qx3zqy7 LAB 4.16.1: LAB: Varied amount of input data 0/ 10 ACTIVITY main.c Load default template... 1 #include <stdio.h> 3 int main(void) { 4 /* Type your code here. */ 7 return 0; 8.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning