Program to Show Demonstrating assertions in C Language

 
/*Program to Show Demonstrating assertions in C Language */


#undef NDEBUG /* Switch on assertions */
#include
#include

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


No comments:

Post a Comment