Sunteți pe pagina 1din 30

ANNA UNIVERSITY: CHENNAI 600 025 B.E./B.Tech.

. DEGREE EXAMINATIONS, MAY/JUNE - 2012 Regulations - 2008 Second Semester (Common to All Branches) GE2155: COMPUTER PRACTICE LABORATORY II Time: 3 Hours 1. a. Execute the following using UNIX Commands: i. ii. To print the present working directory To create a directory 5 5 5 5 20 50 10 Maximum Marks: 100

iii. To change the directory iv. To copy files b. Write a shell program to find the sum and average of four integers c. Write a C program to perform matrix addition. d. Viva- Voce 2. a. Execute the following using UNIX Commands: i. ii. To copy files To concatenate two files

5 5 5 5 20 50 10

iii. To change the permission of the file iv. To find out who's logged in b. Write a shell program to compute simple interest and compound interest. c. Write a C program to perform matrix multiplication. d. Viva- Voce 3. a. Execute the following using UNIX Commands: i. ii. iii. iv. To print the present working directory To create a directory To change the permission of the file To find out who's logged in

5 5 5 5 20 50 10

b. Write a shell program to swap two numbers c. Write a C program to compute the transpose of a matrix d. Viva- Voce

4.

a. Execute the following using UNIX Commands: i. ii. iii. iv. To view one page of the file To view first 10 lines of the file To view last 10 lines of the file To view the commands which was executed 5 5 5 5 20 50 10

b. Write a shell program to compute the power of x. c. Write a C program to find the greatest of N numbers using arrays d. Viva-Voce 5. a. Execute the following using UNIX Commands: i. ii. iii. iv. To create a directory To change the directory To change the permission of the file To clear the screen

5 5 5 5 20 50 10

b. Write a shell program to check whether a given year is leap year or not. c. Write a C program to sort N numbers. Use pointers. d. Viva-Voce 6. a. Execute the following using UNIX Commands: i. ii. iii. iv. List all filenames which has dot at the end List all filenames which has an extension Find the subdirectories available in the present working directory

5 5 5 5 20 50 10

Display all files, sub directories and files in subdirectories including their sizes b. Write a shell program to find whether the given number is odd or even c. Write a C program to perform matrix addition d. Viva-Voce 7. a. Execute the following using UNIX Commands: i. ii. iii. iv. To print the calendar To print the date and time To change the password To print presently who is using the system

5 5 5 5 20 50 10

b. Write a shell program to check whether the given number is positive or negative. c. Write a C program using pointers to read in an array of integers and print its elements in reverse order d. Viva- Voce

8.

a. Execute the following using UNIX Commands: i. ii. iii. iv. To append the contents of one file into another To link files To change the password To display the file attributes 5 5 5 5 20 20 10

b. Write a shell program to find the quotient and remainder of two numbers c. Develop a C function that will scan a character string passed as an argument and convert all lower-case characters to their upper-case equivalents. d. Viva- Voce 9. a. Execute the following using UNIX Commands: i. ii. iii. iv. To print the calendar To print the date and time To append more than one file To link files

5 5 5 5 20 50 10

b. Write a shell program to check whether a number is divisible by 5 c. Develop a C program to copy the contents of one file into another d. Viva- Voce 10. a. Execute the following using UNIX Commands: i. ii. iii. iv. To print the present working directory To print the calendar To append more than one file To display the file attributes

5 5 5 5 20 50 10

b. Write a shell program to check whether the given number is a prime number or not. c. Develop a C program to print the number of vowels in a given paragraph d. Viva- Voce 11. a. Execute the following using UNIX Commands: i. ii. iii. iv. To list files and directories, recursively on a single line To view the files page by page To move the files To change the permission of the file

5 5 5 5 20 50 10

b. Write a shell program to find the GCD of numbers. c. Write a C program to sort N numbers. Use functions d. Viva- Voce

12. a. Execute the following using UNIX Commands: i. ii. iii. iv. To create a directory To print the present working directory To list files and directories, recursively on a single line To remove an empty directory 5 5 5 5 20 50 10

b. Write a shell program to find the factorial of a number c. Write a C program to sort N names alphabetically. Use pointers. d. Viva- Voce 13. a. Execute the following using UNIX Commands: i. ii. iii. iv. To find out who's logged in To print the calendar To print the date and time To change the password

5 5 5 5 20 50 10

b. Write a shell program to reverse the digits of a number c. Write a C program to sort N names alphabetically. Use functions d. Viva- Voce 14. a. Execute the following using UNIX Commands: i. ii. iii. iv. Print the calendar for 2012 for the month July Store the output of date command in a file called date. out Sort the files in alphabetical order Display the file attributes

5 5 5 5 20 50 10

