Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 53

  Shared By: Adah Miller    Date: Jan 24    Category: C Programming    Views: 87

Answer:

int i,j;
for(i=0;i<=10;i++)
{
j+=5;
assert(i<5);
}


Answer:
Runtime error: Abnormal program termination.
assert failed (i<5), <file name>,<line number>


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.


Share: 
 

Didn't find what you were looking for? Find more on C programming practical question 53 Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: