Advertisement
weldisalves

Lista 04 - exercício 31

Jun 21st, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #define MAX 1000
  4.  
  5. /* 31. Após a entrada do nome do usuário, exiba-o em formato vertical.
  6. Exemplo de entrada: Robin
  7. Saída:
  8. R
  9. o
  10. b
  11. i
  12. n */
  13.  
  14. int main()
  15. {
  16.     char nome[MAX];
  17.     int i;
  18.  
  19.     printf("\n Digite o nome do usuario: ");
  20.     scanf("%s",nome);
  21.  
  22.     for(i=0;i<strlen(nome);i++)
  23.     {
  24.         printf("%c\n",nome[i]);
  25.     }
  26.  
  27.     getchar();
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement