Tagged: understand if statement

if statement in C 23

if statement in C

In the if statement, if is the keyword in C. Syntax: if (condition is true){ /*block of statements to be executed*/ } 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 statement using an example. Example of if statement in C: int a = 10; if (a == 10){ printf(“You are in if block\n”); printf(“The value of a is %d\n”, a); } printf(“You...

FREE C Cheatsheet - Speed Up Your C Programming.

FREE C Cheatsheet - Speed Up Your C Programming.

Download a 7-page free cheat sheet for easy and quick access to C Concepts, Snippets, and Syntax.

Thank you! Check you inbox and access your cheat-sheet