Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //IFF - Introdução à Programação
- //Slide - Página 24 - Exercício 2
- #include<stdio.h>
- #include<locale.h>
- int main(){
- setlocale(LC_ALL,"Portuguese");
- int idade;
- printf("Entre com a idade: ");
- scanf("%d",&idade);
- if (idade>=0){
- switch (idade){
- case 0 ... 3:
- printf("Bebê.");
- break;
- case 4 ... 10:
- printf("Criança.");
- break;
- case 11 ... 18:
- printf("Adolescente.");
- break;
- default:
- printf("Adulto.");
- break;
- }
- }else{
- printf("Idade inválida.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment