Question: ONLY ANSWER NUMBER 9 AND EVERYTHING MUST BE DONE IN C CODE (not C++ or C#) (Also the input file from question 8 has 9

ONLY ANSWER NUMBER 9 AND EVERYTHING MUST BE DONE IN C CODE (not C++ or C#)

(Also the input file from question 8 has 9 and 12 as the two integers)

6. Now write a C program called xxprog1 which takes 2 integer command line parameters, prints them, adds them, and prints the sum as shown below. Replace xx with your initials.

Example:

>kbprog1 5 7

First parameter is 5

Second parameter is 7

Sum is 12

7. Write a program called xxprog2 which does the same thing but prompts the user to enter the parameters instead.

Example

>kbprog2

Please enter first parameter: 5

Please enter second parameter: 7

First parameter is 5

Second parameter is 7

Sum is 12

8.

Save the file called inputfile posted here to your local computer and then transfer it to your Linux machine (using WINSCP or other file transfer tool.) Write a program called xxprog3 which does the same thing again except it opens the file called inputfile and reads the 2 parameters from it.

Example:

>kbprog3

Reading first parameter 9

Reading second parameter 11

Sum is 20

9. Write a makefile to automate the compilation of xxprog3. Delete xxprog3 (not xxprog3.c!) and then run make. Ensure that xxprog3 has been recreated.

Example:

rm kbprog3

cat kbprog3.c

cat inputfile

make

kbprog3

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!