PROGRAMME BACHELOR OF COMPUTER APPLICATIONS (BCA)
SEMESTER I
COURSE CODE & NAME DCA1107 C PROGRAMMING
Section A
Multiple Choice Questions (2 Marks each)
[Please answer all the questions]
1. In C programming, which of the following symbols is used to denote a comment?
a) *
b) **
c) #
d) /* */
2. Every C program must have one ________function.
a) main()
b) printf()
c) scan()
d) none
3. What does the scanf() function do in C?
a) Reads formatted input from the standard input
b) Writes formatted output to the standard output
c) Writes formatted output to a file
d) Reads formatted input from a file
4. What is the result of the expression "x -= 3;" if x is initially 8?
a) 5
b) 2
c) 11
d) 12
5. What is the purpose of the continue statement in a loop?
a) To terminate the loop
b) To skip the current iteration and continue with the next iteration
c) To exit from the loop
d) None of the above
6. "What will be the result of the following code?
int i = 0;
while (1)
i++;
}"
a) The loop will run indefinitely, increasing i
b) The loop will execute once and terminate
c) The loop will not execute at all.
d) Compile time error
7. process by which a function calls itself repeatedly
a) Sub program
b) sub function
c) Module
d) Recursion
8. What does atoi("1234") return?
a) 1
b) 1234
c) “1234”
d) Error
9. How many values can a C function return at a time?
a) 1
b) 2
c) 3
d) As many as needed
10. In Bubble Sort, after each pass, the largest element among the unsorted elements "bubbles up"
to which position? You may assume that the elements are being sorted in ascending order.
a) First
b) Last
c) Middle
d) any where
Section B
SHORT ANSWERS (5 Marks each)
[Please answer Any Four questions in a separate page answer sheet especially provided for this purpose]
1. Examine the characteristics of the C programming language.
2. Discuss the significance of the const keyword in C programming.
3. Describe the syntax and usage of the if-else statement in C programming.
4. Describe the purpose and usage of the strcpy() function in C programming. Provide an example
demonstrating its usage for copying strings.
5. Explain the importance of function prototypes in C programming.
6. Discuss the Bubble Sort algorithm and its working principle.
Section C
LONG ANSWERS (10 Marks each)
[Please answer Any Three questions in a separate page answer sheet especially provided for this purpose]
1. Explain the purpose and structure of the switch-case statement in C programming. Provide a
detailed example demonstrating the usage of switch-case.
2. Explain the concept of arrays in C. Provide an example program that initializes an array of
integers and calculates the sum of its elements.
3. Explain various String handling functions in C with Examples.
4. Explain the concept of function prototypes in C. Write a function prototype and definition for a
function that calculates the square of a number. Discuss the importance of function prototypes
in C programming.