fork(1) download
  1. /*
  2.  * hello.c
  3.  *
  4.  * print "Hello World!" on standard output device (console).
  5.  *
  6.  */
  7.  
  8. #include <stdio.h>
  9.  
  10. void toUpperCase(char *p);
  11. void toLowerCase(char *p);
  12.  
  13. int main()
  14. {
  15. char mes1[] = "Hello";
  16. char mes2[] = "World!";
  17.  
  18. toUpperCase(mes1);
  19. toLowerCase(mes2);
  20.  
  21. printf("%s %s\n", mes1, mes2);
  22.  
  23. return 0;
  24. }
  25.  
  26. void toUpperCase(char *p)
  27. {
  28. while (*p != '\0') {
  29. if (('a' <= *p) && (*p <= 'z')) {
  30. *p += 'A' - 'a';
  31. }
  32. p++;
  33. }
  34. }
  35.  
  36. void toLowerCase(char *p)
  37. {
  38. while (*p != '\0') {
  39. if (('A' <= *p) && (*p <= 'Z')) {
  40. *p += 'a' - 'A';
  41. }
  42. p++;
  43. }
  44. }
  45.  
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
HELLO world!