Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int currentyear,birthyear,age;
- printf("Entre com o ano de seu nascimento:\n"); scanf("%d",&birthyear);
- printf("Entre com o ano atual:\n"); scanf("%d",¤tyear);
- age = currentyear - birthyear;
- if(age<0)
- {
- printf("ERRO : Ano atual antecede nascimento!\n");
- return 0;
- }
- printf("Voce tem %d ano(s) de idade!\n",age);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment