0% found this document useful (0 votes)
17 views4 pages

CP Module 3 MCQ

The document consists of a series of multiple-choice questions related to the C programming language, covering topics such as array declarations, function definitions, and initialization methods. It includes questions about syntax for passing arrays to functions, types of functions, and characteristics of pass-by-value. The questions test knowledge on both basic and advanced concepts in C programming.

Uploaded by

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

CP Module 3 MCQ

The document consists of a series of multiple-choice questions related to the C programming language, covering topics such as array declarations, function definitions, and initialization methods. It includes questions about syntax for passing arrays to functions, types of functions, and characteristics of pass-by-value. The questions test knowledge on both basic and advanced concepts in C programming.

Uploaded by

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

1.

Which keyword is used to make the array size optional in C language during array
declaration?
a) auto
b) static
c) extern
d) register
2. 3. Which of the following is the correct syntax to send an array as a parameter to a C
function?
a) Both func(&array) and func(*array);
b) Both func(#array) and func(&array);
c) Both func(array) and func(&array);
d) Both func(array[size]) and func(*array);
3. 4. What are the different ways to initialize an array with all elements as zero?
a) int array[5] = {};
b) int array[5] = {0};
c) int a = 0, b = 0, c = 0;
int array[5] = {a, b, c};
d) All of the mentioned
4. What are the elements present in the array of the following C code ?
int array[5] = {5};
a) 5, 5, 5, 5, 5
b) 5, 0, 0, 0, 0
c) 5, (garbage), (garbage), (garbage), (garbage)
d) (garbage), (garbage), (garbage), (garbage), 5
5. Which of the following declaration is illegal?
a) int a = 0, b = 1, c = 2
int array[3] = {a, b, c};
b) int size = 3;
int array[size];
c) int size = 3;
int array[size] = {1, 2, 3};
d) All of the mentioned
6. An array of similar data types which themselves are a collection of dissimilar data
type are ___________
a) Linked Lists
b) Trees
c) Array of Structure
d) All of the mentioned
7. Comment on an array of the void data type.
a) It can store any data-type
b) It only stores element of similar data type to first element
c) It acquires the data type with the highest precision in it
d) You cannot have an array of void data type
8. An array in C cannot be initialized by which of the following statement?
a) char a[] = “Hello”;
b) char a[6] = {};
c) char a[6] = {0};
d) char a[6]; a = "Hello";
9. Choose correct statement about Functions in C Language.
a) A Function is a group of c statements which can be reused any number of time
b) Every Function has a return type
c) Every Function may no may not return a value
d) All the above
10. A function which calls itself is called a ___ function.
a) Self Function
b) Auto Function
c) Recursive Function
d) Static Function

11. What are the types of functions in C Language?

a) Library Functions
b) User Defined Functions
c) Both Library and User Defined
d) None of the above
12. The keyword used to transfer control from a function back to the calling function is

int **a;

a) switch
b) goto
c) go back
d) return

13. Choose correct statements about C Language Pass By Value.

a) Pass By Value copies the variable value in one more memory location
b) Pass By Value does not use Pointers
c) Pass By Value protects your source or original variables from changes in outside
functions or called functions
d) All the above

14. What is the limit for number of functions in a C Program?

a) 16
b) 31
c) 32
d) No Limit

15. Which of the following is a correct format for declaration of function?


a) return-type function-name(argument type);
b) return-type function-name(argument type){}
c) return-type (argument type)function-name;
d) all of the mentioned

You might also like