This forum is now read-only. Please use our new forums! Go to forums
While Loop Syntax
How can I answer this exercise? I`m not understanding how is the while loop syntax! Could somebody help me?
Answer 515504c9c7bffe81830001a7
Is there a specific part of the syntax or the exercise that you are having trouble with?
Answer 515cc717e7d2c1cdbd000419
For exercise 1.2 you should not use the do
/while
loop syntax and instead you should use the while
loop syntax
while(cond) {
// looped statements go here
}
where the statements are executed as long as cond
is true
. Inside the loop body you should echo the string "<p>The loop is running.</p>"
.
Answer 515c07404344b93d8d00150f
Answer 515c9ad2a8e2367e6900005e
1 comments
The loop is not running outside of the curly braces { and } and there should also be a semicolon ; after while () statement in a do/while loop. But, the for this exercise you are not supposed to use a do/while loop. Please refer to my answer for more details.
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
1 comments
I
m with difficult to understand the syntax of the "While"(I
m trying to solve the exercise 1.2)