1
2
3
4
5
6
| int i,j;
for(i=0;i<=10;i++)
{
j+=5;
assert(i<5);
} |
int i,j;
for(i=0;i<=10;i++)
{
j+=5;
assert(i<5);
}
Click here to view the answer
Answer:
Runtime error: Abnormal program termination.
assert failed (i<5),
,
Explanation:
asserts are used during debugging to make sure that certain conditions are satisfied. If assertion fails, the program will terminate reporting the same. After debugging use,
#undef NDEBUG
and this will disable all the assertions from the source code. Assertion is a good debugging tool to make use of.