CPP All : Tricks in Loops - break continue scope
Concept Learning Code Sheets

#### Sum of sales using break in while loop #2071

Program to demonstrate an infinite while loop and the use of break in loop

#### Sum of sales using break in for loop #2073

Program to demonstrate an infinite for loop and the use of break in loop

#### Empty code block in a for loop #2078

Demonstration of empty code block in a for loop for using the loop as a delay loop.

#### Odd number series using continue in the for loop #2085

Program to print the series of odd numbers using an alternative technique of using the continue within the for loop.

#### Odd number series using continue in the while loop #2088

Program to print the series of odd numbers using an alternative technique of using the continue within the while loop.

#### Scope of variables declared inside loop #2092

Reuse  of variable declared in a loop scope for another loop.

Solved Problems

#### Excluding Numbers divisible by 2 or by 3 #2094

Write the output of the following program. Assume that required header files

Write the output of the following program. Assume that required header files are included.

```int main()
{
for(int i=1;i<=30;++i)
{
if(i%2==0 || i%3==0) continue;
else cout<<i<<" ";
}
return 0 ;
}```

#### Tee Shirts Selection By Sports Teacher #5011

A sports teacher has been confidentially asked to reject the persons whose Te

A sports teacher has been confidentially asked to reject the persons whose Tee-shirt numbers are divisible by 10. Make a program to help this teacher collect the T-shirt numbers one by one and stop counting when 10 persons have been counted. Keep printing the selected Tee-shirt numbers.

Code Sheets:6  Solved Problems:2
×