Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define MAX 100
- //21. Solicite o nome do usuário e o exiba convertendo todas as letras para maiúsculo.
- int main()
- {
- char nome[MAX];
- int i;
- printf("\n Digite o nome do usuario: ");
- fgets(nome,MAX,stdin);
- for(i=0;i<nome[i]!='\0';i++)
- {
- if (nome[i]>=97)
- printf("%c",nome[i]-('a'-'A'));
- else
- printf("%c",nome[i]);
- }
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement