Tagged: if else program in c

if else in C programming 36

if else in C programming

Let us understand if-else statement in C programming language. Here, if and else are the keywords in C. Syntax of if else in C: if (condition is true){ /*1st block of statements*/ } else{ /*2nd block of statements*/ } 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: int a = 10; if (a == 10) { printf(“You...