C MCQs for placement and exams - Set 8

C MCQs for placement and exams - Set 8


1.) The compiler will give an error if we attempt to get the address of a varaible with _________ stroage class.
a.) register keyword
b.) extern keyword
c.) static keyword
d.) auto keyword
View Answer / Hide Answer

ANSWER: a.) register keyword




2.)Which of the following is not a stream that is opened by every c program?
a.) stdlog
b.) stdout
c.) stdin
d.) stderr
View Answer / Hide Answer

ANSWER: a.) stdlog




3.) Which of the following best describe volatile keyword?
a.) Volatile keyword indicates that the variable is stored in volatile memory
b.) Volatile keyword indicates that the value of the variable cannot be determined at compile time
c.) Volatile keyword instruct the compiler not to do any optimization on that variable
d.) Volatile keyword indicates that it cannot be used with const keyword
View Answer / Hide Answer

ANSWER: c.) Volatile keyword instruct the compiler not to do any optimization on that variable




4.) Which of the following global variable is set when the log function (defines in ) fails?
a.) exceptionno
b.) errno
c.) log_error
d.) error
View Answer / Hide Answer

ANSWER: b.) errno




5.) According to ANSI specifications which is the correct way of declaring main when it receives command-line arguments?
a.) int main(int argc, char *argv[])
b.) int main(argc, argv)
int argc;
char *argv;
c.) int main()
{
int argc;
char *argv;
}
d.) None of above
View Answer / Hide Answer

ANSWER: a.) int main(int argc, char *argv[])




6.) 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




7.) Which of the following is TRUE about argv?
a.) It is an array of character pointers
b.) It is a pointer to an array of character pointers
c.) It is an array of strings
d.) None of above
View Answer / Hide Answer

ANSWER: a.) It is an array of character pointers




8.) Which of the following statements are FALSE about the below code?

Int main (int ac, char *av[]) { }

a.) ac contains count of arguments supplied at command-line
b.) av[] contains addresses of arguments supplied at a command line
c.) In place of ac and av, argc and argv should be used
d.) The variables ac and av are always local to main()
View Answer / Hide Answer

ANSWER: c.) In place of ac and av, argc and argv should be used




9.) Queue can be used to implement
a.) radix sort
b.) quick sort
c.) recursion
d.) depth first search
View Answer / Hide Answer

ANSWER: a.) radix sort




10.) The depth of a complete binary tree is given by
a.) Dn = n log2n
b.) Dn = n log2n+1
c.) Dn = log2n
d.) Dn = log2n+1
View Answer / Hide Answer

ANSWER: d.) Dn = log2n+1



Post your comment