0% found this document useful (0 votes)
8 views5 pages

Linux Programming Lab Exam Questions

The document outlines the practical examination details for the Linux Programming Laboratory for B.Tech IV Semester at the Institute of Aeronautical Engineering, scheduled for July 2024. It includes various programming tasks and shell script assignments across multiple sets, focusing on file manipulation, inter-process communication, and system command simulations. Each set requires students to answer one question from two provided options, with a maximum score of 70 marks.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

Linux Programming Lab Exam Questions

The document outlines the practical examination details for the Linux Programming Laboratory for B.Tech IV Semester at the Institute of Aeronautical Engineering, scheduled for July 2024. It includes various programming tasks and shell script assignments across multiple sets, focusing on file manipulation, inter-process communication, and system command simulations. Each set requires students to answer one question from two provided options, with a maximum score of 70 marks.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Hall Ticket No Course Code: ACSC16

INSTITUTE OF AERONAUTICAL ENGINEERING


(Autonomous)
[Link] IV SEMESTER END PRACTICAL EXAMINATIONS JULY 2024
Regulation: UG-20
LINUX PROGRAMMING LABORATORY
(COMMON TO CSE | CSE (DS))
Time: 2 Hours Max Marks: 70
Answer any ONE Questions
SET-I

1. (a) Write a Shell program to count the number of words in a file


(b) Write a Shell program to calculate the factorial of a given number

OR

2. (a) Write a program called simulating tail command using system calls, that reads existing file name and displays
the last 10 lines content of file to output stream .
(b) Write a C program to simulate cat and cp command

Hall Ticket No Course Code: ACSC16

INSTITUTE OF AERONAUTICAL ENGINEERING


(Autonomous)
[Link] IV SEMESTER END PRACTICAL EXAMINATIONS JULY 2024
Regulation: UG-20
LINUX PROGRAMMING LABORATORY
Time: 2 Hours (COMMON TO CSE | CSE (DS)) Max Marks: 70
Answer any ONE Questions
SET-II

1. (a) Write a Shell Program to print all .txt files and .c files.
(b) Write a program to implement inter process communication using shared memory. The program creates
shared memory segment and stores data, multiple users can access data at the same time. For example:

OR

2. (a) Write a Shell program to display all the users who are currently logged in after a specified time.
(b) Write client and server programs (using c) for interaction between server and client processes using TCP
Elementary functions

Page 1 of 5
Hall Ticket No Course Code: ACSC16

INSTITUTE OF AERONAUTICAL ENGINEERING


(Autonomous)
[Link] IV SEMESTER END PRACTICAL EXAMINATIONS JULY 2024
Regulation: UG-20
LINUX PROGRAMMING LABORATORY
Time: 2 Hours (COMMON TO CSE | CSE (DS)) Max Marks: 70
Answer any ONE Questions
SET-III

1. (a) Write a program called simulating head command using system calls, that reads existing file name and
displays the first 10 lines content of file to output stream
(b) Write a shell script to generate and show all Kaprekar numbers less than 1000.
A number is called Capricorn or Kaprekar number whose square is divided into two parts in any conditions
and parts are added, the additions of parts is equal to the number, is called Capricorn or Kaprekar number.

OR

2. (a) Write a program called simulating rm command that remove exiting file or group of files of given directory,
reads the file name or group of filenames and directory name then removes that related files from given
directory using rm command.
(b) Write a shell script called TimeTable that prompts user for the size (a positive integer in int); and prints the
multiplication table as shown:

Hall Ticket No Course Code: ACSC16

INSTITUTE OF AERONAUTICAL ENGINEERING


(Autonomous)
[Link] IV SEMESTER END PRACTICAL EXAMINATIONS JULY 2024
Regulation: UG-20
LINUX PROGRAMMING LABORATORY
Time: 2 Hours (COMMON TO CSE | CSE (DS)) Max Marks: 70
Answer any ONE Questions
SET-IV

1. (a) Write a shell script called moving files from one directory to another directory that prompts user to enter
source directory and destination directory
(b) Write a shell script to generate and show Amicable numbers. Two different numbers are said to be so
Amicable numbers if each sum of divisors is equal to the other number. Amicalble Numbers are: (220, 284),
(1184, 1210), (2620, 2924), (5020, 5564), (6232, 6368).

OR

2. (a) A sales tax of 7% is levied on all goods and services consumed. It is also mandatory that all the price tags
should include the sales tax. For example, if an item has a price tag of $107, the actual price is $100 and $7
goes to the sales tax.
Write a shell script using a loop to continuously input the tax-inclusive price (in double); compute the actual
price and the sales tax (in double); and print the results rounded to 2 decimal places. The script shall
terminate in response to input of -1; and print the total price, total actual price, and total sales tax.
(b) Write a program called signal handler to catch SIGINT, SIGINT signal which interrupts the process by
pressing ctrl + c. For example,

Page 2 of 5
Hall Ticket No Course Code: ACSC16

INSTITUTE OF AERONAUTICAL ENGINEERING


