N. B.: (1) Question No. 1 is compulsory. (2) Attempt any four question out of remaining six questions. (3) WAP means write a program in 'C language. 1. (a) WAP to find GCD and LCM for two natural numbers entered by user. (5) (b) Explain bitwise operators in C. (5). (c) WAP to find the octal equivalent of the natural number entered by the user. (5) (d) Write commands at UNIX prompt $ for the following: (5) i) To change the individual file ownership. ii) To search for a pattern in a file. iii) To display the names of users currently logged on to the system. iv) To count number of words, lines and characters in a file. v) To rename a file in working directory. 2. (a) Explain for, while and do-while in details. (8) (b) WAP to find the largest and the second largest elements in the list entered by the user. (8) (c) Explain the following functions : (4) (i) Ceil () (ii) sqrt () (iii) fmod () (iv) strcpy () 3. (a) Explain switch case statement in details. (4) (b) Design a structure "st" to contain name, date of birth and total marks obtained. Define the structure "dob" to represent date of birth. WAP to read data for n students in a class and sort them in descending order of total marks. (12) (c) What are the security rights associated with files and directories in UNIX? (4) 4. (a) WAP which contains the functions to do the following: (16) i) To read elements of a square matrix. ii) To display elements of the matrix. iii) To find the transpose of the matrix, using single matrix. iv) To check whether matrix is symmetric or not. A matrix is symmetric if its transpose equals to matrix itself. v) To find sum of all the elements lying above the main diagonal. (b) What is the difference between structure and union? (4) 5. (a) WAP using recursive function for finding the value of y where y = x", x and y are real numbers and n is a natural number. (8) (b) A program consists of the following declaration int A[5] = { 10, 40, 60, 75, 85 ):-' (6) Assume that starting memory address of "A" is 3ABC : 1 DEZ. What is the meaning of: - i) sizeof (A) iv) *(A + 2) ii) A v) (*A+-2) iii) *A vi) (A+ 2) (c) Explain the following functions: (6) (i) malloc () (ii) calloc () (iii) free () 6. (a) Explain various storage classes in C. (8) (b) WAP that deletes the duplicates in the set of numbers entered by the user and prints the list without duplicates. For ex.list{11, 10,20,5, 11,10} out of { 11,10,20, 5} (8) (c) Explain the following with suitable example: (4) (i) Call by value, (ii) Call by address. 7. (a) WAP to read two natural numbers r1 and r2, where r2 is greater than r1, and to generate all the prime numbers between r1 and r2 both inclusive. (8) (b) Write a function to find factorial of a number. WAP to find value of BIO using this function, where BIO is defined as - (8) BIO =n! / r! * (n - r)! , n a natural number and r is also a natural number. (c) WAP to concatenate two stings entered by the user. (4)