Created
April 23, 2013 16:31
-
-
Save hrshadhin/5445176 to your computer and use it in GitHub Desktop.
Convert String upper and lower case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) | |
{ | |
char str[80]; | |
int i; | |
printf("Enter a string: "); | |
gets(str); | |
for( i = 0;str[i]; i++) | |
str[ i ] = toupper( str[ i ] ); | |
printf("Uppercase String: %s\n", str); /* uppercase string */ | |
for(i = 0; str[ i ]; i++) | |
str[i] = tolower(str[ i ]); | |
printf("Lowercase String: %s\n", str); /* lowercase string */ | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment