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
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