1
0

23-fun-arg.c 260 B

123456789101112131415
  1. #include <stdio.h>
  2. void greet(char *name, char *message) {
  3. if (name == NULL) {
  4. name = "Guest";
  5. }
  6. printf("Hello, %s! %s\n", name, message);
  7. }
  8. int main() {
  9. greet(NULL, "Welcome to the program.");
  10. greet("John", "Nice to meet you.");
  11. return 0;
  12. }