Advertisement
diogoAlves

IFF/Introdução à Programação/Slide/Pag 15/Ex 4

Feb 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. //IFF - Introdução à Programação
  2. //Slide - Página 15 - Exercício 4
  3. #include<stdio.h>
  4. #include<locale.h>
  5.  
  6. int main(){
  7.     setlocale(LC_ALL, "Portuguese");
  8.     int ano;
  9.     printf("Entre com seu ano de nascimento: ");
  10.     scanf("%d",&ano);
  11.     if (ano>0){
  12.         printf("Você terá %d anos em 2050!", 2050-ano);
  13.     }else{
  14.         printf("Entre com uma idade válida.")
  15.     }  
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement