C_7

Views:
 
Category: Education
     
 

Presentation Description

No description available.

Comments

By: 721982 (8 month(s) ago)

its good prsentation, and plz allow me to download.thanku

By: esmatmir (17 month(s) ago)

Good Site for Presentation

By: jaitak (22 month(s) ago)

it is good

By: NatureVilla (23 month(s) ago)

Hi this is really gud presentation having good basics.

Presentation Transcript

Slide 1: 

CONTROL STATEMENT

INTRODUCTION OF CONTROL STATEMENT : 

INTRODUCTION OF CONTROL STATEMENT C language has decision making capabilities and supports controlling of statements. C supports following control or decision making statements: 1. IF 2. Switch 3. Break 4. Continue 5. Goto

IF STATEMENT : 

IF STATEMENT The if statement is a powerful decision making statement. The if statement is used to control the flow of execution of statements. It is a two way decision statement which is used in conjunction with an expression. Syntax :- If( Test Expression)

DIFFERENT FORMS OF IF STATEMENT : 

DIFFERENT FORMS OF IF STATEMENT Simple If statement. If…..else statement. Nested if…..else statement. Else if ladder.

Slide 5: 

SIMPLE IF STATEMENT If the if expression evaluates to true, the block following the if statement or statements are executed. The general form of a simple if statement is : if (test-expression) { statement-block; } statement-x;

IF….ELSE STATEMENT : 

IF….ELSE STATEMENT The general form of if……else statements is : IF the if expression evaluates to true, the block following the if statement or statements are executed. The else statement is optional. It is used only if a statement or a sequence of statements are to be executed in case the if expression evaluates to false.

ELSE IF LADDER : 

ELSE IF LADDER The general form of else if ladder is: The if – else – if statement is also known as the if-else-if ladder or the if-else-if staircase. The conditions are evaluated from the top downwards.

NESTED IF…..ELSE STATEMENT : 

NESTED IF…..ELSE STATEMENT The general form of nested if….else statement is: if (test-expression 1) { if (test-expression 2) { statement 1; } else { statement 2; } } else { statement 3; } Statement x;

SWITCH – CASE STATEMENT : 

SWITCH – CASE STATEMENT The switch-case control statement is a multi-way decision maker that tests the value of an expression against a list of integers or character constants. When a match is found, the statements associated with that constant are executed. The general syntax of switch-case statement is:-

BREAK STATEMENT : 

BREAK STATEMENT When the keyword break is encountered inside any c loop, control automatically passes to the first statement after the loop. A break is usually associated with an if. The general syntax of break statement is: For(; ;) { -------- -------- if (error) break; ------- } --------

CONTINUE STATEMENT : 

CONTINUE STATEMENT C supports another similar statement called continue statement. It causes the loop to be continued with the next iteration after skipping any statement in between. It tells the compiler, “skip the following statement and continue with the next iteration”. The general syntax of continue statement is: do( ) { ------- if (-----) continue; ------- } while( testing );

GO TO STATEMENT : 

GO TO STATEMENT C supports the go to statement to branch unconditionally from one point to another in the program. It requires a label in order to identify the place where branch is to be made. The general syntax of go to statement is: go to label; -------- -------- label: statement x ;

Slide 13: 

Thank You