Advertisement
Guest User

naruto_strings_1.c

a guest
Apr 21st, 2016
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. /**
  2.  * @file naruto_strings_1.c
  3.  * @brief the program scan a word to a string and printf al letters in others lines
  4.  *
  5.  *
  6.  *
  7.  * Version log
  8.  * ------------
  9.  * Version 1 by Naruto, 20.04.2016
  10. */
  11. #include <stdio.h>
  12.  
  13. int main()
  14. {
  15.   char word[] = {0, 0, 0};
  16.   char letter = 0;
  17.  
  18.   printf("enter a word: ");
  19.   scanf("%s", word);
  20.  
  21.   for (letter = 0; letter <= word[letter]; letter++) {
  22.     printf("%c\n", word[letter]);
  23.   }
  24.  
  25.   return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement