Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function arguments and return values in C
#1
Functions can take arguments as input and return values as output.

int square(int num) {
    return num * num;
}

int result = square(5);
printf("Result: %d\n", result); // Output: 25
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Not checking return values in C Qomplainerz 0 201 07-26-2023, 07:12 AM
Last Post: Qomplainerz
  Command-Line Arguments in C Qomplainerz 0 286 07-25-2023, 01:27 PM
Last Post: Qomplainerz
  Function prototypes in C Qomplainerz 0 248 07-25-2023, 11:02 AM
Last Post: Qomplainerz

Forum Jump:


Users browsing this thread: 8 Guest(s)