Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

no hand written answers please. for loop VS while loop for loop and while loop are equivalent, just a different syntax for the same thing.

no hand written answers please.
image text in transcribed
for loop VS while loop for loop and while loop are equivalent, just a different syntax for the same thing. You can emulate a for loop with a while loop in mostly any language, here is an example of that: code output while int i-0; loop while (i-3) System.out.println("i3 for or int i-0 loop i-3:i++) System.out.println("i3 One main difference is while loops are best suited when you do not know ahead of time the number of iterations that you need to do. When you know this before entering the loop you can use for loop. Can we emulate a for loop to a while loop? When it is best to do a while loop instead of for loop

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

3. How effective is the team?

Answered: 1 week ago

Question

What is Accounting?

Answered: 1 week ago

Question

Define organisation chart

Answered: 1 week ago