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.
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.
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.
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.
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.
Bookmarks