Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Solicite o nome do usuário e o exiba convertendo todas as letras para maiúsculo.
- #include<stdio.h>
- #define max 100
- int main()
- {
- int i;
- char nome[max];
- printf("Digite seu nome: ");
- gets(nome);
- //convertendo todas a letras usando tabela ascii
- for(i=0;nome[i]!='\0';i++)
- if(nome[i]>=97 && nome[i]<=122)
- nome[i]=nome[i]-32;
- printf("\n%s",nome);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment