1st Sem C Questions 2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

* This question paper consists of five sections A,B,C,D and E. Section E is compulsory.

* Candidates are required to attempt five question in all selecting one question from each of the section A, B,
C and D of the question paper and all the subparts of the questions in section E. Section E is Compulsory.
* Each Section contains equal marks i.e. 20 marks.
Section A
Q.1 a) Explain various data types in C and operators that are used in C language. (Marks: 10)
b) Write a program to arrange the elements of an array in ascending order using Bubble Sort algorithm.
(Marks: 10)
or
Q.2 a) Explain various data types of C in detail with the help of examples. (Marks: 10)
b) Explain operator associativity and operator precedence in C. (Marks: 10)

Section B
Q.3 a) Write a program in C to print name of days using switch-case-default statement. (Hint: 1-Sunday, 2-Monday,
3-Tuesday…………….7-Saturday. (Marks: 07)
b) Write a program to find the largest number among three numbers using if-else statement. (Marks: 07)
c) What is conditional operator? Explain with the help of example. (Marks: 06)
or
Q.4 a) Differentiate between call by value and call by reference with the help of a suitable example. (Marks: 10)
b) What is the difference between while loop and do-while loop. (Marks: 05)
c) Explain if-else and nested if-else statements. (Marks: 05)

Section C
Q.5 a) Define 2-D array. Write a program to multiply two matrices. (Marks: 20)
or
Q.6 a) What is recursion? Write a program to calculate the sum of n natural numbers using recursion. (Marks: 10)
b) Write a program in C to print the fibonacci series. (Marks: 05)
c) Explain gets() and puts() in C? (Marks: 05)

Section D
Q.7 a) Define Structure in C. Explain with suitable example. (Marks: 10)
b) Write a program in C to subtract the elements of two matrices. Also write code to find the diagonal elements
of resultant matrix in the same program. (Marks: 10)
or
Q.8 a) What is the difference between structure, array and union. Explain with examples. (Marks: 10)
b) What are various file opening modes in C? (Marks: 10)

Section E
Q.9 Explain following terms (Each part contains 4 Marks.)
a) Linker vs Loader
b) Bitwise Operators
c) Pre-processor Directives
d) Assignment statements in C
e) Type-casting and Type-promotion

You might also like