nikolas_serafini

Lista 4 - Exercício 17

Jun 22nd, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int i,size = 0;
  6.     char name[40];
  7.  
  8.     printf("Entre com o seu nome :\n");
  9.     gets(name);
  10.     while (name[i++] != '\0')
  11.     {
  12.         if (name[i] != ' ')
  13.         {
  14.             size++;
  15.         }
  16.     }
  17.     printf("%d letras!\n",size);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment