04-22-2012, 11:38 PM
Question 1: [Marks 20]
In Linux Ubuntu flavor, write a program in C language to do the following tasks.
1) Use fork ( ) system call to create a child process.
2) Child process should first take student name as input and then it should display student name that it takes from user. At last, child process should display numbers from 0 to 5.
3) Parent process should first take VU Student ID as input and then it should display VU Student ID that it takes from user. At last, parent process should display numbers from 6 to 10.
4) Output of the program should be like the one give below.
Enter Student Name: Mansoor Anwar
Student Name is: Mansoor Anwar
child: 0
child: 1
child: 2
child: 3
child: 4
child: 5
Enter Student ID: BC070651121
Student ID is: BC070651121
parent: 6
parent: 7
parent: 8
parent: 9
parent: 10
5) Execute this program on Linux Ubuntu. Take screen shots of your program that you write in C,
Commands that you used to run your program in Linux Ubuntu and the out put displayed by your
program. After taking screen shots, send these screen shots to me properly in your assignment.
Note:
1) Do not write your program in other languages like Java, C++ etc. Write your program only in C language.
2) Do not execute your program in other operating systems like Windows, Mac etc. Execute your program
only in Linux Ubuntu flavor.
3) You should provide three screen shots. Required three screen shots that you should provide are given
below.
i) Screen shot of your program that you write in C.
ii) Screen shot of Commands that you used to run your program in Linux Ubuntu.
iii) Screen shot of Final output of your program shown.
4) If the programs out put of any two students will be same then both of them will get zero marks. Similarly,
if Student ID and Student Name displayed in final output of program will not mach with actual name and
ID of student who submitted the assignment then that particular student will get zero marks. Moreover if
you will copy your assignment then you will get zero marks.
5) If you will try to submit your assignment by editing screen shots of any other student then you will get
zero marks.
In Linux Ubuntu flavor, write a program in C language to do the following tasks.
1) Use fork ( ) system call to create a child process.
2) Child process should first take student name as input and then it should display student name that it takes from user. At last, child process should display numbers from 0 to 5.
3) Parent process should first take VU Student ID as input and then it should display VU Student ID that it takes from user. At last, parent process should display numbers from 6 to 10.
4) Output of the program should be like the one give below.
Enter Student Name: Mansoor Anwar
Student Name is: Mansoor Anwar
child: 0
child: 1
child: 2
child: 3
child: 4
child: 5
Enter Student ID: BC070651121
Student ID is: BC070651121
parent: 6
parent: 7
parent: 8
parent: 9
parent: 10
5) Execute this program on Linux Ubuntu. Take screen shots of your program that you write in C,
Commands that you used to run your program in Linux Ubuntu and the out put displayed by your
program. After taking screen shots, send these screen shots to me properly in your assignment.
Note:
1) Do not write your program in other languages like Java, C++ etc. Write your program only in C language.
2) Do not execute your program in other operating systems like Windows, Mac etc. Execute your program
only in Linux Ubuntu flavor.
3) You should provide three screen shots. Required three screen shots that you should provide are given
below.
i) Screen shot of your program that you write in C.
ii) Screen shot of Commands that you used to run your program in Linux Ubuntu.
iii) Screen shot of Final output of your program shown.
4) If the programs out put of any two students will be same then both of them will get zero marks. Similarly,
if Student ID and Student Name displayed in final output of program will not mach with actual name and
ID of student who submitted the assignment then that particular student will get zero marks. Moreover if
you will copy your assignment then you will get zero marks.
5) If you will try to submit your assignment by editing screen shots of any other student then you will get
zero marks.
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]

;