C Mcqs
C Mcqs
C Mcqs
UNIT 1
Answer C
Answer : b
3. Preprocessor Directives are used for –
A] Macro Expansion
B] File Inclusion
C] Conditional Compilation
D] All of these
Answer : D
Answer : B
A. Function
B. Pointer
C. Enumeration
D. Array
Answer : C
6. Which is correct with respect to the size of data types?
B. | (pipeline)
C. - (hyphen)
D. _ (underscore)
Answer: D
Answer: D
Answer: D
Answer: B
Answer. 4 Bytes
3 . #include <stdio.h> is called _______________
Answer: Preprocessor directive
4 . A ______________ is a program , That processes its input data to produce output that is
used as input to another program
Answer: Preprocessor
5. If #include is used with file name in angular brackets _______ is searched for in the
standard compiler include paths.
Answer: file
7. If integer needs two bytes of storage, then maximum value of an unsigned integer is
_______
Answer : 216 – 1
8_______ is the only function all C programs must contain?
Answer: main()
Answer: scope
UNIT 2
a) conditional
b) relational
c) casting operator
d) none of the mentioned
Answer : a
A,+
B. –
C. *
D. %
Answer : D
A] ++
B] %
C] +
D] ||
Answer: C
A] (type)
B] cast()
C] //
D] “ “
Answer: A
6. Which of the following operator takes only integer operands?
A. +
B. *
C /
D. %
Answer: D
Answer:
7. Data type of the controlling statement of a SWITCH statement cannot of the type:
A. int
B. char
C. short
D. float
Answer: D
for(x=0;x=3;x++)
A. four times
B. three times
c. two times
D. never
Answer: D.
B. switch
C. if
D. while
Answer: B
10. The operator & is used for
A] Bitwise AND
B] Bitwise OR
C] Logical AND
D] Logical OR
Answer: A
Answer : Iterative
Answer: Casting
Answer: Logical
9. A _____________ statement is used to choose from multiple possibilities which may arise
due to different values of a single variable
Answer: switch
10. __________ is used inside a loop to terminate the current iteration and start with the next
generation [ ]
Answer: break
UNIT 3
A. Sequential
B. Random
C. Sequential and Random
D. None of the above
Answer : A
C.int n{6} = { 2, 4, 12 };
A. 5
B. 7
C. 9
D. 11
A. 2
B. 8
C. 50
D. Theoratically no limit. The only practical limits are memory size and compilers.
Answer: D
B. It is a declaratrion
C. It is a formal parameter
D. All of these
Answer: D
7. Which of the following correctly accesses the seventh element stored in arr, an array
with 100 elements?
A. arr[6]
B. arr[7]
C. arr{6}
D. arr{7}
A. ‘Hello World’
B. “Hello World”
C. Hello World
D. All of the above
Answer: B
29.
B. 1
C. 2
D. 0
Answer: D
2.. _________________ is the index of the last element of an array with 9 elements ?
Answer : 8
Answer: 40
5. If the size of the array is less than the number of initializers then, _________________
Answer: \0
Answer: 1
UNIT 4
Answer: B
3. What is the built in library function copies the portion of one string into another
string.
A. Strcpy
B. Strncpy
C. Strncat
D. Strtok
Answer: B
5. Any c program
A.call by value
B.call by reference
Answer: A
A.int funct();
Answer: B
A.Parallel order
D. Iterative order
Answer: C
B. 1
C. 0
Answer:D
B. pow(2, x)
C.. pow(x, 2)
D. power(2, x)
Answer:C
3.. A function that calls itself for its processing is known as ______________
4. We declare a function with ______ if it does not have any return type
Answer : void
Answer. Local
6. When a function is recursively called all the automatic variables are stored in
a ..........
Answer: Stack
Answer: double
8.The _____________________ string function adds a string at the end of another string
Answer: Strcat
9. In __________ order actual arguments are evaluated in function call 10 . Arguments
of a functions
Answer: is compiler dependent
are separated
with ------------
UNIT 5
MULTIPLE CH
A.VOID Pointer
B. DANGLING Pointer
C. NULL Pointer
D. WILD Pointer
Answer C
A. Constructor
B. dangling pointer
C. Wild Pointer
D. Destructor
C
4. Which of the following are themselves a collection of different data types?
a) string
b) structures
c) char
d) All of the mentioned
Answer: b
a) –
b) <-
c) .
d) Both (b) and (c)
Answer: C
7. typedef declaration
a) Does not create a new type
b) It merely adds a new name for some existing type.
c) Both a & b
d) None of the mentioned
Answer: c
Answer: C
4. In order to fetch the address of the variable we write preceding _________ sign
before variable name.
Answer: Ampersand
Answer:
9. ___________ is the correct syntax to access the member of the ith structure in the array of
structures is?
Assuming: struct temp
{
int b;
}s[50];
Answer: s[i].b;
10. ___________ is the correct syntax to declare a function foo() which receives an array of
structure in function?