fork download
  1. #include <stdio.h>
  2. #include <ctype.h>
  3.  
  4. int main(void) {
  5. char s[100];
  6. printf("Enter a line of text: ");
  7. fgets(s, sizeof(s), stdin);
  8.  
  9. printf("\nUppercase: ");
  10. for (int i = 0; s[i] != '\0'; i++) {
  11. putchar(toupper((unsigned char)s[i]));
  12. }
  13.  
  14. printf("Lowercase: ");
  15. for (int i = 0; s[i] != '\0'; i++) {
  16. putchar(tolower((unsigned char)s[i]));
  17. }
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
Enter a line of text: 
Uppercase: ɯV��Lowercase: ɯv��