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

Bitwise Operators in C

C language provides six bitwise operators which for manipulation of data at bit level. These operators are used to perform shifting, complementing, ANDing, ORing and so on, al at bit level. These include the bitwise AND (&), bitwise OR (|), bitwise exclusive OR (^), shift left (<<), shift right (>>) and one’s complement (~) operator. … Read more

Logical Operators in C

C language provides three logical operators which include the logical AND (&&), logical OR (||) and logical NOT (!) operator. These operators are used to perform logical operations on two operands and thus are binary operators. However, logical NOT (!) has only one operand and hence is a unary operator. All these operators perform the … Read more