Advertisement
weldisalves

Lista 04 - exercício 23

Jun 21st, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1.  
  2.     #include <stdio.h>
  3.     #include <string.h>
  4.     #include <ctype.h>
  5.     #define MAX 1000
  6.  
  7.     //21. 23. Transforme uma frase que o usuário digitou para maiúsculo. Suponha que na frase somente tenha letras
  8. //minúsculas e espaços em branco.
  9.  
  10.     int main()
  11.     {
  12.         char frase[MAX];
  13.         int i;
  14.  
  15.         printf("\n Digite uma frase: ");
  16.         fgets(frase,MAX,stdin);
  17.  
  18.         for(i=0;i<strlen(frase);i++)
  19.         {
  20.             printf("%c",toupper(frase[i]));
  21.         }
  22.  
  23.         getchar();
  24.         return 0;
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement