Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

CS604 Assignment 01 Spring 2021 Solution / Discussion

Please carefully read the following instructions before attempting the assignment.

 

RULES FOR MARKING

It should be clear that your assignment would not get any credit if:

  • The assignment is submitted after the due date.
  • The submitted assignment does not open or the file is corrupt.
  • Strict action will be taken if the submitted solution is copied from any other student or the internet.

 

You should consult the recommended books to clarify your concepts as handouts are not sufficient.

 

Assignment Submission:

You are supposed to submit your assignment in Doc or Docx format.

Any other formats like Scan Images, PDF, Zip, Rar, Ppt and Bmp, etc will not be accepted.

Secondly, you are required to send Question no. 1 and Question no. 2 in the same screenshot. Furthermore C code of Question no. 1 must also be pasted in the same word file after the screenshot.

 

 

OBJECTIVE

The objective of this assignment is to provide hands-on experience of:

·         The basic concept of Process creation in Linux

·         Useful Linux commands

·         System calls and their usage in Linux

 

 

 

NOTE

 

No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignments in the last hour of the deadline. It is recommended to upload the solution file at least two days before its closing date.

 

If you find any mistake or confusion in the assignment (Question statement), please consult with your instructor before the deadline. After the deadline, no queries will be entertained in this regard.

 

For any query, feel free to email at:

Cs604@vu.edu.pk

 

 

 

 

Questions No 01                                                                              15 marks

Write the C Program in which the parent process will create the child process through fork() system call. You need to perform the following activities in both child and parent processes respectively.

  • In the child process, you need to print the table depending upon the last digit of your VUID. For example in VUID mc123456789, the last digit is 9. So in that case table of 9 should be printed in the child process.
  • In the parent process, you need to print your VUID and name and a simple message like “In parent process”. Secondly, in the parent process call the wait() system call so that the child process can print the required table.

Questions No 02                                                                               05 marks

You are required to print the complete path name of the current working directory. And then create two directories as per your name and your VUID. Finally by using the ‘ls’ command display the list of directories.

In the screenshot you need to perform the following steps.

  • In the screenshot firstly compile the program as given in Question No. 1.
  • Then run the program.
  • As per the Question no. 2 print current working directory then finally create and display required directories.

Following is the sample screenshot for both Question No. 1 and Question No. 2.

Furthermore C code of Question no. 1 must also be pasted in the same word file, after the screenshot.

Note: in case you have installed the Virtual Box you can take the screenshot as follows. Go to the view menu and click on Take Screenshot as follow.

 

See the following link for writing and compiling your first program in Linux.

https://vulms.vu.edu.pk/Courses/CS604/Downloads/how%20to%20Write%20...

See the following link for installation of Virtual Box and Ubuntu (LInux) on your system.

https://vulms.vu.edu.pk/Courses/CS604/Downloads/Lab%201_CS604.docx

 

The End

Views: 1062

Replies to This Discussion

Stay touched with this discussion, Solution idea will be uploaded as soon as possible in replies here before the due date.

CS604 Assignment 01 Spring 2021 Solution two files 

CS604 Assignment 1 Solution Spring 2021

CS604 SOLUTION 1 BY JUNAID

CS604Assignment-01-Solution-Spring_2021-Complete-Solution

Complete Solution link 

CS604-Assignment-01-Solution-Spring_2021-Complete-Solution.docx

MUHAMMAD USMAN 

Email, cell no, facebook personal links, links sharing for promotion any kind of site & youtube direct link sharing is not allowed at the site.

 

Although If you want to share the youtube video, then paste the embed codes here of the youtube video. Otherwise your comment / reply will be deleted. As well as your account will be deleted from the site. Thanks for understanding.

Ok Sir

 

CS604 Assignment 1 Solution Spring 2021 Code

#include <stdio.h>

 

 

#include <string.h>

 

 

#include <stdlib.h>

 

 

#include <unistd.h>

 

 

#include <sys/types.h>

 

 

#include <sys/wait.h>

 

 

 

 

 

int main (void)

 

 

{

 

 

int pid,status;

 

 

pid=fork();

 

 

if(pid>0){

 

 

printf("In Parent Process \nVUID:" MC190200409\nNAME: \n);

 

 

printf(Existing the Parent Process");

 

 

wait(0);

 

 

exit(1);

 

 

}

 

 

esle if(pid==0){

 

 

 

 

 

int n = 3;

 

 

int i;

 

 

printf(In Child Process\nMultiplication table of 3");

 

 

for(i=1;1<=10;++i){

 

 

printf(%dX%d= %d, \n" i,n,i*n);

 

 

}

 

 

}

 

 

THE END

 

CS604 Assignment 01 Spring 2021 Solution two files 

CS604 Assignment 1 Solution Spring 2021

CS604 SOLUTION 1 BY JUNAID

CS604Assignment-01-Solution-Spring_2021-Complete-Solution

Complete Solution link 

CS604-Assignment-01-Solution-Spring_2021-Complete-Solution.docx

#CS_604_Assignment_1 #Sudo_Apt_Error_fix_Problem #CS604
CS604 Assignment 1 Solution 2021 || How to Fix Sudo Apt Install Error || CS604 Assigment Spring 2021

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service