C examples for Function:Function Definition
Finding the Greatest Common Divisor and Returning the Results
#include <stdio.h> int gcd (int u, int v){ int temp;//from www .j a va 2 s. c om while (v != 0){ temp = u % v; u = v; v = temp; } return u; } int main (void){ int result; result = gcd (15, 35); printf("%i\n", result); return 0; }