Question
create a Makefile to compile all the programs in the folder Sampleio. Add a target at the top of the Makefile to compile all the
create a Makefile to compile all the programs in the folder Sampleio.
Add a target at the top of the Makefile to compile all the programs when you type make, The target would be named all.
Run make to compile all the programs.
Run at least 4 of the programs.
Paste a copy of the code you ran showing the programs running into a Word or pdf document
Look at the Unix cheat sheet
Note how to use the man pages to get the options available. Options have a minus sign in front of them. Redirection is used to change the location for the input or output from a command. The following redirections commands >, >>
Try out these commands
man
ls (try a few different options)
cd
mv
rm
touch
cat (with and without redirection to a file ie: "cat filename > outputfilename")
Choose 2 other commands from the list
These are all commands you should be very familiar with to work with Unix.
The programs were in a Filecalled SAMPLEIO:
SWAPINT
/* * C Program to Illustrate Pass by Value. */ #include
SUMFIFTY
/* * C program to find the sum of first 50 natural numbers * using for loop */ #include PRINTFLOATS #include int integer = 9876; float decimal = 987.6543; // Prints the number right justified within 6 columns printf("4 digit integer right justified to 6 column: %6d ", integer); // Tries to print number right justified to 3 digits but the number is not right adjusted because there are only 4 numbers printf("4 digit integer right justified to 3 column: %3d ", integer); // Rounds to two digit places printf("Floating point number rounded to 2 digits: %.2f ",decimal); // Rounds to 0 digit places printf("Floating point number rounded to 0 digits: %.f ",987.6543); // Prints the number in exponential notation(scientific notation) printf("Floating point number in exponential form: %e ",987.6543); return 0; } PrintFLOAT #include PRINTCHAR #include PrintASCII #include // When %c text format is used, character is displayed in case of character types printf("You entered %c. ",chr); // When %d text format is used, integer is displayed in case of character types printf("ASCII value of %c is %d.", chr, chr); return 0; } CountVOWELS #include // When %c text format is used, character is displayed in case of character types printf("You entered %c. ",chr); // When %d text format is used, integer is displayed in case of character types printf("ASCII value of %c is %d.", chr, chr); return 0; } UNIX CHEAT SHEET
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