Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int age,years,months,mon,mas,days;
- scanf("%d",&age);
- years = age/365;
- if( years >= 0){
- printf("%d ano(s) \n",years);
- }
- else{
- printf("%d ano(s) \n",years);
- }
- months = (years*365)/30;
- mon = age-(months*30);
- mas = mon/30;
- if( mas <=12 ){
- printf("%d mes(es)\n",mas);
- }
- else{
- printf("%d mes(es)\n",mas);
- }
- days = age-(years*365+mas*30);
- if( days >=0 ){
- printf("%d dia(s)\n",days);
- }
- else{
- printf("%d dia(s)\n",days);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement