11. Can I Compare Two Values?

With Relational Operators

image

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.