Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Assignment

Your deliverables should


be delivered in one PDF.

Please, make sure your ubuntu username is


“your name” followed by “your reg number.”

It is imperative that this naming convention is


followed, as failure to do so will result in the
deduction of all your grades. If you are
unsure of how to rename your file, we
recommend conducting an internet search
for assistance.
Please follow the instructions below to complete the assignment:

1. Install vim and gcc using the following commands:

• sudo apt install vim

• sudo apt install gcc

2. Create a directory named 'OSLab' inside the Documents directory.


• Create an 'assignments' directory inside the OSLab
directory.
• Create a 'week6' directory inside the assignments directory.
• Your file structure should look like this:

~/Documents/OSLab/assignments/week6.
3. Inside the 'week6' directory, create a C code file named 'hello-
world.c' using the nano text editor that prints 'Hello world from
terminal!!'
4. Inside the 'week6' directory, create another C code file named
'findLargest.c' using the nano text editor that takes three integer
values from the user and prints the largest number of the three.
5. Compile the 'hello-world.c' file using the 'gcc' command and
execute the 'a.out' file.
• Take a screenshot of the terminal with the code’s output.
6. Compile the 'findLargest.c' file using the 'gcc' command and
execute the 'a.out' file.
• Enter the values 1, 2, and 3 as input respectively.
• Take a screenshot of the terminal with the code’s output.
7. Finally, display the code inside both these files using the 'more'
command
• Take a screenshot of the terminal.
8. Add the three screenshots mentioned above in one PDF and
upload that PDF

Note: Keep these files for your next lab.

You might also like