Demonstrating assertions : Assert « Development « C / ANSI-C






Demonstrating assertions

Demonstrating assertions

#include <stdio.h>
#undef NDEBUG
#include <assert.h>

void main()
{
  int x = 0;
  int y = 5;
  for(x = 0 ; x < 20 ; x++)
  {
    printf("\nx = %d   y = %d", x, y);
    assert(x<y);
  }
}


           
       








Related examples in the same category