Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define MAX 100
- int main() {
- char str[MAX];
- printf("Entre com um nome:");
- gets(str);
- int i;
- for(i=0; str[i]!='\0'; i++)
- if(str[i]>='a' && str[i]<='z')
- // a diferença 'a'-'A' corresponde a distância entre maiúsculos e minúsculos na tabela
- str[i] = str[i] - ('a'-'A');
- printf("Nome maiusculo: %s", str);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement