1. ## age calculator... :/

Create a program that asks a user of his date of birth, example DECEMBER 11 1977.
The program will then calculate his current age. From the example, if the input is
DECEMBER 11 1977 then the output is 33 years and 8 months.

#include<stdio.h> only... ty ^_^

im just a beginners... help me please

2. Welcome to the forum, Mikko!

There's more than one way to do this, did your instructor or book, have a preference?

And please, always use the # icon in the advanced editor window to put your code between code tags - otherwise your code is changed to text format, and becomes difficult to study.

3. One way I know of for doing this requires that you know how many days are in every month (including the system for February). From this, it's possible to get age down to the second, even if referring to the age of the USA (you'll need a 64-bit integer for that one). It's mostly just a loop and multiplying. This is as far as I'll get into the details.

4. Originally Posted by mikko93
Create a program that asks a user of his date of birth, example DECEMBER 11 1977.
The program will then calculate his current age. From the example, if the input is
DECEMBER 11 1977 then the output is 33 years and 8 months.

#include<stdio.h> only... ty ^_^

im just a beginners... help me please
How about I give you some help that will stay with your forever...

Simply this... As my .sig notes every program no matter how simple or complex follows the same 4 basic steps...

1) Analyse the problem or requirement until you understand it well enough to solve it.

2) Spend some time planning your solution, blocking out what your code has to do, try different ways see if you can find an "easy way".

3) Write your code, working in small steps, doing quick compiles and checks as you go.

4) Test the code, make sure it's doing what you want/need and fix any problems you find.

Right now you are at part 1 of this process... so think about the problem...

What are you being asked to do?

What do you actually need to calculate?
Do you need hours, minutes and seconds?
Do you need to worry about changes of century?
Do leap years matter?

Perhaps the second most deflating lesson new programmers learn --right after "'Compiles' does not mean 'Works'"-- is that no programmer no matter how skilled or experienced can ever code the solution to a problem he or she does not understand... Writing code is only a small part of the actual programmer's skillset.

Hint: Based on your description, you should be able to solve this problem in less than 50 lines of code.