Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Language%20in%20C%20Interview%20Questions%20and%20Answers

Question: How to set the system date through a C program ?

Answer: We can set the system date using the setdate( ) function as shown in the following program. The function assigns the current time to a
structure date.

#include "stdio.h"
#include "dos.h"

main( )
{
struct date new_date ;

new_date.da_mon = 10 ;
new_date.da_day = 14 ;
new_date.da_year = 1993 ;

setdate ( &new_date ) ;
}
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook