nikolas_serafini

Lista 1 - Exercício 12

May 21st, 2013
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int years,months,days,lifedays;
  7.  
  8.     printf("Entre com a sua idade expressa em anos, meses e dias, respectivamente:\n");
  9.     scanf("%d %d %d",&years,&months,&days);
  10.  
  11.     lifedays = days + (months*30) + (years*365);
  12.  
  13.     printf("Voce esta a %d dias vivo!\n",lifedays);
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment