Explore topic-wise MCQs in C Interview.

This section includes 25 Mcqs, each offering curated multiple-choice questions to sharpen your C Interview knowledge and support exam preparation. Choose a topic below to get started.

1.

What will be the output of the following C code if the name entered is “TOM” and time taken to enter this name is 2 seconds?

A. Error
B. 2
C. 2.0
D. 2.00View Answer
Answer» E.
2.

The library function clock() returns the number of _________ elapsed since the start of the program.

A. minutes
B. clock ticks
C. milli-seconds
D. micro-seconds
Answer» C. milli-seconds
3.

The value of tm_isdst is ____ when DST( Daylight Savings Time) is in effect, ______ when DST is not in effect and ______ when the DST status is unknown.

A. -1, 1, 0
B. 1, 0, -1
C. 0, 1, -1
D. 1, -1, 0
E. is in effect, ______ when DST is not in effect and ______ when the DST status is unknown.a) -1, 1, 0b) 1, 0, -1c) 0, 1, -1d) 1, -1, 0
Answer» C. 0, 1, -1
4.

What will be the output of the following C code if the system date is 6/2/2017 (Friday)?

A. Error
B. Fri
C. Friday
D. 6View Answer
Answer» D. 6View Answer
5.

What will be the output of the following C code if the system date is 8/22/2016?

A. 9
B. August
C. Aug
D. ErrorView Answer
Answer» C. Aug
6.

What will be the output of the following C code if the system time is 4:27 PM?

A. 16 27 minutes
B. 4 27 minutes
C. 16 PM 27 minutes
D. 4 PM 27 minutesView Answer
Answer» D. 4 PM 27 minutesView Answer
7.

Which of the following format specifiers is used to represent the name of the time zone?

A. %A
B. %B
C. %H
D. %Z
Answer» E.
8.

Which of the following is defined under the header file time.h?

A. strnct()
B. fabs()
C. iscntrl()
D. null
Answer» E.
9.

The value returned by the library function mktime(), on failure is _________

A. -1
B. 0
C. 1
D. -2
Answer» B. 0
10.

What will be the output of the following C code?

A. 12
B. -12.00
C. Error
D. 12View Answer
Answer» C. Error
11.

Which of the following format specifiers is used to represent the hours in the 24 hour clock (0-23) format?

A. %I
B. %H
C. %i
D. %h
Answer» C. %i
12.

What will be the output of the following C code if the system time is 1:52 PM (Sunday)?

A. 13
B. 01
C. 1
D. errorView Answer
Answer» C. 1
13.

The following C code results in an error. State whether true or false.

A. True
B. FalseView Answer
Answer» C.
14.

What is the meaning of the following C code if output is 0?

A. DST is in effect
B. DST status is unknown
C. DST is not in effect
D. DST is corresponding with local timeView Answer
Answer» D. DST is corresponding with local timeView Answer
15.

What will be the output of the following C code, if the system date is 6/24/2017?

A. Error
B. Junk value
C. 6
D. JuneView Answer
Answer» C. 6
16.

What will be the output of the following C code, if the system date is 6/23/2017?

A. 6
B. 22
C. 23
D. errorView Answer
Answer» D. errorView Answer
17.

THE_PURPOSE_OF_THE_FUNCTION_CTIME()_IS_THAT____________?$

A. it returns a string representing the local time
B. it returns a void string
C. it returns a string representing the time in UTC format
D. it returns a string representing the time stored in a structure
Answer» C. it returns a string representing the time in UTC format
18.

Which of the following functions is used to convert the date and time into a calendar format?

A. difftime()
B. clock()
C. mktime()
D. ctime()
Answer» C. mktime()
19.

Which of the following format specifiers is used to specify whether the given time is in AM or PM?

A. %P
B. %I
C. %X
D. %p
Answer» B. %I
20.

Which of the following library functions is used to read location dependent information?

A. localtime()
B. localeconv()
C. localcon()
D. local()
Answer» C. localcon()
21.

17

A. 2017
B. error
C. 117
Answer» B. error
22.

DST is in effect

A. DST status is unknown
B. DST is not in effect
C. DST is corresponding with local time
Answer» C. DST is corresponding with local time
23.

16 27 minutes

A. 4 27 minutes
B. 16 PM 27 minutes
C. 4 PM 27 minutes
Answer» C. 4 PM 27 minutes
24.

only current date

A. only current date and current time
B. current date, current time and the day of the week
C. only current time
Answer» C. only current time
25.

6

A. 22
B. 23
C. error
Answer» C. error