C examples for Function:Function Definition
Uses the same addTwoNumbers() function call inside a printf() function.
#include <stdio.h> int addTwoNumbers(int, int); //function prototype int main() { //ww w . ja va 2 s . c om printf("\nThe result is %d", addTwoNumbers(5, 5)); } //function definition int addTwoNumbers(int operand1, int operand2) { return operand1 + operand2; }