C Program to find day of week given date

后端 未结 14 1371
梦谈多话
梦谈多话 2020-11-29 05:14

Is there a way to find out day of the week given date in just one line of C code?

For example

Given 19-05-2011(dd-mm-yyyy) gives me Thursday

14条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 05:14

    Not in one line of code, there's nothing for dealing with dates in the C standard library. It would be fairly simple to write a function based on the Doomsday algorithm, or similar, though.

提交回复
热议问题