SlideShare a Scribd company logo
1 of 4
Download to read offline
Kannada Sangha Pune’s
Kaveri College of Arts, Science and Commerce
MSc(CS) – I
Sem II Practical Assignments
Android practical programs
1) Write an Android Program to demonstrate Activity life Cycle
2) Create table Customer (id, name, address, phno). Create Android Application for
performing the following operation on the table. (usingsqlite database)
i) Insert New Customer Details.
ii) Show All the Customer Details
3) Create an Android Application that will change color of the screen and change the
font size of text view using xml.
4) Create an Android Application to accept two numbers and create two buttons (power
and Average). Display the result on the next activity on Button click
5) Create an Android Application to perform following string operation according to
user selection of radio button.
6) Create a Simple Android Application Which Send ―Hello‖ message from one
activity to another with help of Button (Use Intent).
7) Write an Android Program to Change the Image Displayed on the Screen
8) Java Android Program to demonstrate login form with validation.
9) By using Spinner, Buttons. Write a Android program to draw following GUI.
10) Create a Notification in Android and display the notification message on second
activity
11) Write an Android program to read 5 numbers and print the sum of all
12) Create an Android Application to display satellite view of current location using
Google Map.
13) Construct an Android Application to display the images using ImageSwitcher
14) Construct an Android Application to accept a number and calculate Factorial and Sum
of Digits of a given number using Menu.
15) Create table Company (id, name, address, phno). Create Android Application for
performing the following operation on the table.(using sqlite database)
i) Insert New Company Details.
ii) Show All the Company Details.
16) Construct an Android application to accept a number and calculate Armstrong and
Perfect number of a given number using Menu.
17) Write an Android Application to send Email.
18) Create a Simple Android Application Which Send ―Hello‖ message from one
activity to another with help of Button (Use Intent).
19) Create an Android application which will ask the user to input his name and a
message, display the two items concatenated in a label, and change the format of the
label using radio buttons and check boxes for selection, the user can make the label
text bold, underlined or italic and change its color .include buttons to display the
message in the label, clear the text boxes and label and then exit.
20) Write an Android Program to Demonstrate Date Picker Dialog in Android
21) Create table Project(id,name,dept,city). Create Application to perform the following
operations.(usingsqlite database)
i) Add records.
ii) Display all the records.
22) Write an Android application to accept two numbers from the user, and displays them,
but reject input if both numbers are greater than 10 and asks for two new numbers.
23) Create the simple calculator shown below also perform appropriate operation
AOS practical programs
1) Write a C program to find whether a given file is present in current directory or not.
2) Write a C program which blocks SIGOUIT signal for 5 seconds. After 5 second
process checks any occurrence of quit signal during this period, if so, it unblock the
signal. Now another occurrence of quit signal terminates the program. (Use
sigprocmask() and sigpending() )
3) Write a C program that a string as an argument and return all the files that begins with
that name in the current directory. For example > ./a.out foo will return all file names
that begins with foo.
4) Write a C program to find file properties such as inode number, number of hard link,
File permissions, File size, File access and modification time and so on of a given file
using stat() system call.
5) Write a C program to create ‘n’ child processes. When all ‘n’ child processes
terminates, Display total cumulative time children spent in user and kernel mode.
6) Write a C program to find file properties such as inode number, number of hard link,
File permissions, File size, File access and modification time and so on of a given file
using fstat() system call.
7) Write a C program to implement the following unix/linux command (use fork, pipe
and exec system call). Your program should block the signal Ctrl-C and Ctrl- signal
during the execution.
ls -l | wc -l
8) Write a C program to create an unnamed pipe. The child process will write following
three messages to pipe and parent process display it.
Message1 = “Hello World”
Message2 = “Hello SPPU”
Message3 = “Linux is Funny”
9) Write a C program to read all txt files (that is files that ends with .txt) in the current
directory and merge them all to one txt file and returns a file descriptor for the new
file
10) Write a C program to map a given file in memory and display the contain of mapped
file in reverse.
11) Write a C program to create a file with hole in it.
12) Write a C program to get and set the resource limits such as files, memory associated
with a process.
13) Write a C program which receives file names as command line arguments and display
those filenames in ascending order according to their sizes.
e.g $ a.out a.txt b.txt c.txt, …
14) Write a C program to display as well as resets the environment variable such as path,
home, root etc.
15) Write a C program that will only list all subdirectories in alphabetical order from
current directory.
16) Write a C program to display statistics related to memory allocation system. (Use
mallinfo() system call).
17) Write a C program to create variable length arrays using alloca() system call.
18) Write a C program that behaves like a shell (command interpreter). It has its own
prompt say “NewShell$”. Any normal shell command is executed from your shell by
starting a child process to execute the system program corresponding to the command.
It should additionally interpret the following command.
i) count c - print number of characters in file
ii) count w - print number of words in file
iii)count l - print number of lines in file
19) Write a C program to send SIGALRM signal by child process to parent process and
parent process make a provision to catch the signal and display alarm is fired.(Use
Kill, fork, signal and sleep system call)
20) Write a C program to display all the files from current directory and its subdirectory
whose size is greater than ’n’ Bytes Where n is accepted from user through command
line.
21) Write a C program that redirects standard output to a file output.txt. (use of dup and
open system call)
22) Write a C program to Identify the type (Directory, character device, Block device,
Regular file, FIFO or pipe, symbolic link or socket) of given file using stat() system
call.
23) Write a C program that catches the ctrl-c (SIGINT) signal for the first time and
display the appropriate message and exits on pressing ctrl-c again.
24) Write a C program to implement the following unix/linux command on current
directory
ls –l > output.txt
25) Write a C program to display the given message ‘n’ times. (make a use of setjmp and
longjmp system call)
26) Write a C program to display the last access and modified time of a given file.
27) Write a C program to move the content of file1.txt to file2.txt and remove the file1.txt
from directory.
28) Write a C program which creates a child process to run linux/ unix command or any
user defined program. The parent process set the signal handler for death of child
signal and Alarm signal. If a child process does not complete its execution in 5 second
then parent process kills child process.
29) Write a C program that print the exit status of a terminated child process.

More Related Content

Similar to Android AOS practical programs.pdf

PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docxamrit47
 
Android best training-in-mumbai
Android best training-in-mumbaiAndroid best training-in-mumbai
Android best training-in-mumbaivibrantuser
 
Prep 2-booklet-2nd-term-2016-2017
Prep 2-booklet-2nd-term-2016-2017Prep 2-booklet-2nd-term-2016-2017
Prep 2-booklet-2nd-term-2016-2017khawagah
 
Workshop: Building a Streaming Data Platform on AWS
Workshop: Building a Streaming Data Platform on AWSWorkshop: Building a Streaming Data Platform on AWS
Workshop: Building a Streaming Data Platform on AWSAmazon Web Services
 
Introduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).docIntroduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).docMayurWagh46
 
(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercises(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercisesNico Ludwig
 
C LANGUAGE UNIT-1 PREPARED BY MVB REDDY
C LANGUAGE UNIT-1 PREPARED BY MVB REDDYC LANGUAGE UNIT-1 PREPARED BY MVB REDDY
C LANGUAGE UNIT-1 PREPARED BY MVB REDDYRajeshkumar Reddy
 
Bsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c languageBsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c languageRai University
 

Similar to Android AOS practical programs.pdf (20)

C tutorials
C tutorialsC tutorials
C tutorials
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
 
PT1420 File Access and Visual Basic .docx
PT1420 File Access and Visual Basic                      .docxPT1420 File Access and Visual Basic                      .docx
PT1420 File Access and Visual Basic .docx
 
Csharp
CsharpCsharp
Csharp
 
Android best training-in-mumbai
Android best training-in-mumbaiAndroid best training-in-mumbai
Android best training-in-mumbai
 
unit 4.docx
unit 4.docxunit 4.docx
unit 4.docx
 
Visual programming
Visual programmingVisual programming
Visual programming
 
ArduinoWorkshop2.pdf
ArduinoWorkshop2.pdfArduinoWorkshop2.pdf
ArduinoWorkshop2.pdf
 
VB Dot net
VB Dot net VB Dot net
VB Dot net
 
Prep 2-booklet-2nd-term-2016-2017
Prep 2-booklet-2nd-term-2016-2017Prep 2-booklet-2nd-term-2016-2017
Prep 2-booklet-2nd-term-2016-2017
 
Workshop: Building a Streaming Data Platform on AWS
Workshop: Building a Streaming Data Platform on AWSWorkshop: Building a Streaming Data Platform on AWS
Workshop: Building a Streaming Data Platform on AWS
 
Ch02.pdf
Ch02.pdfCh02.pdf
Ch02.pdf
 
Introduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).docIntroduction-to-C-Part-1 (1).doc
Introduction-to-C-Part-1 (1).doc
 
Lab 1 Essay
Lab 1 EssayLab 1 Essay
Lab 1 Essay
 
(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercises(3) cpp abstractions more_on_user_defined_types_exercises
(3) cpp abstractions more_on_user_defined_types_exercises
 
As pnet
As pnetAs pnet
As pnet
 
C LANGUAGE UNIT-1 PREPARED BY MVB REDDY
C LANGUAGE UNIT-1 PREPARED BY MVB REDDYC LANGUAGE UNIT-1 PREPARED BY MVB REDDY
C LANGUAGE UNIT-1 PREPARED BY MVB REDDY
 
C++Basics2022.pptx
C++Basics2022.pptxC++Basics2022.pptx
C++Basics2022.pptx
 
Bsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c languageBsc cs i pic u-1 introduction to c language
Bsc cs i pic u-1 introduction to c language
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
 

Recently uploaded

The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17Celine George
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...Nguyen Thanh Tu Collection
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptxPoojaSen20
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhleson0603
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 

Recently uploaded (20)

VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 

Android AOS practical programs.pdf

  • 1. Kannada Sangha Pune’s Kaveri College of Arts, Science and Commerce MSc(CS) – I Sem II Practical Assignments Android practical programs 1) Write an Android Program to demonstrate Activity life Cycle 2) Create table Customer (id, name, address, phno). Create Android Application for performing the following operation on the table. (usingsqlite database) i) Insert New Customer Details. ii) Show All the Customer Details 3) Create an Android Application that will change color of the screen and change the font size of text view using xml. 4) Create an Android Application to accept two numbers and create two buttons (power and Average). Display the result on the next activity on Button click 5) Create an Android Application to perform following string operation according to user selection of radio button. 6) Create a Simple Android Application Which Send ―Hello‖ message from one activity to another with help of Button (Use Intent). 7) Write an Android Program to Change the Image Displayed on the Screen 8) Java Android Program to demonstrate login form with validation. 9) By using Spinner, Buttons. Write a Android program to draw following GUI.
  • 2. 10) Create a Notification in Android and display the notification message on second activity 11) Write an Android program to read 5 numbers and print the sum of all 12) Create an Android Application to display satellite view of current location using Google Map. 13) Construct an Android Application to display the images using ImageSwitcher 14) Construct an Android Application to accept a number and calculate Factorial and Sum of Digits of a given number using Menu. 15) Create table Company (id, name, address, phno). Create Android Application for performing the following operation on the table.(using sqlite database) i) Insert New Company Details. ii) Show All the Company Details. 16) Construct an Android application to accept a number and calculate Armstrong and Perfect number of a given number using Menu. 17) Write an Android Application to send Email. 18) Create a Simple Android Application Which Send ―Hello‖ message from one activity to another with help of Button (Use Intent). 19) Create an Android application which will ask the user to input his name and a message, display the two items concatenated in a label, and change the format of the label using radio buttons and check boxes for selection, the user can make the label text bold, underlined or italic and change its color .include buttons to display the message in the label, clear the text boxes and label and then exit. 20) Write an Android Program to Demonstrate Date Picker Dialog in Android 21) Create table Project(id,name,dept,city). Create Application to perform the following operations.(usingsqlite database) i) Add records. ii) Display all the records. 22) Write an Android application to accept two numbers from the user, and displays them, but reject input if both numbers are greater than 10 and asks for two new numbers. 23) Create the simple calculator shown below also perform appropriate operation
  • 3. AOS practical programs 1) Write a C program to find whether a given file is present in current directory or not. 2) Write a C program which blocks SIGOUIT signal for 5 seconds. After 5 second process checks any occurrence of quit signal during this period, if so, it unblock the signal. Now another occurrence of quit signal terminates the program. (Use sigprocmask() and sigpending() ) 3) Write a C program that a string as an argument and return all the files that begins with that name in the current directory. For example > ./a.out foo will return all file names that begins with foo. 4) Write a C program to find file properties such as inode number, number of hard link, File permissions, File size, File access and modification time and so on of a given file using stat() system call. 5) Write a C program to create ‘n’ child processes. When all ‘n’ child processes terminates, Display total cumulative time children spent in user and kernel mode. 6) Write a C program to find file properties such as inode number, number of hard link, File permissions, File size, File access and modification time and so on of a given file using fstat() system call. 7) Write a C program to implement the following unix/linux command (use fork, pipe and exec system call). Your program should block the signal Ctrl-C and Ctrl- signal during the execution. ls -l | wc -l 8) Write a C program to create an unnamed pipe. The child process will write following three messages to pipe and parent process display it. Message1 = “Hello World” Message2 = “Hello SPPU” Message3 = “Linux is Funny” 9) Write a C program to read all txt files (that is files that ends with .txt) in the current directory and merge them all to one txt file and returns a file descriptor for the new file 10) Write a C program to map a given file in memory and display the contain of mapped file in reverse. 11) Write a C program to create a file with hole in it. 12) Write a C program to get and set the resource limits such as files, memory associated with a process. 13) Write a C program which receives file names as command line arguments and display those filenames in ascending order according to their sizes. e.g $ a.out a.txt b.txt c.txt, … 14) Write a C program to display as well as resets the environment variable such as path, home, root etc. 15) Write a C program that will only list all subdirectories in alphabetical order from current directory. 16) Write a C program to display statistics related to memory allocation system. (Use mallinfo() system call). 17) Write a C program to create variable length arrays using alloca() system call. 18) Write a C program that behaves like a shell (command interpreter). It has its own prompt say “NewShell$”. Any normal shell command is executed from your shell by starting a child process to execute the system program corresponding to the command. It should additionally interpret the following command. i) count c - print number of characters in file ii) count w - print number of words in file
  • 4. iii)count l - print number of lines in file 19) Write a C program to send SIGALRM signal by child process to parent process and parent process make a provision to catch the signal and display alarm is fired.(Use Kill, fork, signal and sleep system call) 20) Write a C program to display all the files from current directory and its subdirectory whose size is greater than ’n’ Bytes Where n is accepted from user through command line. 21) Write a C program that redirects standard output to a file output.txt. (use of dup and open system call) 22) Write a C program to Identify the type (Directory, character device, Block device, Regular file, FIFO or pipe, symbolic link or socket) of given file using stat() system call. 23) Write a C program that catches the ctrl-c (SIGINT) signal for the first time and display the appropriate message and exits on pressing ctrl-c again. 24) Write a C program to implement the following unix/linux command on current directory ls –l > output.txt 25) Write a C program to display the given message ‘n’ times. (make a use of setjmp and longjmp system call) 26) Write a C program to display the last access and modified time of a given file. 27) Write a C program to move the content of file1.txt to file2.txt and remove the file1.txt from directory. 28) Write a C program which creates a child process to run linux/ unix command or any user defined program. The parent process set the signal handler for death of child signal and Alarm signal. If a child process does not complete its execution in 5 second then parent process kills child process. 29) Write a C program that print the exit status of a terminated child process.