C examples for Function:Utility Function
Use assert() macro to check input
#include <stdio.h> #include <assert.h> int main( void ) { int x;/* w w w .jav a2 s . c o m*/ printf("\nEnter an integer value: "); scanf("%d", &x); assert(x >= 0); printf("You entered %d.\n", x); return 0; }