Question: In C Programming Language .Write a program to read any number of floating point values from standard input, separated by newlines . The input may
In C Programming Language
.Write a program to read any number of floating point values from standard input, separated by newlines . The input may also contain any number of blank lines, ie. lines that contain any amount of whitespace followed by a newline With the exception of blank lines, the input is guaranteed to be well-formed and contain at least one valid floating point value . For each value input, output (as before) 1. the largest integer smaller than this value 2. the nearest integer to this value, with halfway values rounded away from zero 3. the smallest integer larger than this value . For each input value, the output integers should be separated by a space character and followed by a newline character . The output values should not have any trailing zeros: e.g., "2" not "2.0 . If no floating point value can be parsed (ie. a blank line was read) there should be no output. To put it another way: blank lines should be ignored . The program should accept input values on stdin until EOF is reached When EOF is reached, print "Done In" on line by itself, then exit the program . Sample input: 3.1415 7.11 - 15.7 . Corresponding output 3 3 4 7 7 8 -1616-15 Done Important Note: your input and output are interleaved in the terminal window, so the appearance of a run of a correct program with the input above is 3.1415 3 34 7.11 7 7 8 -15.7 -16 -16 -15 But it's important to realize that this consists of alterating line of input and output, each three lines long
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
