Results 1 to 4 of 4

Thread: How to accept Date of Birth with specific format in C?

  1. #1
    Join Date
    May 2008
    Posts
    68

    How to accept Date of Birth with specific format in C?

    Hi, I want to know how to take any birth date from user in the format at which you want in C programming language? Can anyone suggest me any solution? I want to take value in the format which I want. If you have any code please forward me.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: How to accept Date of Birth with specific format in C?

    Hi, I want to know that in which format you want answer actually. I am not getting the format means. Just make it clear. Are you wanted to take the value of birth date in the format such as 18 November,2009 or in the format such as dd/mm/yyyy ? Just make it clear what you want. I am waiting for your reply. I will reply you immediately, just make me clear what you want exactly. OK.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: How to accept Date of Birth with specific format in C?

    Hello, In which format you want to take output exactly? I am giving you two if you want something different then just reply me. If you want date in the format of 5 November,2008 then you need to use

    int day,month,year;
    scanf("%d %d, %d",&day,&month,&year);


    and if you want date in the format of dd/mm/yyyy then you need to use

    int day,month,year;
    scanf("%d/%d/%d",&day,&month,&year);


    Change it as per your requirement.

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: How to accept Date of Birth with specific format in C?

    Hi, I am providing you the format which you need to change as per your specification as you did not explain the format you want as an output. Just, take a look at the format, understand it and then just try to make it as you want in your output. I will just suggest you understand it, so it will help you to achieve what you want.

    int dd ,mm ,yy;
    scanf("%d %d %d",&dd,&mm,&yy);

    Now you get output depending on what you are taking from the user. If you are getting all numbers then set your variables as int. If you want your month would be displayed as string then set it as string and so.

Similar Threads

  1. How to add birth date details in Nokia E5
    By FunnyBHUSAN in forum Portable Devices
    Replies: 4
    Last Post: 11-04-2011, 10:57 AM
  2. Using date format in JSP
    By KAMANA in forum Software Development
    Replies: 6
    Last Post: 29-07-2010, 10:32 AM
  3. Problem in date format
    By Vodka in forum Software Development
    Replies: 5
    Last Post: 19-02-2010, 04:38 AM
  4. Changing the date format
    By Uzair in forum Customize Desktop
    Replies: 3
    Last Post: 03-04-2009, 12:44 PM
  5. DSQUERY: list users created after a specific date
    By AndieB in forum Active Directory
    Replies: 2
    Last Post: 27-11-2008, 01:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,034,912.02418 seconds with 16 queries