Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Ques) Write a program in c, which meets the following requirements. Requirements 1. Read integer values from stdin, separated by one or more spaces or

Ques) Write a program in c, which meets the following requirements.

image text in transcribedimage text in transcribed

Requirements 1. Read integer values from stdin, separated by one or more spaces or newlines, until reaching EOF 2. The input is guaranteed to be well-formed. 3. The input contains no more than 80 values. 4. on standard output, render a simple vertical column graph representation of the input values, in order left to right, using hash'#' characters as shown in the examples below. The number of hashes printed in each column should be equal to the corresponding input value 5. The area above a completed column should be filled with space characters 6. Ignore empty lines. Do not output a column for an empty line 7. The entire graph must end with a newline character Guide Hint: you may find it helpful to draw your graphs upside down (increasing down the screen) first, then change your code to flip the output it up the right way Examples 1. Input: 11 3 1 Output The requirements mean that the graph fills a rectangular area with hashes and spaces, so this example is printed as In particular, notice the spaces before the newlines on the first two lines. They are necessary. 2. Input: 3 4 5 Output 3. Input: 0 304 5 Output Notice the empty columns that correspond to the zeros in the input, including the leading zero 4. Input 15 16 15 12 12 12 3 19 21 17 15 12 10 Output 5. Input 2 Output

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

Step: 3

blur-text-image

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 Management System MCQs Multiple Choice Questions And Answers

Authors: Arshad Iqbal

1st Edition

1073328554, 978-1073328550

More Books

Students also viewed these Databases questions

Question

9. Explain the relationship between identity and communication.

Answered: 1 week ago

Question

a. How do you think these stereotypes developed?

Answered: 1 week ago

Question

a. How many different groups were represented?

Answered: 1 week ago