C examples for Function:Function Return
Using multiple return statements in a function.
#include <stdio.h> int x, y, z;/*from w ww . j a v a 2 s. c o m*/ int larger_of( int a, int b); int main( void ) { puts("Enter two different integer values: "); scanf("%d%d", &x, &y); z = larger_of(x,y); printf("\nThe larger value is %d.", z); return 0; } int larger_of( int a, int b) { if (a > b) return a; else return b; }