Jump to content

Date Format In Basic C Language ?

- - - - -

  • Please log in to reply
4 replies to this topic

#1
SlimShady

SlimShady

    Newbie

  • Members
  • Pip
  • 6 posts
What method can I use to develop a simple C program to display the date entered (mm/dd/yy): 22/2/43
into the following format: This is the 22nd Day of February 1943?
Do I need selections statements ?

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
http://www.java2s.co....h/strftime.htm
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
SlimShady

SlimShady

    Newbie

  • Members
  • Pip
  • 6 posts
@Nullw0rm .. Thank you very much , but is there another simple method to do it ?..I don't want to use strings.. Thanks again

#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
I would question how you would work with strings without working with strings.. Do you mean separate input, i.e. 3 integers (not a string) and you get what you want out of that? A switch/case statement would work on this, but you would need to append to a string each time you find the proper format (such as 22 into 22nd (an ordinal index), 2 into febuary (12 case statements), xx43 into 1943).

I'm not sure why you would not use it if it was the only logical choice (unless it is for an acedemic reason, an assignment, in that case you should state it)
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#5
SlimShady

SlimShady

    Newbie

  • Members
  • Pip
  • 6 posts

Nullw0rm said:

I would question how you would work with strings without working with strings.. Do you mean separate input, i.e. 3 integers (not a string) and you get what you want out of that? A switch/case statement would work on this, but you would need to append to a string each time you find the proper format (such as 22 into 22nd (an ordinal index), 2 into febuary (12 case statements), xx43 into 1943).

I'm not sure why you would not use it if it was the only logical choice (unless it is for an acedemic reason, an assignment, in that case you should state it)

lol ! you've caught me :D.it is an assignment and the problem that we did not take strings yet so I was wondering if it will work without it. B.T.W i gonna study strings by myself and try to do it .Thanks very much for your time , I appreciate.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users