Question
2. Following an example program getRoots.c, write a C program A1p2.c to read from stdin as many lines of input as possible (each line can
2. Following an example program getRoots.c, write a C program A1p2.c to read from stdin as many lines of input as possible (each line can be assumed to contain two integers separated by a space). The user will type Ctrl+D key combination to indicate the end of inputs. The program should print the sum of the two numbers after each line is received. A sample run can look like the following (note that the number of input lines and the integers themselves can be arbitrary so do NOT assume three lines will be input):
Enter two integers: 1 2
The sum of 1 and 2 is 3.
Enter two integers: 5 6
The sum of 5 and 6 is 11.
Enter two integers: 9 -28
The sum of 9 and -28 is -19.
Enter two integers: ^D
Step 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