11. Can I Compare Two Values?

With Relational Operators


C provides an extremely useful statement called if. if lets your programs make decisions and execute certain statements based on the results of those decisions. By testing contents of variables, your programs can produce different output given different input.

Relational operators are also described in this chapter. Relational operators, combined with if, make C a powerful data-processing language. Computers would really be boring if they couldn’t test data. Computers would be little more than calculators if they ...

Get Absolute Beginner’s Guide to C, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.