Advertisement
weldisalves

Lista 04 - exercício 21

Jun 21st, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <ctype.h>
  4. #define MAX 100
  5.  
  6. //21. Solicite o nome do usuário e o exiba convertendo todas as letras para maiúsculo.
  7.  
  8. int main()
  9. {
  10.     char nome[MAX];
  11.     int i;
  12.  
  13.     printf("\n Digite o nome do usuario: ");
  14.     fgets(nome,MAX,stdin);
  15.  
  16.     for(i=0;i<strlen(nome);i++)
  17.     {
  18.         printf("%c",toupper(nome[i]));
  19.     }
  20.  
  21.     getchar();
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement