Skip to content
Snippets Groups Projects
Commit 4f30f41a authored by Rudi Buss's avatar Rudi Buss
Browse files

Update Solution Exercise 6 - Continue statement.cpp

parent c92c966c
No related branches found
No related tags found
No related merge requests found
......@@ -2,22 +2,20 @@
using namespace std;
int main()
{
for (int num=0; num<=100; num++)
{
/* This means that when the value of
* num not divisible by 2, this continue statement
* would be encountered, which would make the
* control to jump to the beginning of loop for
* next iteration, skipping the current iteration
*/
if (num % 2 == 1) // Can not be divided by the number 2
{
continue;
}
cout << num << " ";
}
return 0;
int main() {
for (int num = 0; num <= 100; num++) {
/* This means that when the value of
* num not divisible by 2, this continue statement
* would be encountered, which would make the
* control to jump to the beginning of loop for
* next iteration, skipping the current iteration
*/
if (num % 2 == 1) // Can not be divided by the number 2
{
continue;
}
cout << num << " ";
}
return 0;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment