0

Is it possible to have a date & time output in C without using Void Main or <time.h>?

4th Dec 2019, 4:08 AM
Gabriel Arguelles
Gabriel Arguelles - avatar
4 Answers
+ 1
Thankyou so much for your response :-)
4th Dec 2019, 6:24 AM
Gabriel Arguelles
Gabriel Arguelles - avatar
+ 1
yes you can. #include <stdio.h> int main() { printf("date = %s\n", __DATE__); printf("time = %s\n", __TIME__); return 0; }
5th Dec 2019, 11:55 AM
Shen Bapiro
Shen Bapiro - avatar
0
Without void main? definitely yes, int main will work, and is one of the standardised signature of main function. Without time.h header? maybe, if you know what to do to access system time. Try to search the net for this topic, I did, but had no luck.
4th Dec 2019, 5:04 AM
Ipang
0
Thank you :-)
7th Dec 2019, 11:55 AM
Gabriel Arguelles
Gabriel Arguelles - avatar