A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

1. Which among the following is odd one out?
a. printf
b. fprintf
c. putchar
d. scanf
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).scanf

2. For a typical program, the input is taken using
a. scanf
b. Files
c. Command-line
d. All of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (d).All of the mentioned

3. What does the following command line signify?
prog1|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 Report Discuss Too Difficult!
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 Report Discuss Too Difficult! Search Google
Answer: (b).int

5. The value of EOF is_____
a. -1
b. 0
c. 1
d. 10
View Answer Report Discuss Too Difficult! Search Google
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. The next input character each time it is called EOF when it encounters end of file
d. None of the mentioned
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).The next input character each time it is called EOF when it encounters end of file

7. Which is true?
a. The symbolic constant EOF is defined in <stdio.h>
b. The value is -1
c. The symbolic constant EOF is defined in <stdio.h> & value is -1
d. Only value is -1
View Answer Report Discuss Too Difficult!
Answer: (c).The symbolic constant EOF is defined in <stdio.h> & value is -1

8. What is the return value of putchar()?
a. The character written
b. EOF if an error occurs
c. Nothing
d. Both character written & EOF if an error occurs
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).Both character written & EOF if an error occurs

9. Which is true about function tolower?
a. The function tolower is defined in
b. Converts an upper case letter to lower case
c. returns other characters untouched
d. None of the mentioned
View Answer Report Discuss Too Difficult! Search Google
Answer: (d).None of the mentioned

10. What is the output of this C code?
#include <stdio.h>
    int main()
    {
        char c = '�';
        putchar(c);
    }
a. Compile time error
b. Nothing
c. 0
d. Undefined behaviour
View Answer Report Discuss Too Difficult!
Answer: (b).Nothing

Page 1 of 36