Solution for Exercise 8-9
ex0809
#include <stdio.h>
int main()
{
int a,b;
a = 5;
b = -3;
if(a==b);
printf("%d equals %d\n",a,b);
return(0);
}
Output
5 equals -3
Notes
* Smart compilers not only warn about this error, they even offer a suggestion. Here is what the clang compiler says:
10:10: warning: if statement has empty body
10:10: note: put the semicolon on a separate line to silence this warning
* These types of errors can be insidious, not only because the compiler doesn't see them, but because they're difficult to catch.
Copyright © 1997-2025 by QPBC.
All rights reserved
