FOR LOOP TOPIC(syntax, flow diagram and examples).pptx

arconflame15 12 views 8 slides Sep 07, 2024
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

For Loop topic in computer programming, allied subject of engineering course


Slide Content

Power Point Presentation of the topic; For loop(syntax, flow diagram and examples) TO BE PRESENTED BY : James Andrew Borres BSEE 1A

Before we start, let us all know what does a “for loop” means? For loop is a programming language conditional iterative statement which is used to check for certain conditions and then repeatedly execute a block of code as long as those conditions are met. The for loop is distinguished from other looping statements through an explicit loop counter or loop variable which allows the body of the loop to know the exact sequencing of each iteration.

So in simple terms ; A for loop simply means from the word it self “loop”, you're   instructing the program to perform an action repeatedly .

There are also other examples of loops, in which Java has its 3 loops and this are; The For Loop is a loop where the program tells the compiler to run a specific code FOR a specified number of times. This loop allows using three statements, first is the counter initialization, next is the condition to check it and then there is an increment/decrement operation to change the counter variable . T he while loop is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. T he do-while loop is a control flow statement that executes a block of code at least once, and then repeatedly executes the block, or not, depending on a given boolean condition at the end of the block But here we will just be talking about for the topic “for loop” its syntax, flow diagram, and examples.

For Loop Syntax; What is for loop syntax? The initialization statement describes the starting point of the loop, where the loop variable is initialized with a starting value . A  loop variable or counter is simply a variable that controls the flow of the loop. The test expression is the condition until when the loop is repeated.

For Loop Flow Diagram; The For Loop is  a loop where the program tells the compiler to run a specific code FOR a specified number of times . This loop allows using three statements, first is the counter initialization, next is the condition to check it and then there is an increment/decrement operation to change the counter variable.

How do you represent a for loop in a flowchart? In this figure shows th e third method for representing the for loop with a flowchart. A hexagon shaped flowchart symbol is used to represent the for loop and the symbol is divided into three to represent the initial condition, the increment, and the terminating condition.

That’s the end of my report, Thank you and may God bless you.
Tags