main ()
{
int a; // Dabartine data
int b; // Gimimo data
int c;
printf("Iveskite dabartine data formatu yymmdd:");
scanf("%d", &a);
printf("Iveskite savo gimimo data formatu yymmdd:");
scanf("%d", &b);
c = a - b;
printf("Jusu amzius yra %d metai", c);
return 0;
}
Could someone tell me how to make that in the end the result would be only 2 digits? It is a code to calculate your age accordingly to current date and date of birth. The answer is in yymmdd format and I need to remove the mmdd part and leave only the year part, for example: it prints 180602, and I only need to leave 18(it is the age of person)