Date & Time Function MCQ Questions

This section focuses on the "Date and Time Function" in C programming. These Multiple Choice Questions (MCQ) should be practiced to improve the C programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

1. ____________ in C are used to interact with system time routine and formatted time outputs are displayed

A. Ceil function
B. Time functions
C. Measure function
D. Hour function

View Answer


2. Which function used to modify the system date?

A. getdate
B. clock
C. setdate
D. mktime

View Answer


3. What is true about strftime function?

A. This function is used to get current system time as structure
B. This function is used to get the difference between two given times
C. This function interprets tm structure as calendar time
D. This function is used to modify the actual time format

View Answer


4. The time() function is defined in __________ header file.

A. ctime.h
B. time.h
C. clock.h
D. date.h

View Answer


5. Which of the following library functions returns the time in UTC (Greenwich mean time) format?

A. localtime()
B. gettime()
C. gmtime()
D. settime()

View Answer


6. asctime() structure contents are interpreted by this function as calendar time.

A. Yes
B. No
C. Can be yes or no
D. Can not say

View 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

View Answer


8. 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

View Answer


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

A. %q
B. %p
C. %Q
D. %P

View Answer


10. mktime() function interprets tm structure as calendar time.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer






Discussion


* You must be logged in to add comment.