(6 Pages) Reg. No. : ........................................
Code No. : 20321 E Sub. Code : SMCS 11/
SMSE 11/AMCS 11/
AMSE 11/CMCS11
B.Sc. (CBCS) DEGREE EXAMINATION,
NOVEMBER 2021
First Semester
Computer Science/Software Engineering –– Main
PROGRAMMING IN C
(For those who joined in July 2017 onwards)
Time : Three hours Maximum : 75 marks
PART A — (10 1 = 10 marks)
Answer ALL questions.
Choose the correct answers :
1. How may keywords are there in C
(a) 31 (b) 32
(c) 64 (d) 63
2. What is the output of this statement?
printf(―%d‖, printf(―hello‖));
(a) syntax error (b) hello5
(c) garbage value (d) hello
3. What will be the value of sum after execution?
void main( )
{
int sum = 1, index = 9;
do{
index = index –1;
sum* = 2;
}while (index<9);
}
(a) 1 (b) 2
(c) 3 (d) 4
4. Which command can be used to come out of
recursion?
(a) return (b) break
(c) exit (d) none of the above
Page 2 Code No. : 20321 E
5. Array is an example of ––––––––– type memory.
(a) compile time (b) run time
(c) both (a) and (b) (d) none of the above
6. Which of the following is more appropriate for
reading in multi word string?
(a) scanf( ) (b) printf( )
(c) gets( ) (d) none of the above
7. The default return type
(a) void (b) int
(c) float (d) none of the above
8. Members of unions are accessed as
(a) union-name.member
(b) union-pointer->member
(c) both (a) and (b)
(d) none of the above
9. FILE is a type of
(a) int (b) char*
(c) struct (d) none of the above
10. Which of the following mode argument is used to
truncate?
(a) a (b) w
(c) f (d) t
Page 3 Code No. : 20321 E
PART B — (5 5 = 25 marks)
Answer ALL questions, choosing either (a) or (b).
Each answer should not exceed 250 words.
11. (a) Explain about IO operations in C.
Or
(b) Write C program for following :
(i) odd or even
(ii) to check leap year or not.
12. (a) Differentiate while and do-while loop.
Or
(b) Write C program for Fibonacci series.
13. (a) Define array and how to declare and initialize
an array with an example.
Or
(b) Explain any five string operations in C.
14. (a) Explain function pass by reference with an
example.
Or
(b) Explain structure with example.
Page 4 Code No. : 20321 E
[P.T.O]
15. (a) Explain need and types of file.
Or
(b) Distinguish between sequential and random –
access file.
PART C — (5 8 = 40 marks)
Answer ALL questions, choosing either (a) or (b).
Each answer should not exceed 600 words.
16. (a) Explain operator precedence in C.
Or
(b) Describe in detail about pre-processor
directive.
17. (a) Describe nested for loop with example.
Or
(b) Write C program for the following :
(i) palindrome or not
(ii) gcd of given number.
18. (a) What is an array and explain the advantages
of using an array with an example.
Or
(b) Explain multidimensional array with an
example program.
Page 5 Code No. : 20321 E
19. (a) Compare and contrast union and a structure.
Or
(b) Define function and how to define a function
in C.
20. (a) Discuss in detail about pointer arithmetic in
C.
Or
(b) Discuss in detail about various file operations.
———————
Page 6 Code No. : 20321 E