Break continue.

Source: Internet
Author: User

1.break and Continue.
These two keywords are generally used in loops of curly braces.
break--ends the entire loop.
continue--ends the cycle and enters the next cycle.

2.while Cycle

Initial

while (loop condition)

{
Loop body
Change Status to
}

int i = 1;
int count=0; Record the number of numbers associated with 7
while (i<=100)
{
if (i%7==0 | | i%10==7| | I/10==7)
{
Console.Write (i+ "\ t");
count++;

}
i++;
}
Console.Write ("A total of" +count+ "with 7 related numbers");

3.do...while (circular condition) simple to understand.

The loop is executed once even if the initial conditions do not meet the loop condition.

Execute at least once.

Arrays: The ability to solve the same class of large amounts of data stored and operated in memory.

Categories: one-dimensional arrays, two-dimensional arrays, multidimensional arrays.

Features: continuous, same class of data.

Break continue.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.