b. Write a shell program to find the sum of the digits of a given number c. Develop a C program to find the transpose of a given matrix. Use function d. Viva- Voce 15. a. Execute the following using UNIX Commands: i. ii. iii. iv. Show manual for a command Change the file to read only mode Sort the files in alphabetical order To concatenate two files

5 5 5 5 20 50 10

b. Write a shell program to find the greatest among three numbers c. Develop a C program to compute the roots of a quadratic equation. d. Viva- Voce

16. a. Execute the following using UNIX Commands: i. ii. iii. iv. To print the present working directory To create a directory To list files and directories, recursively on a single line To find out who's logged in 5 5 5 5 20 50 10

b. Write a shell program to print the first N even numbers. c. Develop a C function that will scan a character string passed as an argument and convert all lower-case characters to their upper-case equivalents. d. Viva- Voce 17. a. Execute the following using UNIX Commands: i. ii. iii. iv. Copy the directory and its file to the other directory Change the mode of the file, where the changed file should posses all the permission To print the calendar To print the date and time

5 5 5 5 20 50 10

b. Write a shell program to print the first N odd numbers. c. Develop a C program to copy the contents of one file into another d. Viva- Voce 18. a. Execute the following using UNIX Commands: i. ii. iii. iv. To append more than one file To link files Sort the files in alphabetical order To concatenate two files

5 5 5 5 20

b. Write a shell program to print the first N prime numbers. 19. a. Execute the following using UNIX Commands: i. ii. iii. iv. List all filenames which has dot at the end List all filenames which has an extension Store the output of date command in a file called date. out Sort the files in alphabetical order

5 5 5 5 20 50 10

b. Write a shell program to print the first N numbers divisible by 4. c. Write a C program to perform matrix addition. Use functions. d. Viva- Voce

20. a. Execute the following using UNIX Commands: i. ii. Copy the directory and its file to the other directory Change the mode of the file, where the changed file should posses all the permission iii. iv. List all files in current directory whose second character is a digit Print todays date and the calendar of the current month using single command b. Write a shell program to print the factorial of first N numbers c. Write a C program to perform matrix multiplication. d. Viva- Voce 20 50 10 5 5 5 5

********

ANNA UNIVERSITY: CHENNAI 600 025 B.E./B.Tech. DEGREE EXAMINATIONS, MAY /JUNE- 2012 Regulations - 2008 Second Semester (Common to All Branches) GE2155 COMPUTER PRACTICE LABORATORY II Time: 3 Hours 1. a. Write and execute the following UNIX commands i. ii. iii. iv. v. b. c. d. 2. a. Create a file named GE2155 Display only the first two characters of all the lines from a file. Convert the all the characters from lower case to uppercase Display your user name Display the calendar (20) (20) (40) (30) Maximum Marks: 100 (20)

Write a Shell program to execute various UNIX commands using case statements Write an interactive shell script that asks for a word and file name and then tells how many times that word occurred in the file. Write a C program that uses pointers to compute the sum of all elements stored in an array. Write and execute the following UNIX commands i. Create two files with the name of name.txt, which contain only names and reg.txt with the content of register number respectively ii. Combine the two files in the form of register number followed by name iii. Sort the two files in ascending order iv. Count the number of lines in the files v. Rename the two files Write a Shell program to count the number of vowels in a line of text Given the number of elements and size of elements, write a C program to allocate memory using functions( Hint: Using malloc()) Write and execute the following UNIX commands i. To view only the files in a directory ii. Display the working directory iii. Execute more than one command at a time. iv. Demonstrate the pipe command v. Count the number of words in the file Write a Shell program to find the sum of odd digits and even digits from a number Create a file test2.txt and write a C program to perform the read and write operation in to the file.

b. c.

(30) (40)

3.

a.

(20)

b. c.

(40) (40)

4.

a. Write and execute the following UNIX commands i. ii. iii. iv. v. To remove the directory with files. Execute more than one command at a time Display the user-id/Group-id Convert all the content in a file into uppercase Concatenate the contents of 2 files

(30)

b. Write a Shell program to find the smallest and largest number from a set of numbers. (30) c. Write a C program that prints the address of a variable along with its value 5, a. Write and execute the following UNIX commands i. ii. iii. iv. v. Demonstrate the pipe command Demonstrate tee command Display all files, subdirectories and files in sub directories including their sizes. Create a file called create.txt Move the file create.txt to move.txt (30) (40) (20) (40) (30)

b. Write a Shell program to find the largest among 3 numbers c. Write a C program to swap the values stored in two locations in the memory 6. a. Write and execute the following UNIX commands i. ii. iii. iv. v. Create a directory Exam and a file file1.txt inside it Display the file attributes Display the today date and store it in a file called date.out Print the calendar for the month of April 2012 View the file created

