Wednesday, 30 November 2011

Trick for Convert lowercase to uppercase

# include <stdio.h>
main ()
{
      char word [20], character;
      int x = 0;
      printf ("Enter a word in lowercase:");
      scanf ("% s", & word);
      while (word [x]! = '\ 0')
      {
            character = words [x];
            if (character> = 'a' & & character <= 'z')
            {
                 character = character-32;
                 word [x] = character;
            }
           x + +;
       }
       printf ("Change to Uppercase:% s \ n", word);
}

No comments:

Post a Comment