menu
QAmmunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
Register
Ask a Question
Questions
Unanswered
Tags
Categories
Ask a Question
What is the difference between a loop and a function?
asked
Sep 17, 2023
31.4k
views
2
votes
What is the difference between a loop and a function?
Computers and Technology
high-school
Brian Hinchey
asked
by
Brian Hinchey
5.2k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
2
Answers
13
votes
Simple definition
A loop is a code that will repeat again and again until the condition is true. If the condition become false the loop will stop executing.
A function is a code that will do a particular task when you call it. First you need to define a function which is known as function definition. And whenever you want to use it then you have to call the function.
If you don’t call the function then it will not work what you want.
Hope you like this
Locket
answered
Sep 19, 2023
by
Locket
4.9k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
0
votes
Big difference
Loops allow you to execute code multiple times while a condition is true
Functions allow you to “call” a snippet of code whenever you want, and you can pass it arguments that could affect the data it returns
Urraka
answered
Sep 22, 2023
by
Urraka
5.1k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
5.3m
questions
6.9m
answers
Other Questions
Why is it important to study in a quiet well lit area A can you read it out loud and not bother anyone B you can focus on your studying without distractions C reading books in a dark too Will strain your
What will be the value of bonus after the following code is executed? int bonus, sales = 6000; if (sales < 5000); bonus = 200; else if (sales < 7500); bonus = 500; else if (sales < 10000); bonus = 750; else if (sales < 20000); bonus = 1000; else; bonus = 1250; A. 200 B. 500 C. 750 D. 1000
What is the first step you would take to create a table of authorities?
In Java a final class must be sub-classed before it. ?? True ?? False
HELP PLS TIME LIMIT HERE When should you contact your instructor if you experience problems or questions with your online course? A.After you talk to the lab instructor B.At the end of the day C.When you
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search QAmmunity.org