(Autonomous)
[Link] IV SEMESTER END PRACTICAL EXAMINATIONS JULY 2024
Regulation: UG-20
LINUX PROGRAMMING LABORATORY
Time: 2 Hours (COMMON TO CSE | CSE (DS)) Max Marks: 70
Answer any ONE Questions
SET-V

1. (a) Write a program to implement inter process communication using shared memory. The program creates
shared memory segment and stores data, multiple users can access data at the same time
(b) Write a program to implement one way communication using fifo function. The program shall execute mkfifo
function, creates fifo file, stores data in fifo file by one process and other process has to read by other process,
it exchanges data between un-related process.

OR

2. (a) Write a program to implement one way communication using pipes. The program shall execute pipe function,
stores data at one end reads the data from other end, fork function creates new process and exchange data
between related process.
(b) Write a program called signal handler to catch SIGINT, SIGINT signal which interrupts the process by
pressing ctrl + c, SIG_DFL signal do default action i.e. terminates the current process

Hall Ticket No Course Code: ACSC16

INSTITUTE OF AERONAUTICAL ENGINEERING


(Autonomous)
[Link] IV SEMESTER END PRACTICAL EXAMINATIONS JULY 2024
Regulation: UG-20
LINUX PROGRAMMING LABORATORY
Time: 2 Hours (COMMON TO CSE | CSE (DS)) Max Marks: 70
Answer any ONE Questions
SET-VI

1. (a) Write a program called signal handler to catch SIGINT, SIGINT signal which interrupts the process by
pressing ctrl + c
(b) Write a program called simulation of nl command, which prompts the user for a file name and read line by
line and display line number before each line. For example,

OR

2. (a) Write a program called simulating tail command using system calls, that reads existing file name and displays
the last 10 lines content of file to output stream.
(b) Write a shell script to display all the users who are currently logged in after a specified time. The script
shall read the date and time, users who are logged in to linux server then displays users who logged in after
specified time.

Page 3 of 5
Hall Ticket No Course Code: ACSC16

INSTITUTE OF AERONAUTICAL ENGINEERING


(Autonomous)
[Link] IV SEMESTER END PRACTICAL EXAMINATIONS JULY 2024
Regulation: UG-20
LINUX PROGRAMMING LABORATORY
Time: 2 Hours (COMMON TO CSE | CSE (DS)) Max Marks: 70
Answer any ONE Questions
SET-VII

1. (a) Write a shell script called SumProductMinMax3 that prompts user for three integers. The script shall read
the inputs as int; compute the sum, product, minimum and maximum of the three integers; and print the
results.
(b) Write a shell script called SumProductMinMax5 that prompts user for five integers. The script shall read
the inputs as int; compute the sum, product, minimum and maximum of the five integers; and print the
results. Use five int variables: number1, number2, ..., number5 to store the inputs.

OR

2. (a) Write a shell script called IncomeTaxCalculator that reads the taxable income (in int). The script shall
calculate the income tax payable (in double); and print the result rounded to 2 decimal places. For examples,
(b) Write a program called simulating rm command that remove exiting file or group of files of given directory,
reads the file name or group of filenames and directory name then removes that related files from given
directory using rm command.

Hall Ticket No Course Code: ACSC16

INSTITUTE OF AERONAUTICAL ENGINEERING


(Autonomous)
[Link] IV SEMESTER END PRACTICAL EXAMINATIONS JULY 2024
Regulation: UG-20
LINUX PROGRAMMING LABORATORY
Time: 2 Hours (COMMON TO CSE | CSE (DS)) Max Marks: 70
Answer any ONE Questions
SET-VIII

1. (a) Write a program called simulating tail command using system calls, that reads existing file name and displays
the last 10 lines content of file to output stream.
(b) Write a program to implement one way communication using pipes. The program shall execute pipe function,
stores data at one end reads the data from other end, fork function creates new process and exchange data
between related process.

OR

2. (a) Write a program called simulation of mv command, which prompts user for source file and destination file
to rename file.
(b) Write a program to implement one way communication using fifo function. The program shall execute mkfifo
function, creates fifo file, stores data in fifo file by one process and other process has to read by other process,
it exchanges data between un-related process

Page 4 of 5
Hall Ticket No Course Code: ACSC16

INSTITUTE OF AERONAUTICAL ENGINEERING


(Autonomous)
[Link] IV SEMESTER END PRACTICAL EXAMINATIONS JULY 2024
Regulation: UG-20
LINUX PROGRAMMING LABORATORY
Time: 2 Hours (COMMON TO CSE | CSE (DS)) Max Marks: 70
Answer any ONE Questions
SET-IX

1. (a)
(b)

OR

2. (a)
(b)

Hall Ticket No Course Code: ACSC16

INSTITUTE OF AERONAUTICAL ENGINEERING


(Autonomous)
[Link] IV SEMESTER END PRACTICAL EXAMINATIONS JULY 2024
Regulation: UG-20
LINUX PROGRAMMING LABORATORY
(COMMON TO CSE | CSE (DS))
Time: 2 Hours Max Marks: 70
Answer any ONE Questions
SET-X

1. (a)
(b)

OR

2. (a)
(b)
−◦◦ ◦◦−

Page 5 of 5

You might also like