FranciscoSoccol

Lista 08 - Exercicio 09(forma 02)

Aug 12th, 2013
43
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. #define MAX 100
  3. //prototipo
  4. void maiuscula(char *s);
  5. int main()
  6. {
  7.     char s[MAX];
  8.     printf("Digite a palavra: ");
  9.     gets(s);
  10.     maiuscula(s);
  11.     printf("Palavra: %s\n",s);
  12.     return 0;
  13. }
  14. void maiuscula(char *s)
  15. {
  16.     char *aux;
  17.     int i;
  18.     aux=s;
  19.     for(i=0;s[i]!='\0';i++)
  20.     {
  21.         if(aux[i]>='a' && aux[i]<='z')
  22.             aux[i]=aux[i]-('a'-'A');
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment