Encoders
  Home  Forum  Guestbook  Email Us  About Us  Links  More Hub for Computer Whizzes Register to join us

C
C++
Security
Miscellaneous
Encoders > More... > C > Program 47

<< Previous  Next >>


/* Program that converts upper case to lower or lower case to
   upper, depending on the name it is invoked with. */

#include <stdio.h>
#include <string.h>
#include <ctype.h>

main(int argc, char *argv[])
{
	int c;
        if(strcmp(argv[0],"lower")==0)
		while((c=getchar())!=EOF)
			putchar(tolower(c));
	else
		while((c=getchar())!=EOF)
			putchar(toupper(c));
}

 

encoders.20m.com - hosted at 20m.com
Site design and development by Susam Pal
-----------------------------------------------------