C Language Tutorials by Ghulam Murtaza Dahar - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Output 1

Enter a number to check.

-2

Number=-2

The if statement in C programming is easy.

When user enters -2 then, the test expression (num<0) becomes true. Hence, Number=-2 is displayed in the screen.