Programming in C
Programming in C
wsswscvacavssssedeanens
~ P+307
SET/CSE/BCA/C-102
B. C. A. (First Semester)
EXAMINATION, 2021-22
‘Paper Second
IN ‘C’
|
PROGRAMMING
rime : Two Hours
3
[ Maximum Marks : 70
Note: (i) Attempt any five questions from Section A and
any three questions from Section B.
(ii) Answer each question of Section A within
50 words.
}
Section—A
Note : Attempt any five questions. Each question carries
5 marks.
P. T. O.
[3]
[2] P-307
(ii) A file with name DATA contains a series of
What is an array ? Write a program to compute Mean integer numbers. Write a C program to read these
and Median using arrays. numbers and then write all odd numbers to file
What is recursion ? Write a program to add first . called ODD and alleven numbers to a file called
10 natural numbers using recursion. EVEN. 7
Explain the switch statement with syntax and example, (i) Describe function and how it is defined in C.
Explain the working of for loop with an example. Explain actual and formal parameters with proper _
example. 8
State the use of break and continue statement with
example. : (ii) Design and develop a C program to reverse of an
integer number NUM and check whether it is
Explain the meaning of the following statements with
:
PALINDROME or NOT. 7
reference to pointers
int *
a, b;
ja What is a pointer ? Explain how the pointer
variable declared. and initialized. Write a C
b= 20; ‘program to swap two numbers using call by ;
| |
pointers method. 8
Fa ab!
:
:
Section—B
Differentiate between the following 5 each
Note : Attempt any three questions. Each question carries
(i) structure and union
15 marks.
(ii) while loop and do---while loop
What are the string handling fiinctions available in C ? (iii) pre and post-increment operator in an expression
Write user defined functions for string copy, string (iv) call by value and call by reference
compare and substring. 15.7 variable and constant
(v)
(i) What is a file ? Explain with an example the file P-307 A440
handling functions. 8