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
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
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 22PE
Related questions
Question

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images

Recommended textbooks for you

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage

EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT

Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,

Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning