while Statement in C

The while-loop is an entry-controlled loop in which first the condition is checked, and if it is True then the statements are executed. However, if the condition is False, the control is transferred to the statement immediately after the body of loop. The condition can be any constant, variable or expression that evaluates to True … Read more

switch case Statement in C

switch case statement is another control flow decision making statement supported by C programming language. The general syntax of switch case is as follows; switch ( expression ) { case value1: statement1; break; case value2: statement2; break; . . . case valuen: statementn; break; default: statementx; } The switch case construct first evaluates the expression … Read more

if…else if Ladder in C

if…else if ladder is another extension of if statement supported by C programming language. if statement checks a single condition and if True executes one single statement (simple or compound). if else statement also checks a single condition, however it executes one of the two statements (both of which can be simple or compound). Sometimes, … Read more

if Statement in C

if statement is one of the basic and primitive decision making statement supported by C language. The general syntax of if statement is as follows: if ( condition ) statement; This flow control construct first checks the condition and if it evaluates to True then executes the statement. The condition can be any expression that … Read more

Types of Flow Control Statements in C

In general, C language supports 2 types of flow control statements: 1. Decision Making 2. Looping Decision Making statements are those statements which execute a set of other statements if and only some condition is true. In contrast, Looping statements execute a specific set of statements multiple times as long as some condition is true. … Read more

Control Flow – Decision Making in C

Control Flow (or flow of control) refers to the order in which the individual statements of a program are executed. In C language, statements are executed sequentially i.e. one after another. However, sometimes the nature of computation demands that the statements be executed out of order based on some condition. In our daily life we … Read more

Type Conversions in Expressions in C

C expressions may contain many variables and constants which may be having different data types. However, when they are evaluated they should be raised or grounded to same common type for the sake of correct evaluation. Certain automatic type conversions are done by C compiler. In general, a narrower operand is converted into a wider … Read more

Miscellaneous Operators in C

C language some non-conventional operators like ternary conditional operator (?:), sizeof operator, comma operator (,), pointer operators (& and *) and member selection operators (. and ->). Here we will discuss first 3 operators while rest will be discussed later. Conditional operator (?:) is ternary operator whose first operand is the conditional expression outcome of … Read more