C MCQs for placement and exams - Set 1

C MCQs for placement and exams - Set 1


1.) What do the 'c' and 'v' in argv stands for?
a.) 'c' means argument control 'v' means argument vector
b.) 'c' means argument count 'v' means argument vertex
c.) 'c' means argument count 'v' means argument vector
d.) 'c' means argument configuration 'v' means argument visibility
View Answer / Hide Answer

ANSWER: c.) 'c' means argument count 'v' means argument vector




2.) What do the following declaration signify?

int (*pf)();

a.) pf is a pointer to function
b.) pf is a function pointer
c.) pf is a pointer to a function which return int
d.) pf is a function of pointer variable
View Answer / Hide Answer

ANSWER: c.) pf is a pointer to a function which return int




3.) What do the following declaration signify?

void *cmp();

a.) cmp is a pointer to an void type
b.) cmp is a void type pointer variable
c.) cmp is a function that return a void pointer
d.) cmp function returns nothing
View Answer / Hide Answer

ANSWER: c.) cmp is a function that return a void pointer




4.) In which numbering system can the binary number 1011011111000101 be easily converted to?
a.) Decimal system
b.) Hexadecimal system
c.) Octal system
d.) No need to convert
View Answer / Hide Answer

ANSWER: b.) Hexadecimal system




5.) Which bitwise operator is suitable for turning off a particular bit in a number?
a.) && operator
b.) & operator
c.) || operator
d.) ! operator
View Answer / Hide Answer

ANSWER: b.) & operator




6.) Which header file should be included to use functions like malloc() and calloc()?
a.) memory.h
b.) stdlib.h
c.) string.h
d.) dos.h
View Answer / Hide Answer

ANSWER: b.) stdlib.h




7.) What function should be used to free the memory allocated by calloc() ?
a.) dealloc();
b.) malloc(variable_name, 0)
c.) free();
d.) memalloc(variable_name, 0)
View Answer / Hide Answer

ANSWER: c.) free();




8.) What is the similarity between a structure, union and enumeration?
a.) All of them let you define new values
b.) All of them let you define new data types
c.) All of them let you define new pointers
d.) All of them let you define new structures
View Answer / Hide Answer

ANSWER: b.) All of them let you define new data types




9.) Does there any function exist to convert the int or float to a string?
a.) Yes
b.) No
View Answer / Hide Answer

ANSWER: a.) Yes




10.) What is the purpose of fflush() function.
a.) flushes all streams and specified streams
b.) flushes only specified stream
c.) flushes input/output buffer
d.) flushes file buffer
View Answer / Hide Answer

ANSWER: a.) flushes all streams and specified streams


Post your comment