SlideShare a Scribd company logo
L➿P
S
IN C LANGUAGE
RESPECTED FACULTY :
Mr. ATIK SAMA
By : Rishabh, Rajdeep, Gungun, Veer
BCA (G)
What is a Loop?
A loop is a way to repeat a set of instructions multiple times in a
program. In simple terms, repeating the same code unless stopped.
It helps avoid writing the same code over and over again.
This is also a kind of loop ^
>> kinds of loops
Kinds of Loops :
- For
- While
- Do… while (do-while)
>> what is a for loop?
What is a for Loop?
- A for loop is used when you know
how many times you want to
repeat a block of code.
- It's a compact way to repeat
code a specific number of times.
>> syntax and use of for loop
for Loop Syntax :
for(initialization; condition; increment/decrement) {
// Code to repeat
}
for Loop Example :
for Loop Output :
>> what is a while loop?
What is a while Loop?
- A while loop repeats a block of code as long
as a given condition is true.
- It's useful when you don't know how many
times you need to repeat the code.
>> syntax and use of while loop
while Loop Syntax :
while(condition) {
// Code to repeat
}
while Loop Example :
while Loop Output :
>> what is a do-while loop?
What is a do-while Loop?
- A do-while loop is similar to a while loop but guarantees
that the code inside the loop runs at least once.
- The condition is checked after the loop has run, not
before.
>> syntax and use of do-while loop
do-while Loop Syntax :
do {
// Code to repeat
} while(condition);
do-while Loop Example :
do-while Loop Output :
>> summary
If Output* is the same then what is the difference?
Allow me to explain this.
for Loop : Use it when you know exactly how many times the code
needs to run to get the output you want.
while Loop : Use it when you don't know in advance how many times
the code will need to run. This loop keeps going as long as the condition
is true.
do-while Loop : It’s like the while loop but with one key difference — it
always runs at least once because it checks the condition after each
run.
>> that's all!
Thank you
धन्यवाद
‫ﺷﮑرﯾہ‬
આભાર
THAT IS
ALL. 󰚦

More Related Content

Recently uploaded (20)

PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Digital Circuits, important subject in CS
contactparinay1
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 

Featured (20)

PDF
Everything You Need To Know About ChatGPT
Expeed Software
 
PDF
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
PDF
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
PDF
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
PDF
Skeleton Culture Code
Skeleton Technologies
 
PDF
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
PDF
Content Methodology: A Best Practices Report (Webinar)
contently
 
PPTX
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
PDF
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
PDF
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
PDF
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
PDF
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
PDF
Getting into the tech field. what next
Tessa Mero
 
PDF
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
PDF
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
PDF
Introduction to Data Science
Christy Abraham Joy
 
PDF
Time Management & Productivity - Best Practices
Vit Horky
 
PDF
The six step guide to practical project management
MindGenius
 
PDF
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
PDF
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
Ad

LOOPS in C Programming Language - Technology

  • 1. L➿P S IN C LANGUAGE RESPECTED FACULTY : Mr. ATIK SAMA By : Rishabh, Rajdeep, Gungun, Veer BCA (G)
  • 2. What is a Loop? A loop is a way to repeat a set of instructions multiple times in a program. In simple terms, repeating the same code unless stopped. It helps avoid writing the same code over and over again. This is also a kind of loop ^ >> kinds of loops
  • 3. Kinds of Loops : - For - While - Do… while (do-while) >> what is a for loop?
  • 4. What is a for Loop? - A for loop is used when you know how many times you want to repeat a block of code. - It's a compact way to repeat code a specific number of times. >> syntax and use of for loop
  • 5. for Loop Syntax : for(initialization; condition; increment/decrement) { // Code to repeat } for Loop Example : for Loop Output : >> what is a while loop?
  • 6. What is a while Loop? - A while loop repeats a block of code as long as a given condition is true. - It's useful when you don't know how many times you need to repeat the code. >> syntax and use of while loop
  • 7. while Loop Syntax : while(condition) { // Code to repeat } while Loop Example : while Loop Output : >> what is a do-while loop?
  • 8. What is a do-while Loop? - A do-while loop is similar to a while loop but guarantees that the code inside the loop runs at least once. - The condition is checked after the loop has run, not before. >> syntax and use of do-while loop
  • 9. do-while Loop Syntax : do { // Code to repeat } while(condition); do-while Loop Example : do-while Loop Output : >> summary
  • 10. If Output* is the same then what is the difference? Allow me to explain this. for Loop : Use it when you know exactly how many times the code needs to run to get the output you want. while Loop : Use it when you don't know in advance how many times the code will need to run. This loop keeps going as long as the condition is true. do-while Loop : It’s like the while loop but with one key difference — it always runs at least once because it checks the condition after each run. >> that's all!