loops: break continue


Expected result...
/*
1
2
3
4
6
7
8
9
10
*/

In C++
#include 
using namespace std;

int main() {
    int count = 0;
    while (true) {
        count += 1;
        //end loop if count is greater than 10
        if (count > 10) {
            break;
        }
        //skip 5
        if (count == 5) {
            continue;
        }
        cout << count << endl;
    }
}
In golang...
package main
import (
    "fmt"
    "time"
)

func main() {
    test := 0
    for {
        test += 1
        if test > 10 {
            break
        }
        if test == 5 {
            continue
        }

        fmt.Println(test)
        time.Sleep(300 * time.Millisecond)
    }
}

9 comments:

  1. Greetings. I know this is somewhat off-topic, but I was wondering if you knew where I could get a captcha plugin for my comment form? I’m using the same blog platform like yours, and I’m having difficulty finding one? Thanks a lot.

    AWS Online Training | Online AWS Certification Course - Gangboard
    AWS Training in Chennai | AWS Training Institute in Chennai Velachery, Tambaram, OMR
    AWS Training in Bangalore |Best AWS Training Institute in BTM ,Marathahalli

    ReplyDelete
  2. Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.

    angularjs Training in chennai
    angularjs Training in chennai

    angularjs-Training in tambaram

    angularjs-Training in sholinganallur

    ReplyDelete
  3. Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
    python training in pune | python training institute in chennai | python training in Bangalore

    ReplyDelete
  4. Really you have done great job,There are may person searching about that now they will find enough resources by your post
    advanced excel training in bangalore

    ReplyDelete
  5. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.

    blueprism training in chennai | blueprism training in bangalore | blueprism training in pune | blueprism online training

    ReplyDelete
  6. I really like the dear information you offer in your articles. I’m able to bookmark your site and show the kids check out up here generally. Im fairly positive theyre likely to be informed a great deal of new stuff here than anyone

    devops online training

    aws online training

    data science with python online training

    data science online training

    rpa online training

    ReplyDelete
  7. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
    Microsoft Azure online training
    Selenium online training
    Java online training
    Python online training
    uipath online training

    ReplyDelete