C examples for Language Basics:assert
Demonstrating assertions with assert function
#include <stdio.h> #include <assert.h> int main(void) { int y = 5;/*from w w w .j av a 2 s .c om*/ for(int x = 0 ; x < 20 ; ++x) { printf("x = %d y = %d\n", x, y); assert(x < y); } return 0; }