(a = b) (a != b) (a == b) (a > b)
if (condition) then instruction; case condition instruction; if (condition) instruction; case condition of instruction;
main() { int a, b, c, d;
a = 5; b = 3; c = 99; d = 5; if (a>6) printf("A"); if (a>b) printf("B"); if (b==c) { printf("C"); printf("D"); } if (b!=c) printf("E"); else printf("F"); if (a>=c) printf("G"); else printf("H"); if (a<=d) { printf("I"); printf("J"); } }
main() { int a=1;
if (a>0) printf("The value of a "); printf("is larger than zero"); else printf("The value of a "); printf("is less than zero"); }
The value of a is larger than zero The value of a is less than zero A estrutura do programa está mal. Temos de juntar as instruções com {..} Depende do valor de a.