a) Give syntax for declaring structure. b) Explain use of bitwise operator. c) What is pointer variable? d) What do you mean by character array? e) State any four data types in c. f) Give syntax for declaring and initializing pointer. g) Define function. h) State the difference between while and do-while loop. i) Give syntax for strcat ( ) string function. j) Write syntax for nested-if-else.
Q.2 Attempt any THREE of the following 12
a) Write a program to calculate factorial of a given number. b) Explain the difference between call by value and call by reference methods for calling function. c) Give syntax and example for switch case statement. d) State the use of increment and decrement operators. Also give difference between i++ and ++i statement with example.
Q.3 Attempt any THREE of the following 12
a) Explain importance of break statement with switch case statement. Give proper example. b) Write a program to enter values of a and b variables. Calculate addition, division, multiplication, subtraction of a & b and display results. c) Explain the concept of pointer arithmetic operations. d) Explain what is two dimensional array. Also explain how to declare and initialize two dimensional array with example.
Q.4 Attempt any FOUR of the following 16
a) Write a program to enter basic salary. Calculate gross salary with 5% DA and 15% TA on basic salary. Display calculated gross salary. b) Explain the concept of array with pointer. c) Explain strlen ( ) and strcmp ( ) string functions with example. d) Write a program to print reverse of an entered string using pointer. e) Explain continue statement with example. f) Write a program to find the largest number from given array.
-1- CPR – (W’2007)
Q.5 Attempt any THREE of the following 12 a) What is variable? How to declare it? How variable different from constant? b) Debug following program and write only errors if any: #include <stdio.h> main ( ) { char X; while (X = 0 ; X < = 255; X++) printf (“\n character is %c”, X); } c) Write a program to display series of 11 to 30 numbers in reverse order as 30, 29, 28…, 2, 1. Also calculate sum of 11 to 30 numbers and display it. d) Explain what is structure and array of structure. Declare a structure student with elements as rollno and name. Declare array of structure for 10 students.
Q.6 Attempt any THREE of the following 12
a) Write a menu drien program for the following options : (i) To find whether entered no. is even or odd. (ii) To display sum of two entered numbers.
b) Declare a structure ‘Book’ having data members as title, author and
price. Accepted this data for one structure variable and display accepted data. Write a program. c) What is pointer? Give use of ampersand (&) and asterisk (*) operators in pointer. d) Explain meaning of following statement with reference to pointers. int * P, X; X = 10; *P = X; P = & X;