A Alvin Le Member Sep 21, 2021 #1 What will be the output of the following C code if the system date is 6/2/2017(Friday)? Code: #include<stdio.h> #include<time.h> int main() { struct tm *local, *gm; time_t t; t=time(NULL); local=localtime(&t); printf("%d",local->tm_wday); return 0; } A. 6 B. 5 C. error D. 0
What will be the output of the following C code if the system date is 6/2/2017(Friday)? Code: #include<stdio.h> #include<time.h> int main() { struct tm *local, *gm; time_t t; t=time(NULL); local=localtime(&t); printf("%d",local->tm_wday); return 0; } A. 6 B. 5 C. error D. 0
K Khang Lê New member Sep 21, 2021 #2 Answer: b Explanation: Since the given question has clearly specified that the current weekday at the time of execution of the code is Friday, the output of the code shown above is 5. (0-Sunday, 1-Mon, 2-Tue, 3-Wed, 4 – Thurs, 5-fri, 6-Sat) Upvote 0 Downvote
Answer: b Explanation: Since the given question has clearly specified that the current weekday at the time of execution of the code is Friday, the output of the code shown above is 5. (0-Sunday, 1-Mon, 2-Tue, 3-Wed, 4 – Thurs, 5-fri, 6-Sat)