0% found this document useful (0 votes)
39 views2 pages

IP (P.G.) College, Campus-2, Bulandshahr Department of Computer Science Question Bank For Sessional Exam (APR-2025) C Programming (BCA - 202)

This document is a question bank for a C Programming sessional exam for BCA students at IP College, covering objective questions, short answer questions, and programming tasks. It includes various topics such as string manipulation, pointers, structures, and memory allocation functions. The exam is structured into three sections: objective questions, short answer questions, and programming exercises.

Uploaded by

Kaushik Yash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views2 pages

IP (P.G.) College, Campus-2, Bulandshahr Department of Computer Science Question Bank For Sessional Exam (APR-2025) C Programming (BCA - 202)

This document is a question bank for a C Programming sessional exam for BCA students at IP College, covering objective questions, short answer questions, and programming tasks. It includes various topics such as string manipulation, pointers, structures, and memory allocation functions. The exam is structured into three sections: objective questions, short answer questions, and programming exercises.

Uploaded by

Kaushik Yash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

IP (P.G.

) College, Campus-2, Bulandshahr Department of Computer Science


Question Bank for Sessional Exam (APR- 2025)
C Programming (BCA– 202)

SECTION A (Objective Questions)


1. Which keyword is used to declare a character array in C?
a) str b) character c) arr d) char
2. Which function is used to compare two strings in c?
a) strcmp b) strcat c) strlen d) strcomp
3. How do you access the first element of an array arr in c?
a) arr[1] b) arr[0] c) arr[2] d) arr[10]
4. Which function is used to concatenate two strings in C?
a) strcat b) strconcat c) stradd d) concatstr
5. What is the purpose of the gets function in C?
a) Read a file b) Read a string from console c) Write a file d) Write to console
6. Which function is used to copy one string to another in C?
a) strcopy b) strcp c) strcpy d) strduplicate
7. How do you declare a 2-D integer array in C with 3 rows and 4 columns?
a) int arr[3,4]; b) int arr[3][4]; c) int[3,4] arr; d) int [4][3] arr;
8. scanf() is a predefined function in header file.
a) stdlib.h b) ctype.h c) stdio.h d) stdarg.h
9. In C,how do you declare a pointer variable that can store the address of an integer?
a) int *ptr; b) ptr int; c) int ptr; d) ptr *int;
10. What is the purpose of the arrow ->operator in C when used with structure with pointers ?
a) Arithmetic operation b) indirection operator c) Member access operation d) Bitwise operation
11. What is the keyword used to define a structure in C?
a) struct b) record c) class d) object
12. How do you initialize an array in C?
a) int arr[3]=(1,2,3); b) int arr(3)={1,2,3}; c) int arr[3]={1,2,3}; d) int arr(3)=(1,2,3);
13. Which type of loop is commonly used to iterate through an array in C ?
a) if loop b) switch loop c) for loop d) while loop
14. An uninitialized pointer in c is called?
a) void b) wild c) dangling d) constructor
15. What is #include <stdio.h>?
a) Preprocessor directive b) Inclusion directive c) File inclusion directive d) None of the mentioned
16. The C-preprocessors are specified with _________ symbol.
a) # b) $ c) ‖ ‖ d) &
17. How do you access the third element in an array named 'data' in C?
a) data[2] b) data[3] c) data(2) d) data(3)
18.Every string is terminated by NULL character. How it is represented?
a) „\0‟ b) NULL c) Both a & b d) none of above
19.The format specifier to accept a string is
a) %c b) %d c) %f d) %s
20.Which header file is necessary for strlen() function?
a) conio.h b) strings.h c)string.h d) stdio.h
21.Matrices can be represented through ____ arrays.
a) Single b) 2-D c) 3-D d) Multi-dimensional
22.Pointer that is pointing to nothing is called —
a) Void b) Dangling c) Wild d) Null
23.Which of the following are themselves the collection of different types —
a) String b) Structure c) Char d) None
24. The array name itself is a –
a) Last element b) Pointer c) First element d) None of these
25. The following is a valid C string
a) ‗a‘ b) ‗c‖ c) ―programming‘ d) “language”
26. A structure is a collection of data elements and an array is a collection of___ data elements.
a) Homogeneous/Heterogeneous b) Similar/Frequent
c) Consecutive/Homogeneous d) Heterogeneous/Homogeneous
27. Which operator used by structure variable to access structure members :
a) & operator b) %d operator c) arrow operator d) dot operator
28. The format specifier used to print address of a variable is:
a) %u b) %d c) %c d) %f
29. In call a function by passing an entire array, we should pass:
a) Address of 2nd element b) No. of elements in array
c) Base address of array and its size d) Address of first element
30. What does the ―*‖ operator do ?
a) Get memory address b) Dereferences a pointer c) performs arithmetic d)compares pointers
SECTION B

Q1: a) Differentiate between string and character array


b) What is generic pointer ? How can it be converted to a specific type of pointer ?
Q2: a) Explain the difference between malloc() and calloc() function
b) Explain the importance of the #define preprocessor directive.
Q3: a) What is prototyping ? Why is it necessary ?
b) Differentiate formal and actual arguments.
Q4: a) How can you declare and initialize a string ?
b) Write short notes on the following:
a) strlen() b) strcpy() c) strcmp()
Q5: a) What is a structure? How it is different from union ?
b) Explain the difference between array and structure ?
Q6: Write a program to read elements in an integer array and print its elements in reverse order.

SECTION C

Q1. What is function ? Explain call by value and call by reference with suitable example.
Q2: Write a program to search an element in an integer array of 20 elements.
Q3: Declare a structure which contains the following members and write a program to list the given details ( RollNo, Name,
Father‘s Name, Age, City, Marks) of all students who scored more than 75 marks.
Q4: What is a pointer ? How can it be initialized ? Explain pointer to pointer with example ? Can we subtract two pointer variables ?
Q5: What is string ? Write a program to find concatenate of two strings using pointers without library functions
Q6. Write a program for the multiplication of two matrices of size 3*3

You might also like