Tagged: c language if else

The if-else Statement in C Programming Language 35

The if-else Statement in C Programming Language

Let us understand if-else statement in C programming language. Here, if and else are the keywords in C. Syntax:

The keyword if tells the compiler that what follows is decision control statement. The block of statements to be executed must be enclosed in opening and closing braces. If only one statement needs to be executed then braces need not be used. Let us understand if-else statement using an example. Example:

In the above example we have assigned value 10 to a. In the next line, there is an if statement. It is read as “If a is equal...