diogoAlves

IFF/Introdução à Programação/Slide/Pag 24/Ex 1

Feb 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. //IFF - Introdução à Programação
  2. //Slide - Página 24 - Exercício 1
  3. #include<stdio.h>
  4. #include<locale.h>
  5.  
  6. int main(){
  7.     setlocale(LC_ALL,"Portuguese");
  8.     int nota;
  9.     printf("Entre com sua nota (base 100): ");
  10.     scanf("%d",&nota);
  11.     printf("Seu conceito foi: ");
  12.     switch (nota){
  13.         case 0 ... 49:
  14.             printf("D");
  15.         break;
  16.         case 50 ... 69:
  17.             printf("C");
  18.         break;
  19.         case 70 ... 89:
  20.             printf("B");
  21.         break;
  22.         case 90 ... 100:
  23.             printf("A");
  24.         break;
  25.         default:
  26.             printf("Valor inválido.");
  27.         break;
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment