Let’s understand some concept.
By this codes you can find or calculate your age (years, months & days ). If you want to understand the concept then read carefully and then use. According to “permutations and combination”. In your date of birth & current date, even your
- DOB date is smaller than current date & DOB month is smaller than current month. (current date 20/04/2020 & DOB 15/03/1998)
- DOB date is larger than current date and DOB Month is smaller than current month. (DOB 25/03/1998 & current date 20/04/2020)
- DOB date is smaller than current date & DOB month is larger than current month.(DOB 15/06/1998 & current date 20/04/2020)
- DOB date is larger than current date & DOB month is larger than current month. (DOB 25/06/1998 & current date 20/04/2020)
So, there are four possibilitie in which your date of birth and current date depend. That condition occurs, are explain above with possible examples.


Some important symbols used in code.
- () small bracket
- && use for ‘and’ use for address
- {} curly bracket
- “” double code
- #include<studio.h>
- #include<conio.h>
- Void main()
- int a, b, c, d, e, f, g, h,I, j, k;
- clrscr();
- printf(“Enter your date of Birth in format of DD/MM/YYYY”);
- Scanf(“%d%d%d”, &a, &b, &c);
- printf(“Enter your current Date in format of DD/MM/YYYY”);
- Scanf(“%d%d%d”, &d, &e, &f);
- If(a<d&&b<e)
- {
- i=d-a;
- j=e-b;
- k=f-c;
- printf(“%d Years %d Months %d Days”, k, j, i);
- }
- else if(d<a&&b<e)
- {
- i=(d+30)-a;
- j=(e-1)-b;
- k=f-c;
- prinf(“%d Years %d Months %d Days”, k, j, i);
- }
- If(a<d&&e<b)
- {
- i=d-a;
- j=(e+12)-b;
- k=(f-1)-c;
- printf(“%d Years %d Months %d Days”);
- }
- else if(d<a&&e<b)
- {
- i=(d+30)-a;
- j=(e+23)-b;
- k=(f-1)-c;
- printf(“%d Years %d Months %d Days”, k, j, i);
- }
- getch();
- }

Input
Take any example : date of birth: 29/03/1998 current date:20/04/2020
Results or output
22Years 0month 21days


