CSE101: C Programming MCQ - Unit-Wise 120 Question Paper Download

Utilise our thorough C Programming MCQ test bank to prepare for your CSE101 class. This downloaded question paper is a great tool for exam preparation because it was created to evaluate your knowledge and comprehension of basic C programming topics. Investigate a variety of multiple-choice inquiries on subjects like variables, data kinds, control structures, functions, and more. To succeed in CSE101, download the question paper right now and practise your C programming.

Unit I Basics and introduction to C

Download Link Given Below

1.       What is the character set used in C programming language?

a) ASCII

b) Unicode

c) EBCDIC

d) ISO-8859-1

Answer: a) ASCII

 

2.       Which of the following is a valid identifier in C?

a) 2variable

b) _myVariable

c) break

d) float

Answer: b) _myVariable

 

3.       Which of the following is not a valid data type in C?

a) int

b) boolean

c) char

d) double

Answer: b) boolean

 

4.       What is the size of the 'int' data type in bytes on most modern compilers?

a) 2

b) 4

c) 8

d) It varies depending on the compiler

Answer: b) 4


Unit II Control structures and Input/Output functions

1.       Which control structure is used to execute a block of code repeatedly as long as a given condition is true?

a) If statement

b) Switch statement

 

c) While loop

d) For loop

Answer: c) While loop

 

2.       What will be the output of the following code snippet?

int x = 10;

if (x > 5) {

    printf("Hello");

}

a) Hello

b) Nothing will be printed

c) Error

d) Undefined

Answer: a) Hello

 

3.       Which control structure allows the execution of multiple cases based on the value of an expression?

a) If statement

b) If-else statement

c) Switch statement

d) For loop

Answer: c) Switch statement

 

4.       What will be the output of the following code snippet?

int x = 3;

switch (x) {

    case 1:

        printf("One");

        break;

    case 2:

        printf("Two");

        break;

    default:

        printf("Default");

}

a) One

b) Two

c) Default

d) Nothing will be printed

Answer: c) Default


Unit III User defined functions and Storage classes

1.       What is a function prototype in C?

A. A declaration of a function before it is defined

B. A definition of a function before it is declared

C. A function that takes no arguments

D. A function that returns no value

Answer: A

 

2.       Which of the following is the correct syntax for a function definition in C?

A. int function_name(parameters) { // code }

B. function_name(int parameters) { // code }

C. void function_name() { // code }

D. function_name { // code }

Answer: A

 

3.       What is a function call in C?

A. The place where a function is defined

B. The place where a function is declared

C. The place where a function is called from another function

D. The place where a function is called with arguments

Answer: D

 

4.       What is the difference between passing arguments by value and passing arguments by reference in C?

A. Passing by value makes a copy of the argument, passing by reference does not

B. Passing by reference makes a copy of the argument, passing by value does not

C. Both passing by value and passing by reference make a copy of the argument

D. Neither passing by value nor passing by reference makes a copy of the argument

Answer: A


Unit IV Pointers in C

1.       What is a pointer?

a. A variable that stores the address of another variable

b. A variable that stores the value of another variable

c. A variable that stores both the address and value of another variable

d. A variable that cannot store any value

Answer: a.

 

2.       Which operator is used to access the value at the address stored in a pointer?

a. *

b. &

c. $

d. %

Answer: a.

 

3.       What is the result of adding an integer to a pointer?

a. A pointer

b. An integer

c. A character

d. None of the above

Answer: a.

 

4.       Which of the following is not a valid pointer arithmetic operation?

a. Addition of a pointer and an integer

b. Subtraction of two pointers

c. Multiplication of a pointer and an integer

d. Division of a pointer and an integer

Answer: d.


Unit V Dynamic Memory Management

1.      Which function is used to dynamically allocate memory in C?

a) malloc()

b) calloc()

c) realloc()

d) free()

Answer: a) malloc()

 

2.      What is the return type of the malloc() function in C?

a) void

b) int

c) float

d) void*

Answer: d) void*

 

3.      Which function is used to dynamically allocate memory for an array of elements in C?

a) malloc()

b) calloc()

c) realloc()

d) free()

Answer: b) calloc()

 

4.      What is the return type of the calloc() function in C?

a) void

b) int

c) float

d) void*

Answer: d) void*


Unit VI Strings, Derived types including structures and unions

1.      In C programming, a string is:

a) A data type

b) An array of characters

c) A structure

d) A pointer

Answer: b) An array of characters

 

2.      How do you declare and initialize a string in C?

a) string s = "Hello";

b) char s = "Hello";

c) char s[] = "Hello";

d) string s[5] = "Hello";

Answer: c) char s[] = "Hello";

 

3.      What is the ASCII value of the character 'A' in C?

a) 64

b) 65

c) 66

d) 67

Answer: b) 65

 

4.      Which library function is used to calculate the length of a string in C?

a) strlen()

b) strcpy()

c) strcat()

d) strcmp()

Answer: a) strlen()


With our painstakingly created C Programming MCQ question paper, you may efficiently prepare for your CSE101 course. This thorough resource aims to evaluate your understanding of fundamental C programming ideas and provide you the tools you need to ace your tests.

You will discover a wide variety of multiple-choice questions covering important subjects including variables, data kinds, control structures, and functions in this downloaded exam paper. The meticulous design of each question will test your comprehension and problem-solving capabilities, ensuring a complete assessment of your C programming ability.


Post a Comment (0)
Previous Post Next Post