Ad Code

Responsive Advertisement

MGKVP BCA II SEM MCQ BASED MODEL QUESTION PAPER FOR OCTOBER 2023

 UNIT-I: Arrays

  1. What is the purpose of initializing an array in C?

    A. To allocate memory for the array.

    B. To set the size of the array.

    C. To assign initial values to the elements of the array.

    D. To declare the array.


  2. In C, how can you access an element at a specific index in an array?

    A. Using the dot operator.

    B. Using the arrow operator.

    C. Using square brackets and the index.

    D. Using parentheses and the index.


  3. Which sorting algorithm is commonly used to sort arrays in C?

    A. Bubble Sort

    B. Merge Sort

    C. Quick Sort

    D. All of the above


  4. How is a two-dimensional array declared in C?

    A. int[][] myArray;

    B. int myArray[][];

    C. int myArray[][] = new int[][];

    D. int myArray[][] = {{1, 2}, {3, 4}};


  5. What is the memory representation of a two-dimensional array in C when stored in Row Major order?

    A. Elements are stored column by column.

    B. Elements are stored row by row.

    C. Elements are stored randomly.

    D. There is no specific memory representation.

UNIT-II: Pointers

  1. Which operator is used to obtain the address of a variable in C?

    A. &

    B. *

    C. ->

    D. ::


  2. What does pointer arithmetic involve in C?

    A. Adding or subtracting integer values from pointers.

    B. Multiplying or dividing pointers.

    C. Concatenating two pointers.

    D. Converting pointers to integers.


  3. What is dynamic memory allocation in C commonly used for?

    A. Sorting arrays.

    B. Initializing arrays.

    C. Allocating memory at runtime.

    D. Declaring variables.


  4. How can you declare an array of pointers in C?

    A. int* arr[];

    B. int arr*[];

    C. int*[] arr;

    D. int[]* arr;


  5. What is the purpose of function pointers in C?

    A. To declare functions.

    B. To point to the address of a function.

    C. To store function names.

    D. To call functions.

UNIT-III: Strings

  1. Which C library function is used to find the length of a string?

    A. strlen()

    B. strlength()

    C. stringlen()

    D. lengthstr()


  2. What does the strcat() function do in C?

    A. Compares two strings.

    B. Copies one string into another.

    C. Appends one string to the end of another.

    D. Calculates the length of a string.


  3. How can you compare two strings in C without using the standard library function strcmp()?

    A. Using a loop and comparing characters.

    B. Using strcompare() function.

    C. Using a switch statement.

    D. You cannot compare strings without strcmp().

UNIT-IV: Structures

  1. What is the purpose of a C structure?

    A. To store multiple values of the same data type.

    B. To perform mathematical operations.

    C. To define functions.

    D. To declare constants.


  2. How do you access fields within a structure in C?

    A. Using dot notation.

    B. Using square brackets.

    C. Using arrow notation.

    D. Using parentheses.


  3. What is a union in C?

    A. A data structure that holds multiple variables of different types.

    B. A synonym for a structure.

    C. A function that performs a specific task.

    D. A type of loop.

UNIT-V: C Preprocessor and Bitwise Operators

  1. What is the purpose of the C preprocessor?

    A. To write code.

    B. To optimize code.

    C. To handle macro substitution and file inclusion.

    D. To compile code.


  2. Which operator is used for bitwise AND in C?

    A. &

    B. &&

    C. |

    D. ||


  3. What is the purpose of shift operators in C?

    A. To multiply numbers.

    B. To shift bits left or right.

    C. To perform logical operations.

    D. To calculate square roots.

UNIT-VI: File Handling

  1. Which standard function is used to open a file in C?

    A. open()

    B. fopen()

    C. read()

    D. file_open()


  2. How do you check if the end of a file has been reached in C?

    A. Using the feof() function.

    B. Using the end_of_file() function.

    C. Using the file_end() function.

    D. Using the eof() function.


  3. Which function is used to read a character from a text file in C?

    A. fgetc()

    B. readchar()

    C. file_read()

    D. getchar()

Solution

UNIT-I: Arrays

  1. What is the purpose of initializing an array in C?

    Answer: C. To assign initial values to the elements of the array.

  2. In C, how can you access an element at a specific index in an array?

    Answer: C. Using square brackets and the index.

  3. Which sorting algorithm is commonly used to sort arrays in C?

    Answer: C. Quick Sort

  4. How is a two-dimensional array declared in C?

    Answer: B. int myArray[][];

  5. What is the memory representation of a two-dimensional array in C when stored in Row Major order?

    Answer: B. Elements are stored row by row.

UNIT-II: Pointers

  1. Which operator is used to obtain the address of a variable in C?

    Answer: A. &

  2. What does pointer arithmetic involve in C?

    Answer: A. Adding or subtracting integer values from pointers.

  3. What is dynamic memory allocation in C commonly used for?

    Answer: C. Allocating memory at runtime.

  4. How can you declare an array of pointers in C?

    Answer: A. int arr[];*

  5. What is the purpose of function pointers in C?

    Answer: B. To point to the address of a function.

UNIT-III: Strings

  1. Which C library function is used to find the length of a string?

    Answer: A. strlen()

  2. What does the strcat() function do in C?

    Answer: C. Appends one string to the end of another.

  3. How can you compare two strings in C without using the standard library function strcmp()?

    Answer: A. Using a loop and comparing characters.

UNIT-IV: Structures

  1. What is the purpose of a C structure?

    Answer: A. To store multiple values of the same data type.

  2. How do you access fields within a structure in C?

    Answer: A. Using dot notation.

  3. What is a union in C?

    Answer: A. A data structure that holds multiple variables of different types.

UNIT-V: C Preprocessor and Bitwise Operators

  1. What is the purpose of the C preprocessor?

    Answer: C. To handle macro substitution and file inclusion.

  2. Which operator is used for bitwise AND in C?

    Answer: A. &

  3. What is the purpose of shift operators in C?

    Answer: B. To shift bits left or right.

UNIT-VI: File Handling

  1. Which standard function is used to open a file in C?

    Answer: B. fopen()

  2. How do you check if the end of a file has been reached in C?

    Answer: A. Using the feof() function.

  3. Which function is used to read a character from a text file in C?

    Answer: A. fgetc()

Post a Comment

0 Comments