Answered step by step
Verified Expert Solution
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.
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 OutputStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started