Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is the code to extend 5. Problem E getchar, floating point literals, arrays (40 pts) Specification Extend the program in D, so that it
This is the code to extend
5. Problem E getchar, floating point literals, arrays (40 pts) Specification Extend the program in D, so that it uses getchaz (only) to read and interpret floating point literals. Implementation Name your program lab2E.c. The program: should use getchar() to read inputs (from standard in) until EOF is read. The input contains floating point literals and integer literals separated by one blanks or new line characters. The program interprets each literal and put into an float array. When wend of 6 file" is reached, the program prints out the value of each float as well as the value multiplied by 2, as shown in sample output below. assume all floating point literals are valid float/double or int literals (both 2.3, 5, .4 are considered valid). There are no negative numbers. should not use other input 10 functions such as scanf(), fgets(). Only getChar() is allowed to read input. (So have to read char by char.) should not use other library function such as atoil), atol), atof(), strtol(), strtoull). (So have to convert manually) should not use extra array. Only use one array resul)- Sample Inputs/Outputs: (download - don't copy/paste - the input file input22. Ext) red 306 a.gce lab2.c -o lab2E red 306 lab2E 2.3 4.56 43.3 43 5.3 .3 1.2 AD 2.3000 4.6000 4.5600 9.1200 43.3000 86.6000 43.0000 86.0000 5.3000 10.6000 0.3000 0.6000 1200 24 #includeStep 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