Bitwise Operators in C Uses of Bitwise Operations or Why to Study Bits 1. Compression: Occasionally, you may want to implement a large number of Boolean variables, without using a lot of space. A 32-bit int can be used to store 32 Boolean variables. Normally, the minimum size for one Boolean variable is one byte. Control Statements. C program executes line by line. This can be altered by using:. Decision Statements. Loops. The number of time a loops is executed or whether a decision statement results in the execution of a section of the code, depends on whether a certain expression is true or false.
- Logic Conditional Statement
- Conditional Statement In C Programming Ppt Presentations
- Conditional Statement In C Programming Ppt Example
- C Programming Tutorial #06 Conditional Statements: if, if else, cascading if, switch. In 6th lecture of C Programming, we will enter the uncertain world of c.
- Most statements in a typical C program are simple statements of this form. Other examples of simple statements are the jump statements return, break, continue, and goto.A return statement specifies the return value for a function (if there is one), and when executed it causes the function to exit immediately.
C conditional statements allow you to make a decision, based upon the result of a condition. These statements are called Decision Making Statements or Conditional Statements.
So far, we have seen that all set of statements in a C program gets executed sequentially in the order in which they are written and appear. This occurs when there is no jump based statements or repetitions of certain calculations. But some situations may arise where we may have to change the order of execution of statements depending on some specific conditions. This involves a kind of decision making from a set of calculations. It is to be noted that C language assumes any non-zero or non-null value as true and if zero or null, treated as false.
Logic Conditional Statement
This type of structure requires that the programmers indicate several conditions for evaluation within a program. The statement(s) will get executed only if the condition becomes true and optionally, alternative statement or set of statements will get executed if the condition becomes false.
Conditional Statement In C Programming Ppt Presentations
The flowchart of the Decision-making technique in C can be expressed as:
C languages have such decision-making capabilities within its program by the use of following the decision making statements:
- If statement
- Conditional Operator
- C Programming Tutorial
- C Programming useful Resources
- Selected Reading

A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case.

Syntax
The syntax for a switch statement in C programming language is as follows −

The following rules apply to a switch statement −

The expression used in a switch statement must have an integral or enumerated type, or be of a class type in which the class has a single conversion function to an integral or enumerated type.
You can have any number of case statements within a switch. Each case is followed by the value to be compared to and a colon.
The constant-expression for a case must be the same data type as the variable in the switch, and it must be a constant or a literal.
When the variable being switched on is equal to a case, the statements following that case will execute until a break statement is reached.
When a break statement is reached, the switch terminates, and the flow of control jumps to the next line following the switch statement.
Not every case needs to contain a break. If no break appears, the flow of control will fall through to subsequent cases until a break is reached.
A switch statement can have an optional default case, which must appear at the end of the switch. The default case can be used for performing a task when none of the cases is true. No break is needed in the default case.
Flow Diagram
Example
Conditional Statement In C Programming Ppt Example
When the above code is compiled and executed, it produces the following result −
