Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSami Manzur
527 PointsHow do I write a do while loop?
Hi everyone,
I'm having trouble incorporating a do while loop for this code. If anyone of you could help me figure it out, I'd really appreciate it! :)
Thanks,
2 Answers
Luke Glazebrook
13,564 PointsHi Sami,
I have written an example of a do while loop below, if you have any questions about its structure or do while loops in general then feel free to ask me them.
do {
// Do something here
} while(i > 50); // This is where your condition goes.
-Luke
Alexander Kuvshinov
870 PointsSami,
console.printf("Because you said %s, you passed the test! \n\n", response);
Sami Manzur
527 PointsSami Manzur
527 PointsThanks, Luke! I was able to figure it out. I was wondering if you could help me figure out what's wrong with this console.printf function?
console.printf("Because you said <response>, you passed the test! \n\n");
Treehouse keeps saying that I need to use console.printf with a formatted string with the response?
Thanks again for all the help!