27 day


Calculate the Sum of Numbers

You can put almost whatever you want inside a function. The purpose of the function is to save the code, and execute it when you need it.

Example
void calculateSum() {
  int x = 5;
  int y = 10;
  int sum = x + y;
  printf("The sum of x + y is: %d", sum);
}

int main() {
  calculateSum();  // call the function
  return 0;
}

Comments

Popular posts from this blog