Question: (10 points) An assertion specifies that a program always satisfies a certain condition at a particular point during its execution. The assert function in

(10 points) An assertion specifies that a program always satisfies a certain condition at a particular point during its execution. The assert function in C takes as input an expression; the program aborts if the expression evaluates to false during program execution. Consider the function baz written in C: void baz (int n) { int x,y,i; X i = 0; = y while (i < n) { i++; x++; if (i%2 == } assert (???); assert() 0) y++; Replace the ??? in the above assert statement with any non-trivial assertion involving all of the variables i, x and y, but not variable n. A trivial assertion would be one that would be true at any point in any program, for example, x==x && y==y && i==i
Step by Step Solution
3.43 Rating (156 Votes )
There are 3 Steps involved in it
Program include include int bazint n int xyi x y i ... View full answer
Get step-by-step solutions from verified subject matter experts
