victorialais

Questão 11. Contar os maiores de idade

Aug 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5.  
  6. {
  7.     int numero, idade, i;
  8.  
  9.  
  10.    for (i=0; i<10; i++){
  11.    
  12.     printf("Digite a idade da pessoa: ");
  13.     scanf("%d", &idade);
  14.     if (idade > 17){
  15.         numero++;
  16.        }
  17.    
  18.    
  19.    }
  20.    printf ("numero de pessoas maiores de idade %d: ", numero);
  21.  
  22.  
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment