Advertisement
bertao

idade com if

Apr 3rd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include<stdio.h>
  2. int main (void){
  3. int idade;
  4. printf("idade:",idade);
  5. scanf("%d",&idade);
  6. if(idade <= 2){
  7. printf("bebe!");
  8. }
  9. if((idade>2)&&(idade<=12)){
  10. printf("pia");
  11. }
  12. if((idade>12)&&(idade<18)){
  13. printf("adolescente");
  14. }
  15. if((idade>=18)&&(idade<70)){
  16. printf("adulto");
  17. }
  18. return 0;
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement