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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!