Presentation of control statement

BharatRathore24 1,135 views 8 slides May 24, 2021
Slide 1
Slide 1 of 8
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8

About This Presentation

This presentation is simply based on control statement. I have explained the basic definition and syntax, flow diagram, selection statement, iteration statement, and jump statement in this presentation.

If you like this presentation, then like, comment and share


Slide Content

Subject JAVA Presentation of “CONTROL STATEMENT” Submitted To : Satish Bansal Submitted By : Bharat Rathore Gaurav Shakya Varsha Rajak

OUTLINES Definition Flow Diagram Selection Statement Iteration Statement Jump Statement

Control Statement A  control statement  in  java  is a  statement  that determines whether the other  statements  will be executed or not. It  controls  the flow of a program. An 'if'  statement  in  java  determines the sequence of execution between a set of two  statements

Flow Diagram of CONTROL STATEMENT If.. else Switch..case while do while for continue break

Selection Statement If-Else Statement If the condition is true then, it will execute the If block. Otherwise, it will execute the Else block. Switch Statement Switch statement allows program to select one action among multiple actions during the program execution. Syntax: Switch(variable/value/expression){ Case : // statements []; Case : // statements []; … default: // statements []; } Syntax: if(condition){ // statements (if Block) } else{ // statements (Else block) }

Iteration Statement For loop For loop is an entry control loop. In for loop we are require to pass three arguments while loop While loop is an entry control loop. In while loop the condition is checked first and then the statements of the loop are executed. Do while lo op It is an exit control loop. In the do while loop are executed first and then the condition is checked and this loop is executed at least once time whether the condition is true or false Syntax : for( initialization  ;test  condition  ; increment /decrement ) { Statements; Statements; } Syntax : while( condition ) { statements; statements; } syntax : do { statements; statements; }while( condition )

Jump Statement Break On  execution  of “break” statement the control jumps out of  the loop . Syntax : { —- —- if (condition) break; —– —– } Continue On execution of “continue” statement the control jumps to the beginning of the loop. Syntax : { —- —- if (condition) continue; —– —– }