Assert Statements are a language feature.
Assert Statements can be built into the language or included in a standard library.
Languages with Assert Statements include Java, C
// By default, assertions are disabled
// java 鈥揺nableassertions Test
int score = 10;
assert score >= 10 : " Below";
System.out.println("score is "+score);
#include <assert.h>
int i, a[10];
for (i = 0; i < 10; ++i)
{
assert(0 <= i && i < 10);
a[i] = 10-i;
}
for (i = 0; i < 10; ++i)
{
assert(0 <= i && i < 10);
assert(0 <= a[i] && a[i] < 10);
a[a[i]] = a[i];
}