Write a program where 1 to 7 should be printed 8 9 10 should not be and 11 to 20 should be using a break and continue.

Write a C program where 1 to 7 should be printed 8 9 10 should not be and 11 to 20 should be using a break and continue.

Please add the code in different languages in the comments sections below

10 comments on “Write a program where 1 to 7 should be printed 8 9 10 should not be and 11 to 20 should be using a break and continue.”


  • Sushil

    #include
    int main()
    {
    int i;
    for (i = 1; i <= 20; i++)
    {
    if(i==8 || i==9 || i==10)
    {
    continue;
    }
    else
    {
    printf("%d ",i);
    }
    }
    return 0;
    }


  • THANUJA

    #include
    using namespace std;
    int main()
    {
    int i;

    for(i=1;i<=20;i++)
    {
    if(i==8 || i==9 || i==10)
    continue;
    else
    cout<<i<<endl;
    }
    }


  • akshita

    #include;
    using namespace std;
    int main()
    {
    int t1 = 0, t2 = 1, nextTerm = 0, n;

    cout <> n;

    cout << "Fibonacci Series: " << t1 << ", " << t2 << ", ";

    nextTerm = t1 + t2;

    while(nextTerm <= n)
    {
    cout << nextTerm << ", ";
    t1 = t2;
    t2 = nextTerm;
    nextTerm = t1 + t2;
    }

    return 0;
    }


  • Pete

    Anything increased now is slightly positive and without experience,
    could be huge upon the bankroll.