Function calls placed in other functions. - C Function

C examples for Function:Function Definition

Introduction

Uses the same addTwoNumbers() function call inside a printf() function.

Demo Code



#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; 
}

Result


Related Tutorials