C Programming Code Examples C > Functions Code Examples How to call a function in C? How to call a function in C? A function is a block of statements that performs a specific task. Suppose you are building an application in C language and in one of your program, you need to perform a same task more than once. Creating a user defined function addition() #include <stdio.h> int addition(int number1, int number2) { int sum; /* Arguments are used here*/ sum = number1+number2; /* Function return type is integer so we are returning * an integer value, the sum of the passed numbers. */ return sum; } int main() { int var1, var2; printf("Enter number 1: "); scanf("%d",&var1); printf("Enter number 2: "); scanf("%d",&var2); /* Calling the function here, the function return type * is integer so we need an integer variable to hold the * returned value of this function. */ int res = addition(var1, var2); printf ("Output: %d", res); return 0; }