Advertisement
d3dx939dll

Usando - IF

Dec 16th, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. /*
  2. usando o if kkk
  3. */
  4. #include <stdio.h>
  5. int main()
  6.     {
  7.         int numero = 1;
  8.         int var = 0;
  9.  
  10.         printf("Escolha: \n1 - For\n2 - While\n3 - Sair\n");
  11.         printf("Opcao: ");
  12.         scanf("%i", &var);
  13.  
  14.         if(var == 1){
  15.             for(numero = numero ; numero <= 10; numero = numero + 1){
  16.                 printf("FOR: %i\n", numero);
  17.  
  18.             }
  19.         }
  20.         if(var == 2){
  21.             while(numero <= 10){
  22.                 printf("While: %i\n", numero);
  23.                 ++numero;
  24.             }
  25.         }
  26.         if(var == 3){
  27.             printf("\nSaindo, Fodase...\n");
  28.         }
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement