Thursday, 3 May 2012

Lowercase to Uppercase in C


#include<stdio.h>
#include<ctype.h>
#define END '\n'

main()
{
      char string[80];
      int X,c=1;
      
      do ++c;
      while((string[c]=getchar())!= END);
      X=c;
      
      c=0;
      
      do
      {
              putchar(toupper(string[c]));
              ++c;
      } while(c<X);
      getch();
}

No comments:

Post a Comment