Anda di halaman 1dari 5

ANNA UNIVERSITY: CHENNAI 600 025

B.E./B.Tech. DEGREE EXAMINATIONS, APRIL /MAY- 2014


Regulations - 2013
Second Semester
(Common to EEE, E&I, I&C, Marine Engg.)
GE6263 COMPUTER PROGRAMMING LABORATORY
1. a. Write and execute the following UNIX commands 20
i.To display the pathname with your terminal
ii.Lists all entries, including the hidden files.
iii.View the contents of the file named text1.txt
iv.Count the number of lines, words and characters in a file.
b. Write a Shell program to accept the input as r and find the area and circumference of a
scircle. 40
c. Write a C program to accept the 15 natural numbers and find its mean, 40
median,mode, standard deviation and variance.

2. a. Write and execute the following UNIX commands 20


i.Create a file test1.txt and enter the values from 1 to 10
ii.Sort the content of file in ascending order
iii.Split the file in to 3 number of files
iv.View the content of file
b. Write a shell program to perform arithmetic operations using case construct. 40
c. Write a C program to print the given number is prime or not. 40

3. a. Write and execute the following UNIX commands 20


i.Create a directory with the name of Exam
ii.Create a file called exam.txt in theExam directory
iii.View the content of the exam.txt file
iv.Rename the file exam.txt to test.txt
b.Write a Shell program to find the largest digit of a number 40
c. Write a C program using dynamic memory allocation to sort n numbers in ascending
order. 40
4. a. Write and execute the following UNIX commands 20
(i) Count the specific number of lines in a file from the beginning of the
file
(ii) To destroy a specific file from a user directory
(iii) Send a greeting message to other user
(iv) Execute a shell program
b. Write a Shell program to find the factorial of a number using for loop. 40
c. Write a C program using dynamic memory allocation to perform addition of two
matrices. 40

5. a. Write and execute the following UNIX commands 20


(i) Create a directory
(ii) Create a file
(iii) Rename the directory
(iv) Rename the file
b. . Write a Shell program to check the given number is Armstrong or not . 40
c. Write a C program to find the sum of n numbers using function. 40

6. a. Write and execute the following UNIX commands 20


(i) Create a file
(ii) Update the file
(iii) Display the file contents
(iv) Display the file with line number
b. Write a Shell program to count the number of vowels in a line of text 40
c. Write a C program to create a file, which contains employee id, name, age etc and
display thecontents. 40

7. a. Write and execute the following UNIX commands 20


(i) Combine the two files in the form of register number followed by name
(ii) Sort the two files in ascending order
(iii) Count the number of lines in the files
(iv) Rename the two files.
b. Write a Shell program to find the second largest digit from a number 40
c. Using function, write a C program to check whether the given number and its reverse
are same. 40
8. a.Write and execute the following UNIX commands 20

i.Display the characteristics of the process.


ii.To list the file with detailed information
iii.Display the present working directory
iv.Demonstrate the pipe & fork command
b. Write a Shell program to find the Fibonacci series of n natural numbers. 40
c. Write a C program to swap the numbers with and without using third variable. 40

9. a.Write and execute the following UNIX commands 20


i.Extract the last ten lines and display them
ii.Display the file content size
iii.Display the file with the line number
iv.Count the number of words and lines in the file
b. Write a shell program to compute simple interest and compound interest. 40
c. Write a C program to perform matrix multiplication. 40

10. a.Write and execute the following using UNIX Commands: 20


i.To view one page of the file
ii.To view first 10 lines of the file
iii.To view last 10 lines of the file
iv.To view the commands which was executed
b. Write a shell program to compute the power of x. 40
c. Write a C program to find the greatest of N numbers using arrays. 40

11. a. Write and execute the following using UNIX Commands: 20


i.To create a directory
ii.To change the directory
iiiTo change the permission of the file
iv.To clear the screen
b. Write a shell program to check whether a given year is leap year or not. 40
c. Write a C program to sort N numbers. Use pointers. 40
12. a.Write and execute the following using UNIX Commands: 20
i.To print the calendar
ii.To print the date and time
iii.To change the password
iv.To print presently who is using the system
b. Write a shell program to check whether the given number is positive or negative.40
c. Write a C program using pointers to read in an array of integers and print its elements
in reverse order 40

13. a.Write and execute the following using UNIX Commands: 20


i.To list files and directories, recursively on a single line
ii.To view the files page by page
iii.To move the files
iv.To change the permission of the file
b. Write a shell program to find the GCD of numbers. 40
c. Write a C program to sort N numbers. Use functions 40

14. a.Write and execute the following using UNIX Commands: 20


i.Show manual for a command
ii.Change the file to read only mode
iii.Sort the files in alphabetical order
iv.To concatenate two files
b. Write a shell program to find the greatest among three numbers 40
c. Develop a C program to compute the roots of a quadratic equation. 40

15. a.Write and execute the following using UNIX Commands: 20


i.List all filenames which has dot at the end
ii.List all filenames which has an extension
iii.Store the output of date command in a file called date. out
iv.Sort the files in alphabetical order
b. Write a shell program to print the first N numbers divisible by 4. 40
c. Write a C program to perform matrix addition. Use functions. 40

16. a.Write and execute the following UNIX commands: 20


i. To check the working directory
ii. Change the password
iii. To display todays date
iv. To display the calendar of this month
b. Write a Shell program to find the sum of n different numbers. 40
c. Write a C program using dynamic memory allocation to sort n numbers in
descending order. 40
17. a.Write and execute the following UNIX commands: 20
i. Display the calendar
ii. Execute more than one command at a time (using semi-colon ;)
iii. Display the users full details
iv. Display the user-id / Group-id
b. Write a Shell program to check the given string is palindrome or not. 40
c. Write a C program using dynamic memory allocation to develop a mark sheet of 5
students. 40

18. a.Write and execute the following UNIX commands 20

i. Create a directory
ii. Create a file
iii. Rename the directory
iv. Rename the file
b. Write a Shell program to check the given number is Armstrong or not. 40
c. Write a C program to find the sum of n numbers using function. 40

19. a.Write and execute the following UNIX commands 20

i. Display the calendar of the current month


ii. Display todays date and time
iii. Display the present working directory
iv. Display your login username and access privilege
b.Write a Shell program to check the given number is even or odd. 40
c.Write a C program to implement the queue data structure using malloc() and do the
insert operation. 40

20. a.Write and execute the following UNIX commands: 20

i.Merge and sort the contents of the file1,file2


ii.Delete the file
iii.Print specified text from the file
iv.To display the current date in the form of dd/mm/yyyy.
b. Write a shell program to convert the lower case letters to upper case. 40
c. Write a C program to find the square and cube of a given number. 40

*****************

Anda mungkin juga menyukai