This document discusses different types of looping control structures in C++ programming, including for, while, and do-while loops. It provides the syntax for each loop and examples of how they work. The key points are:
- Loops allow repeating execution of a block of code multiple times.
- C++ has three main types of loops: for, while, and do-while.
- For loops iterate a specific number of times as defined by the initialization, condition, and increment/decrement statements.
- While loops continuously execute while a condition is true.
- Do-while loops execute the body at least once even if the condition is false, since the condition is checked at the bottom.
In this presentation slides you will able to understand easily ,this slides contain loops of c++ programming language which contain for loop , while loop , do while loop and nested these all are describe with definition,examples and flow charts
C Programming - Decision making, LoopingMURALIDHAR R
Execution of a statement or set of statement repeatedly is called as looping.
The loop may be executed a specified number of times and this depends on the satisfaction of a test condition.
A program loop is made up of two parts one part is known as body of the loop and the other is known as control condition.
Depending on the control condition statement the statements within the loop may be executed repeatedly.
Depending on the position of the control statement in the loop, a control structure may be classified either as an entry controlled loop or as an exit controlled loop.
Entry Controlled Loop:
When the control statement is placed before the body of the loop then such loops are called as entry controlled loops.
If the test condition in the control statement is true then only the body of the loop is executed.
If the test condition in the control statement is not true then the body of the loop will not be executed. If the test condition fails in the first checking itself the body of the loop will never be executed.
In this presentation slides you will able to understand easily ,this slides contain loops of c++ programming language which contain for loop , while loop , do while loop and nested these all are describe with definition,examples and flow charts
C Programming - Decision making, LoopingMURALIDHAR R
Execution of a statement or set of statement repeatedly is called as looping.
The loop may be executed a specified number of times and this depends on the satisfaction of a test condition.
A program loop is made up of two parts one part is known as body of the loop and the other is known as control condition.
Depending on the control condition statement the statements within the loop may be executed repeatedly.
Depending on the position of the control statement in the loop, a control structure may be classified either as an entry controlled loop or as an exit controlled loop.
Entry Controlled Loop:
When the control statement is placed before the body of the loop then such loops are called as entry controlled loops.
If the test condition in the control statement is true then only the body of the loop is executed.
If the test condition in the control statement is not true then the body of the loop will not be executed. If the test condition fails in the first checking itself the body of the loop will never be executed.
Visual Basic loop structures allow you to run one or more lines of code repetitively. You can repeat the statements in a loop structure until a condition is True, until a condition is False, a specified number of times, or once for each element in a collection.
“Loop in C – Properties, and Applications”. We will cover Introduction, Details, Advantages, History, Types of Loops, Flowcharts, Practical Use, Outputs, and Conclusion. What is a loop? We are all familiar with the idea of listening to songs on loops. But, we are obviously not here to speak on that.
What is a loop in C? Looping Statements in C execute the sequence of statements many times until the stated condition becomes false. It has mainly 2 parts – a body of a loop and a control statement. The main purpose is to repeat the same code a number of times.
Repetition: Concept of Loop, Pretest and Post-test Loops, Initialization and Updating, Event and Counter Controlled Loops, Loops in C, Other Statements Related to Looping, Looping Applications
Decision making:
In CSharp, various types of decision making statements are available such as if..else, if..else..if, switch etc. Each statement is used to evaluate the specific test. If tests are determined to be true, specific statement will be execued for example : if(a > b) statement1 else statement2. Sometimes when develpoing program that requires to take the decision to execute specific part of program, decision making statement helps to do so.
Switch Case
In CSharp switch acts like a multiple if / else if / else chain. Checks a value against a list of cases, and executes the first case that is true. If no matching case found, it executes the default case. The break(optional) statements with case indicate to the interpreter to end the particular case.
Visual Basic loop structures allow you to run one or more lines of code repetitively. You can repeat the statements in a loop structure until a condition is True, until a condition is False, a specified number of times, or once for each element in a collection.
“Loop in C – Properties, and Applications”. We will cover Introduction, Details, Advantages, History, Types of Loops, Flowcharts, Practical Use, Outputs, and Conclusion. What is a loop? We are all familiar with the idea of listening to songs on loops. But, we are obviously not here to speak on that.
What is a loop in C? Looping Statements in C execute the sequence of statements many times until the stated condition becomes false. It has mainly 2 parts – a body of a loop and a control statement. The main purpose is to repeat the same code a number of times.
Repetition: Concept of Loop, Pretest and Post-test Loops, Initialization and Updating, Event and Counter Controlled Loops, Loops in C, Other Statements Related to Looping, Looping Applications
Decision making:
In CSharp, various types of decision making statements are available such as if..else, if..else..if, switch etc. Each statement is used to evaluate the specific test. If tests are determined to be true, specific statement will be execued for example : if(a > b) statement1 else statement2. Sometimes when develpoing program that requires to take the decision to execute specific part of program, decision making statement helps to do so.
Switch Case
In CSharp switch acts like a multiple if / else if / else chain. Checks a value against a list of cases, and executes the first case that is true. If no matching case found, it executes the default case. The break(optional) statements with case indicate to the interpreter to end the particular case.
What is a Reference variable? Explain with example
Explain Symbolic Constants with example.
Short note on Declaration & Dynamic initialization of variables
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
3. Prepared By: Asst. Prof. Sejal Jadav
• There may be a situation, when you need to execute a
block of code several number of times.
• In general, statements are executed sequentially: The
first statement in a function is executed first, followed
by the second, and so on.
• Programming languages provide various control
structures that allow for more complicated execution
paths.
4. Prepared By: Asst. Prof. Sejal Jadav
• A loop statement allows us to execute a statement or
group of statements multiple times and following is
the general from of a loop statement in most of the
programming languages −
5. Prepared By: Asst. Prof. Sejal Jadav
• C++ programming language provides the following
type of loops to handle looping requirements.
1. for,
2. while,
3. do… while
6. Prepared By: Asst. Prof. Sejal Jadav
For Loop
•A for loop is a repetition control structure that
allows you to efficiently write a loop that needs
to execute a specific number of times.
7. Prepared By: Asst. Prof. Sejal Jadav
Syntax
The syntax of a for loop in C++ is −
for ( init; condition; increment/decrement )
{
statement(s);
}
8. Prepared By: Asst. Prof. Sejal Jadav
• Here is the flow of control in a for loop −
• The init step is executed first, and only once.
• This step allows you to declare and initialize any loop
control variables.
• Require semicolon (;).
9. Prepared By: Asst. Prof. Sejal Jadav
•Next, the condition is evaluated.
•If it is true, the body of the loop is executed.
•If it is false, the body of the loop does not execute
and flow of control jumps to the next statement
just after the for loop.
10. Prepared By: Asst. Prof. Sejal Jadav
•After the body of the for loop executes, the flow
of control jumps back up to
the increment statement.
11. Prepared By: Asst. Prof. Sejal Jadav
•The condition is now evaluated again.
•If it is true, the loop executes and the process
repeats itself (body of loop, then increment step,
and then again condition).
•After the condition becomes false, the for loop
terminates.
13. Prepared By: Asst. Prof. Sejal Jadav
Let’s see Examples: 7_For.cpp
7_forloop
Process
14. Prepared By: Asst. Prof. Sejal Jadav
• First initialize the variable
• In second step check condition
• In third step control goes inside loop body and
execute.
• At last increase the value of variable
• Same process is repeat until condition not false.
15. Prepared By: Asst. Prof. Sejal Jadav
While loop
• In while loop first check the condition if condition is
true then control goes inside the loop body
• Otherwise goes outside of the body. while loop will be
repeats in clock wise direction.
16. Prepared By: Asst. Prof. Sejal Jadav
Syntax
• The syntax of a while loop in C++ is -
while(condition)
{
statement(s);
}
27. Prepared By: Asst. Prof. Sejal Jadav
Let’s look at the Example: 9_whileDemo.cpp
9_while.cpp
9_whileLoop.cpp
28. Prepared By: Asst. Prof. Sejal Jadav
Do...while loop
• The only difference between While loop and do-while
loop is do-while loop at least execute one time.
• No matter if the condition is true or false.
• This happen because the condition of the loop is at
the bottom of body of the loop so, it will execute the
body at least once.
29. Prepared By: Asst. Prof. Sejal Jadav
Syntax
do
{
statement(s);
}
while( condition );
30. Prepared By: Asst. Prof. Sejal Jadav
• If the condition is true, the flow of control jumps back
up to do, and the statement(s) in the loop execute
again.
• This process repeats until the given condition becomes
false.
32. Prepared By: Asst. Prof. Sejal Jadav
• A loop becomes infinite loop if a condition never
becomes false.
• The for loop is traditionally used for this purpose.
• Since none of the three expressions that form the ‘for’
loop are required, you can make an endless loop by
leaving the conditional expression empty.
Infinite
33. Prepared By: Asst. Prof. Sejal Jadav
Example: 6_infinite.cpp
#include <iostream>
using namespace std;
int main ()
{
for( ; ; )
{
printf("This loop will run forever.n");
}
return 0; }
34. Prepared By: Asst. Prof. Sejal Jadav
• When the conditional expression is absent, it is
assumed to be true.
• You may have an initialization and increment
expression, but C++ programmers more commonly use
the ‘for (;;)’ construct to signify an infinite loop.
• NOTE − You can terminate an infinite loop by pressing
Ctrl + C keys.