C MCQs for placement and exams - Set 5

C MCQs for placement and exams - Set 5


1.) Which among the following is odd one out?
a.) printf
b.) fprintf
c.) putchar
d.) scanf
View Answer / Hide Answer

ANSWER: d.) scanf




2.) For a typical program, the input is taken using.
a.) scanf
b.) Files
c.) Command-line
d.) None of the mentioned
View Answer / Hide Answer

ANSWER: d.) None of the mentioned




3.) What does the following command line signify? prog1I prog2
a.) It runs prog1 first, prog2 second
b.) It runs prog2 first, prog1 second
c.) It runs both the programs, pipes output of prog1 to input of prog2
d.) It runs both the programs, pipes output of prog2 to input of prog1
View Answer / Hide Answer

ANSWER: c.) It runs both the programs, pipes output of prog1 to input of prog2




4.) What is the default return-type of getchar()?
a.) char
b.) int
c.) char *
d.) Reading character doesn't require a return-type
View Answer / Hide Answer

ANSWER: b.) int




5.) The value of EOF is_____.
a.) -1
b.) 0
c.) 1
d.) 10
View Answer / Hide Answer

ANSWER: a.) -1




6.) What is the use of getchar()?
a.) The next input character each time it is called
b.) EOF when it encounters end of file
c.) Both a & b
d.) None of the mentioned
View Answer / Hide Answer

ANSWER: c.) Both a & b




7.) Which is true?
a.) The symbolic constant EOF is defined in 
b.) The value is typically -1,
c.) Both a & b
d.) Either a or b
View Answer / Hide Answer

ANSWER: c.) Both a & b




8.) What is the use of putchar()?
a.)The character written
b.) EOF is an error occurs
c.) Nothing
d.) Both a & b
View Answer / Hide Answer

ANSWER: d.) Both a & b




9.) The size of string variable is:
a.) 1 byte
b.) 8 byte
c.) 16 bytes
d.) none of the above
View Answer / Hide Answer

ANSWER: d.) none of the above




10.) The continue command cannot be used with:
a.) for
b.) switch
c.) do
d.) while
View Answer / Hide Answer

ANSWER: b.) switch



Post your comment