fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main() {
  5. char str[100];
  6.  
  7. // Input a string from the user
  8. printf("Enter a string: ");
  9. fgets(str, sizeof(str), stdin);
  10.  
  11. // Remove newline character from the string if present
  12. str[strcspn(str, "\n")] = '\0';
  13.  
  14. // Convert the string to lowercase
  15. tolower(str);
  16.  
  17. // Print the converted string
  18. printf("Lowercase string: %s\n", str);
  19.  
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 5284KB
stdin
 
stdout
Enter a string: Lowercase string: