FranciscoSoccol

Lista 04 - Exercicio 21

Jul 8th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. //Solicite o nome do usuário e o exiba convertendo todas as letras para maiúsculo.
  2. #include<stdio.h>
  3. #define max 100
  4. int main()
  5. {
  6.     int i;
  7.     char nome[max];
  8.     printf("Digite seu nome: ");
  9.     gets(nome);
  10.     //convertendo todas a letras usando tabela ascii
  11.     for(i=0;nome[i]!='\0';i++)
  12.         if(nome[i]>=97 && nome[i]<=122)
  13.             nome[i]=nome[i]-32;
  14.     printf("\n%s",nome);
  15.     getch();
  16. }
Advertisement
Add Comment
Please, Sign In to add comment