b. Write a Shell program to check the given number and its reverse are same

(40)

c. Create two files test1.txt and test2.txt and write a C program to read the file (40) text1.txt character by character on the screen and paste it at the end of test2.txt 7. a. Write and execute the following UNIX commands i. ii. iii. iv. Extract the last ten lines and display them Display the file content size Display the file with the line number Count the number of words and lines in the file (40) (30) (30)

b. Write a Shell program to find the factorial of a number using for loop. c. Write a C program using user defined function to sort the numbers in descending order

8.

a. Write and execute the following UNIX commands i. Print today date and the calendar of the current month using single command ii. Create a sub-directory with your name in the Home directory iii. Create a file in the Home directory iv. Copy the file to the sub directory v. Using pipe command sort the files in alphabetical order and store it in file1.dat b. Write a Shell program to generate Fibonacci series.

(30)

(40)

c. Write a C program to merge two files in to third file. The names of the files must (30) be entered using the command line arguments. 9. a. Write and execute the following UNIX commands i. ii. iii. iv. v. vi. Display the calendar of the current month Display todays date and time Display the present working directory Display your login username and access privilege Try to login as root Create a file using cat command (40) (20)

b. Write a Shell program to check the given number is even or odd.

c. Write a C program to implement the queue data structure using malloc() and do the (40) insert operation 10. a. Write and execute the following UNIX commands i. ii. iii. iv. v. Create a directory named Results View all directories created by the currently logged-in user Rename the directory Results and hide the directory View all the directories starting with a character R View only the hidden directories (30) (40) (20) (30)

b. Write a Shell program to display leap years using command line argument c. Write a C program to find the position of an element using linear search 11. a. Write and execute the following UNIX commands i.View only files from a directory ii. List all the files names starting with f and of size more than 4K iii. Display the present working directory and check whether there are hidden files in the same iv. Display your login name and access privilege b. Write a Shell program to find the area and circumference of a circle

(40)

c. Write a C program with function that accepts an integer in between 1-12 to (40) represent the month and displays the corresponding month of the year

12. a. Write and execute the following UNIX commands i. ii. iii. iv. v. Create a directory with the name of Exam Change the Exam directory as the working directory Create a file called exam.txt in the Exam directory Copy the content of the exam.txt file to another file named exam2.txt Rename the file exam.txt to test.txt

(20)

b. Write a Shell program to check the given string is palindrome or not. c. Write a C program to read marks of 10 students in the range of 0-100. Then make 10 groups: 0-10, 10-20, 20-30, etc. Count the number of values that falls in each group and display the results 13. a. Write and execute the following UNIX commands i. ii. iii. iv. v. vi. Create two directories called GE215 and GE255 Create a file called 1101.txt in the GE215 directory Give read only permission to the file 1101.txt Try to copy the file 1101.txt from GE215 to GE255 Change the access privilege and copy the file 1101.txt to GE255 Remove the directory GE215

(40) (40)

(30)

b. Write a Shell program to check the given number is Armstrong number or not c. Write a C program to read the content of the file and write it to another file 14. a. Write and execute the following UNIX commands i. Create a file file1.txt ii. Rename a file as file2.txt iii. Change the mode of the file to read only iv. View the content of a file and display the 7th line of the file v. Count the number of words in a file b. Write a Shell program to generate prime numbers less than 100 c. Write a C program that reads the file name and text of 20 words as command line arguments. Write the text into a file whose name is given as the file name. 15. a. Write and execute the following UNIX commands i. Create a file test1.txt ii. Display only the first two characters of all the lines from test1.txt. iii. Covert the lower case characters in the file to uppercase characters iv. Display the lines of file with string and v. Display the calendar of the year 2012 b. Write a Shell program to find the sum of square of individual digits

(30) (40) (20)

(40) (40) (20)

(40)

c. Write a program to copy 4 characters of a character array from the 4th position in (40) another character array

16. a. Write and execute the following UNIX commands i. Create a file start.txt ii. Display the beginning and end of the file iii. Add ; to the end of the file iv. Delete the 7th line of a file v. Display the content of file

(20)

b. Write a Shell program to find the sum of cube of Individual digits of a given (40) number c. Write a C program to find the maximum and minimum number entered in an array (40) using the array and pointer as function arguments 17. a. Write and execute the following UNIX commands (30) i. Create two file file1.txt and file2.txt ii. Assign different modes to the files and enter some values to both the files iii. Compare the files and sort them in the ascending order of values iv. Differentiate the file and list them in command line b. Write a Shell program to find the smallest and the largest digits of a number. c. Write a program using pointer variables to read a character until ; is entered. If the character is in upper case, print in lower case and vice versa. Also count the number of upper and lower case characters entered 18. a. Write and execute the following UNIX commands 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 (30) (40) (20)

b. Write a shell script to compute the gross salary of an employee according to the (40) following rules. If BASIC salary is < 1500 then HRA = 10% of the BASIC and DA = 90% of the BASIC. If BASIC salary is >= 1500 then HRA = Rs 500 and DA = 98% of the BASIC c. Write a C program to insert and delete an element in array (40) 19. a. Write and execute the following UNIX commands i. Create two files file1.txt and file2.txt ii. Check the file attributes and size of the files iii. Cut and paste the file content of file 1 to file 2 iv. Check the file sizes of file1.txt and file2.txt v. View the content of file 2.txt b. Write a shell script program to find the degree of x in a quadratic equation x4+3x2+1=0 c. Write a C program to copy one string into another and count the number of characters copied (20)

(40) (40)

20. a. Write and execute the following UNIX commands i. Create a file file3.txt ii. Enter a string in to the file3.txt iii. Translate the character I in the file to E
iv. Check the number of occurrence of character I.

(20)

b. Write a shell script to display the digits which are in odd position in a given (40) number c. Write a C program to find the number of characters in a file and also find the (40) frequency of all alphabets in a string

ANNA UNIVERSITY: CHENNAI 600 025 B.E./B.Tech. DEGREE EXAMINATIONS, MAY /JUNE - 2012 Regulations - 2008 Second Semester (Common to All Branches) GE2155: COMPUTER PRACTICE LABORATORY II Time: 3 Hours 1. a. Maximum Marks: 100 Write and execute the following UNIX commands (i) Create a file. (ii) Display only the first two characters of all the lines from a file. (iii) Convert the lower case to uppercase. (iv) Combine two strings. (v) Display the file contents in descending order. Write a Shell program to check the given number is even or odd Write a C program using dynamic memory allocation to sort n numbers in ascending order. Write and execute the following UNIX commands (i) Create two files with the name of name.txt, which contain only names, and reg.txt with the content of register number respectively. (ii) Combine the two files in the form of register number followed by name (iii) Sort the two files in ascending order (iv) Count the number of lines in the files (v) Rename the two files. Write a Shell program to check and display 10 leap years Write a C program using dynamic memory allocation to sort n numbers in descending order. Write and execute the following UNIX commands (i) Create two files. (ii) Combine the two files. (iii) Search a specific word from any one of the file. (iv) Search a specific file from a directory. (v) Display the common and distinct line of contents from a file. Write a Shell program to find the area and circumference of a circle. Write a C program using dynamic memory allocation to sort n names in ascending order.

b. c. 2. a.

b. c. 3. a.

b. c.

4.

a.

b. c.

Write and execute the following UNIX commands (i) Create two files. (ii) Display the contents of both the files. (iii) Count the number of characters in both the files. (iv) Rename the two files. (v) Combine the two files without duplicate. Write a Shell program to check the given number and its reverse are same. Write a C program using dynamic memory allocation to sort n names in descending order.

5.

a.

b. c.

Write and execute the following UNIX commands (i) To view all the files and directories page by page (ii) To view only the directories page by page. (iii) To view only the files in a directory. (iv) Display the working directory. (v) Display the complete path of the working directory. Write a Shell program to check the given string is palindrome or not. Write a C program using dynamic memory allocation to add two matrices.

6.

a.

b. c.

Write and execute the following UNIX commands (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. (v) Execute more than one command at a time (using logical-AND &&). Write a Shell program to find the sum of odd and even numbers from a set of numbers. Write a C program using dynamic memory allocation to subtract two matrices.

7.

a.

b. c.

Write and execute the following UNIX commands (i) Demonstrate pipe command (ii) Demonstrate tee command (iii) Use more than one command at a time (who and date) (iv) Create a file called create.txt (v) Move the file create.txt to move.txt Write a Shell program to find the roots of a quadratic equation Write a C program using dynamic memory allocation to transpose a given matrix

8.

a.

b. c.

Write and execute the following UNIX commands (i) Create a file (ii) Print the specified number of lines of a file from start to end of the file. (iii) Display the file content with line number (iv) Update the file content with I/O redirection (v) Rename the file Write a Shell program to check the given integer is Armstrong number or not. Write a C program using dynamic memory allocation to copy one matrix to another matrix

9.

a.

b. c.

Write and execute the following UNIX commands (i) Create a directory (ii) Create a file (iii) Rename the directory (iv) Rename the file (v) View the file Write a Shell program to check the given integer is prime or not Write a C program using dynamic memory allocation to perform multiplication of two matrices

10.

a.

b. c.

Write and execute the following UNIX commands (i) Create a file (ii) Update the file (iii) Display the file content (iv) Display the file with line number (v) Count the number of words in the file Write a Shell program to generate prime numbers between 1 and 50 Write a C program using dynamic memory allocation to find the sum of elements of a matrix

11.

a.

b. c.

Write and execute the following UNIX commands (i) Create a Directory called main (ii) Create a sub-directory called sub in the main directory (iii) Create a file in the main directory (iv) Copy the file to the sub directory (v) Delete the file in the main directory Write a Shell program to find the sum of square of individual digits of a number Write a C program using dynamic memory allocation to develop a mark sheet of 5 students.

12.

a.

b. c.

Write and execute the following UNIX commands (i) Display the calendar (ii) Display the date and time (iii) Display the present working directory (iv) Display your user name (v) Create a file using cat command Write a Shell program to find the sum of cube of individual digits of a number Write a C program using dynamic memory allocation to develop salary details of 5 employees

13.

a.

b. c.

Write and execute the following UNIX commands (i) Use finger command (ii) Use grep command (iii) Use diff command (iv) Use uniq command (v) Use cmp command Write a Shell program to execute various UNIX commands using case statements Write a C program using dynamic memory allocation to find the minimum and maximum of a set of numbers.

14.

a.

b. c.

Write and execute the following UNIX commands (i) Create a directory (ii) View all directories from a user (iii) Rename a directory (iv) View all the directories starting with a specific character. (v) View only the hidden directories Write a Shell program to count the number of vowels in a line of text Write a C program to find the sum of n numbers using function.

15.

a.

b. c.

Write and execute the following UNIX commands (i) Create a file (ii) View only files from a directory (iii) Rename a file (iv) View all files starting with a specific character (v) View all the files which has a specific extension Write a Shell program to display student grades Write a C program using pointers to allocate a memory for the string University and reallocate the memory for the string to University Examinations

16.

a.

b. c.

Write and execute the following UNIX commands (i) Create a directory with the name of Exam (ii) Change the Exam directory as the working directory (iii) Create a file called exam.txt in the Exam directory (iv) View the content of the exam.txt file (v) Rename the file exam.txt to test.txt Write a Shell program to find the smallest number from a set of numbers Write a C program using pointers to combine two array elements without duplicate

17.

a.

b. c.

Write and execute the following UNIX commands (i) To check the working directory (ii) Change the password (iii) To display todays date (iv) To display the calendar of this month (v) To display a message University Exam using a special character Write a Shell program to find the smallest digit from a number Write a program to perform file copy operation

18.

a.

b. c.

Write and execute the following UNIX commands (i) Create two directories called CS1101 and CS1102 (ii) Create a file called cs1101.txt in the CS1101 directory (iii) Copy the file cs1101.txt from CS1101 to CS1102 (iv) Update the file content of cs1101.txt in the CS1102 directory (v) Rename the file in the CS1102 with cs1102.txt Write a Shell program to find the sum of all numbers between 50 and 100, which are divisible by 3 and not divisible by 5 Write a program to create two files and perform merge operation on it

19.

a.

b. c.

Write and execute the following UNIX commands (i) Create a file (ii) Rename a file (iii) Change the mode of the file to read only (iv) View the content of a file (v) Count the number of words in a file Write a Shell program to find the sum of digits of a number until a single digit is obtained. Write a C program using dynamic memory allocation to copy one matrix to another matrix

20.

a.

b. c.

Write and execute the following UNIX commands (i) Count the specific number of lines from a file start 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 (v) To display current time Write a Shell program to find the second highest number from a set of numbers Write a C program using dynamic memory allocation to develop salary details of 5 employees

Mark Allocation
UNIX Commands Shell Programming* C - Programming* Viva-voce Total 10 marks 40 marks 40 marks 10 marks ---------------100 marks ----------------

* Shell programming and C programming mark allocation (40 marks) Algorithm Program Execution 10 marks 20 marks 10 marks -------------40 marks --------------

Total -

ANNA UNIVERSITY: CHENNAI 600 025 B.E./B.Tech. DEGREE EXAMINATIONS, MAY/JUNE - 2012 Regulations - 2008 Second Semester (Common to All Branches) GE2155: COMPUTER PRACTICE LABORATORY II Time: 3 Hours 1. a. Maximum Marks: 100 Write and execute the following UNIX commands (i) Create a directory (ii) Create a file (iii) Rename the directory (iv) Rename the file (v) View the file Write a Shell program to execute various UNIX commands using case statements Write a C program to create a file, which contains register number, name, age etc. and display the contents of the file. Write and execute the following UNIX commands (i) Create a file (ii) Update the file (iii) Display the file contents (iv) Display the file with line number (v) Count the number of words in the file Write a Shell program to count the number of vowels in a line of text Write a C program to create a file, which contains employee id, name, age etc and display the contents Write and execute the following UNIX commands (i) Create a Directory called main (ii) Create a sub-directory called sub in the main directory (iii) Create a file in the main directory (iv) Copy the file to the sub directory (v) Delete the file in the main directory Write a Shell program to display student grades Write a C program to create a file, which contains two numbers followed by an operator in a line. Read a line of the file, while reading it; with respect to the operator perform the operation against the numbers. Write and execute the following UNIX commands (i) Display the calendar (ii) Display the date and time (iii) Display the present working directory (iv) Display your user name (v) Create a file using cat command Write a Shell program to find the smallest number from a set of numbers Write a program to perform file copy operation.

b. c.

2.

a.

b. c.

3.

a.

b. c.

4.

a.

b. c.

5.

a.

b. c.

Write and execute the following UNIX commands (i) Use finger command (ii) Use grep command (iii) Use diff command (iv) Use uniq command (v) Use cmp command Write a Shell program to find the smallest digit from a number Write a program with an append operation on an existing file.

6.

a.

b. c.

Write and execute the following UNIX commands (i) Create a directory (ii) View all directories from a user (iii) Rename a directory (iv) View all directories start with a specific character (v) View only the hidden directories Write a Shell program to find the sum of all numbers between 50 and 100, which are divisible by 3 and not divisible by 5 Write a program to create two files and perform merge operation on it

7.

a.

b. c.

Write and execute the following UNIX commands (i) Create a file (ii) View only files from a directory (iii) Rename a file (iv) View all files starting with a specific character (v) View all the files which has a specific extension Write a Shell program to find the sum of digits of a number until a single digit is obtained. Write a C program to find the second largest digit from a number using function.

8.

a.

b. c.

Write and execute the following UNIX commands (i) Create a file (ii) Display only the first two characters of all the lines from a file (iii) Convert the lower case to uppercase (iv) Combine two strings (v) Display the file contents in descending order Write a Shell program to find the second highest number from a set of numbers Write a C program to find the sum of digits of a number using function.

9.

a.

b. c.

Write and execute the following UNIX commands (i) Create two files with the name of name.txt, which contain only names, and reg.txt with the content of register number respectively. (ii) Combine the two files in the form of register number followed by name (iii) Sort the two files in ascending order (iv) Count the number of lines in the files (v) Rename the two files. Write a Shell program to find the second largest digit from a number Using function, write a C program to check whether the given number and its reverse are same

10.

a.

b. c.

Write and execute the following UNIX commands (i) Create two files (ii) Combine the two files (iii) Search a specific word from any one of the file (iv) Search a specific file from a directory (v) Display the common and distinct line of content from a file Write a Shell program to find the sum of odd digits and even digits from a number Write a C program to find the sum of square of individual digits of a number using function.

11.

a.

b. c.

Write and execute the following UNIX commands (i) Create two files (ii) Display the content of both the file (iii) Count the number of characters of both the files (iv) Rename the two files (v) Combine the two file without duplicate Write a Shell program to find the sum of two numbers using function programming Write a C program to find the smallest digit from a number using function.

12.

a.

b. c.

Write and execute the following UNIX commands (i) To view all the files and directories page by page (ii) To view only the directories page by page (iii) To view only the files from a directory (iv) Display the working directory (v) Display the complete path of the working directory Write a Shell program to find the largest number between two numbers using function. Using function, write a C program to check whether the given number and its reverse are same

13.

a.

b. c.

Write and execute the following UNIX commands (i) Display the calendar Execute more than one command at a time (using semi-colon ;) (ii) (iii) Display the users full detail (iv) Display the user-id / Group-id (v) Execute more than one command at a time (using logical-AND &&) Write a Shell program to find the largest among three numbers Write a C program using dynamic memory allocation to perform binary search operation

14.

a.

b. c.

Write and execute the following UNIX commands (i) Demonstrate pipe command (ii) Demonstrate tee command (iii) Use more than one command at a time (who and date) (iv) Create a file called create.txt (v) Move the file create.txt to move.txt Write a Shell program to find the largest among n different numbers Write a C program using dynamic memory allocation to perform linear search operation

15.

a.

b. c.

Write and execute the following UNIX commands (i) Create a file (ii) Print the specified number of lines of a file start from end of file (iii) Display the file content with line number (iv) Update the file content with I/O redirection (v) Rename the file Write a Shell program to find the largest digit of a number Write a C program to create a file, which contains employee id, name, age etc and display the content

16.

a.

b. c.

Write and execute the following UNIX commands (i) Create a directory with the name of Exam (ii) Change the Exam directory as the working directory (iii) Create a file called exam.txt in the Exam directory (iv) View the content of the exam.txt file (v) Rename the file exam.txt to test.txt Write a Shell program to find the sum of n different numbers. Write a program with an append operation on an existing file.

17.

a.

b. c.

Write and execute the following UNIX commands (i) To check the working directory (ii) Change the password (iii) To display todays date (iv) To display the calendar of this month (v) To display a message University Exam using a special character Write a Shell program to find the sum of digits of a number Write a C program using pointers to swap two numbers

18.

a.

b. c.

Write and execute the following UNIX commands (i) Create two directories called CS1101 and CS1102 (ii) Create a file called cs1101.txt in the CS1101 directory (iii) Copy the file cs1101.txt from CS1101 to CS1102 (iv) Update the file content of cs1101.txt in the CS1102 directory (v) Rename the file in the CS1102 with cs1102.txt Write a Shell program to print the reverse of a number Write a C program using pointers to copy the content of one array to another

19.

a.

b. c.

Write and execute the following UNIX commands (i) Create a file (ii) Rename a file (iii) Change the mode of the file to read only (iv) View the content of a file (v) Count the number of words in a file Write a Shell program to find the factorial of a number using for loop Write a C program to create a file, which contains two numbers followed by an operator in a line. Read a line of the file, while reading it; with respect to the operator perform the operation against the numbers.

20.

a.

b. c.

Write and execute the following UNIX commands (i) Count the specific number of lines from a file start 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 (v) To display currents time Write a Shell program to generate Fibonacci series Write a C program to create a file, which contains register number, name, age etc. and display the content of the file.

Mark Allocation
UNIX Commands Shell Programming* C - Programming* Viva-voce Total 10 marks 40 marks 40 marks 10 marks ---------------100 marks ----------------

* Shell programming and C programming mark allocation (40 marks) Algorithm Program Execution 10 marks 20 marks 10 marks -------------40 marks --------------

Total -

ANNA UNIVERSITY: CHENNAI 600 025 B.E./B.Tech. DEGREE EXAMINATIONS, MAY/JUNE - 2012 Regulations - 2008 Second Semester (Common to All Branches) GE2155: COMPUTER PRACTICE LABORATORY II Time: 3 Hours 1. a. Maximum Marks: 100 Write and execute the following UNIX commands (i) Create a directory (ii) View all directories of a user (iii) Rename a directory (iv) View all directories starting with a specific character (v) View only the hidden directories Write a Shell program to find the largest among three numbers Write a C program using dynamic memory allocation to perform linear search operation Write and execute the following UNIX commands (i) Create a file (ii) View only files from a directory (iii) Rename a file (iv) View all files starting with a specific character (v) View all the files which has a specific extension Write a Shell program to find the largest among n different numbers Write a C program using dynamic memory allocation to perform binary search operation

b. c. 2. a.

b. c.

3.

a.

b. c. 4. a.

Write and execute the following UNIX commands (i) Create a directory with the name of Exam (ii) Change the Exam directory as the working directory (iii) Create a file called exam.txt in the Exam directory (iv) View the content of the exam.txt file (v) Rename the file exam.txt to test.txt Write a Shell program to find the largest digit of a number Write a C program using dynamic memory allocation to sort n numbers in ascending order. Write and execute the following UNIX commands (i) To check the working directory (ii) Change the password (iii) To display todays date (iv) To display the calendar of this month (v) To display a message University Exam using a special character Write a Shell program to find the sum of n different numbers Write a C program using dynamic memory allocation to sort n numbers in descending order

b. c.

5.

a.

b. c. 6. a.

Write and execute the following UNIX commands (i) Create two directories called CS1101 and CS1102 (ii) Create a file called cs1101.txt in the CS1101 directory (iii) Copy the file cs1101.txt from CS1101 to CS1102 (iv) Update the file content of cs1101.txt in the CS1102 directory (v) Rename the file in the CS1102 with cs1102.txt Write a Shell program to find the sum of digits of a number Write a C program using dynamic memory allocation to sort n names in ascending order Write and execute the following UNIX commands (i) Create a file (ii) Rename a file (iii) Change the mode of the file to read only (iv) View the content of a file (v) Count the number of words in a file Write a Shell program to print the reverse of a number Write a C program using dynamic memory allocation to sort n names in descending order. Write and execute the following UNIX commands (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 (v) To display currents time Write a Shell program to find the factorial of a number using for loop Write a C program using dynamic memory allocation to perform addition of two matrices Write and execute the following UNIX commands (i) Create a file (ii) Display only the first two character of all the lines from a file (iii) Convert the lower case to uppercase (iv) Combine two string (v) Display the file content in descending order Write a Shell program to generate Fibonacci series Write a C program using dynamic memory allocation to subtract two matrices

b. c. 7. a.

b. c. 8. a.

b. c.

9.

a.

Write and execute the following UNIX commands Create two files with the name of name.txt, which contain only names, and reg.txt with the content of register number respectively. (ii) Combine the two files in the form of register number followed by name (iii) Sort the two files in ascending order (iv) Count the number of lines in the files (v) Rename the two files. Write a Shell program to check the given number is even or odd Write a C program using dynamic memory allocation to perform transpose of a given matrix (i)

b. c.

10.

a.

b. c.

Write and execute the following UNIX commands (i) Create two files (ii) Combine the two files (iii) Search a specific word from any one of the file (iv) Search a specific file from a directory (v) Display the common and distinct line of content from a file Write a Shell program to check and display 10 leap years Write a C program using dynamic memory allocation to copy one matrix to another matrix

11.

a.

b. c.

Write and execute the following UNIX commands (i) Create two files (ii) Display the contents of both the files (iii) Count the number of characters in both the files (iv) Rename the two files (v) Combine the two files without duplicate Write a Shell program to find the area and circumference of a circle Write a C program using dynamic memory allocation to multiply of two matrices

12.

a.

b. c. 13. a.

Write and execute the following UNIX commands (i) To view all the files and directories with page by page (ii) To view only the directories with page by page (iii) To view only the files from a directory (iv) Display the working directory (v) Display the complete path of the working directory Write a Shell program to check the given number and its reverse are same Write a C program using dynamic memory allocation to find the sum of elements of a matrix Write and execute the following UNIX commands (i) Display the calendar Execute more than one command at a time (using semi-colon ;) (ii) (iii) Display the users full details (iv) Display the user-id / Group-id (v) Execute more than one command at a time (using logical-AND &&) Write a Shell program to check the given string is palindrome or not Write a C program using dynamic memory allocation to develop a mark sheet of 5 students.

b. c.

14.

a.

b. c.

Write and execute the following UNIX commands (i) Demonstrate pipe command (ii) Demonstrate tee command (iii) Use more than one command at a time (who and date) (iv) Create a file called create.txt (v) Move the file create.txt to move.txt Write a Shell program to find the sum of odd and even numbers from a set of numbers Write a C program using dynamic memory allocation to develop salary details of 5 employees

15.

a.

b. c.

Write and execute the following UNIX commands (i) Create a file (ii) Print the line number of a file from start to end of the file (iii) Display the file content with line number (iv) Update the file content with I/O redirection (v) Rename the file Write a Shell program to find the roots of a quadratic equation Write a C program using dynamic memory allocation to find the minimum and maximum of a set of numbers.

16.

a.

b. c.

Write and execute the following UNIX commands (i) Create a directory (ii) Create a file (iii) Rename the directory (iv) Rename the file (v) View the file Write a Shell program to check the given number is Armstrong or not Write a C program to find the sum of n numbers using function.

17.

a.

b. c.

Write and execute the following UNIX commands (i) Create a file (ii) Update the file (iii) Display the file content (iv) Display the file with line number (v) Count the number of words in the file Write a Shell program to check the given number is prime or not Write a C program using pointers to swap two numbers

18.

a.

b. c.

Write and execute the following UNIX commands (i) Create a Directory called main (ii) Create a sub-directory called sub in the main directory (iii) Create a file in the main directory (iv) Copy the file to the sub directory (v) Delete the file in the main directory Write a Shell program to generate prime numbers between 1 and 50 Write a C program using pointers to copy the content of one array to another

19.

a.

b. c.

Write and execute the following UNIX commands (i) Display the calendar (ii) Display the date and time (iii) Display the present working directory (iv) Display your user name (v) Create a file using cat command Write a Shell program to find the sum of square of individual digits of a number Write a C program using pointers to allocate a memory for the string University and reallocate the memory for the string to University Examinations

20.

a.

b. c.

Write and execute the following UNIX commands (i) Use finger command (ii) Use grep command (iii) Use diff command (iv) Use uniq command (v) Use cmp command Write a Shell program to find the sum of cube of individual digits of a number Write a C program using pointers to combine two array elements without duplicate

ANNA UNIVERSITY PRACTICAL EXAMINATIONS (MAY JUNE 2010) GE2155 Computer Practice Lab-II

Mark Allocation
UNIX Commands Shell Programming* C - Programming* Viva-voce Total 10 marks 40 marks 40 marks 10 marks ---------------100 marks ----------------

* Shell programming and C programming mark allocation (40 marks) Algorithm Program Execution 10 marks 20 marks 10 marks -------------40 marks --------------

Total -

S-ar putea să vă placă și