Advertisement
diegomrodrigues

Exibição de letras

Apr 19th, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. /*
  2. Exemplo de exercício em Linguagem C
  3. Diego Mendes Rodrigues
  4. */
  5. #include <stdio.h>
  6. #include <string.h>
  7.  
  8. int main(void)
  9. {
  10.     int index = 0;
  11.     char letras[5] = "Joao";
  12.  
  13.     for (int contador=1; contador<=(strlen(letras)*5); contador++)
  14.     {
  15.         printf("\n %c", letras[index]);
  16.  
  17.         if (contador % 5 == 0)
  18.         {
  19.             if (index ==3)
  20.                 index=0;
  21.             else
  22.                 index++;
  23.         }
  24.     }
  25.     printf("\n\n");
  26.     //system("pause");
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement