Created
March 14, 2018 15:46
-
-
Save not7cd/85be33585f91cab8a5923aad20b8a445 to your computer and use it in GitHub Desktop.
This file contains 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> | |
#include <string.h> | |
#include <ctype.h> | |
int main() | |
{ | |
char word[80]; | |
int i,n; | |
printf("This program converts words to lower case.\n"); | |
printf("Please write a word: "); | |
scanf("%s",word); | |
printf("Your input is: %s\n",word); | |
n = strlen(word); | |
printf("The length of the word is: %d\n",n); | |
for ( i=0; i<n; i++ ) { | |
word[i] = tolower(word[i]); | |
} | |
printf("Your word in lower case is: %s\n",word); | |
return 0; | |
} |
This file contains 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> | |
#include <string.h> | |
#include <ctype.h> | |
int main() | |
{ | |
char word[80]; | |
char inv[80]; | |
int i,n; | |
printf("This program prints words backward.\n"); | |
printf("Please write a word: "); | |
scanf("%s",word); | |
n = strlen(word); | |
for ( i=0; i<n; i++ ) { | |
inv[i] = word[n-1-i]; | |
} | |
inv[n] = '\0'; | |
printf("Your backward: %s\n",inv); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment