Computer Science, asked by tasmayholkar, 2 months ago

What will be the output of following program?
public static void main(String arrl)
{
for (int i=1;i<=10;1++)
{
if (i==5)
{
continue
break;
}
if(i--8)
{
break
continue,
}
Console.Writeline(i);
}
}​

Answers

Answered by Anonymous
10

Explanation:

Sanfoundry’s 1000+ MCQs on C helps anyone preparing for placement in Microsoft and other companies. Anyone looking for Microsoft placement papers should practice these 1000+ questions continuously for 2-3 months, thereby ensuring a top position in placements.

Here is a listing of basic C questions on “Break and Continue” along with answers, explanations and/or solutions:

__________☘️________

Answered by parijaini
1

Answer:

Check out 15 C# Questions – For, While Loops and If Else Statements. These questions will help you to test and improve your C# programming skills.

Loops and conditional constructs are an integral part of any programming language. So you need to know how to use them efficiently to produce scalable and quality.

A good programmer should be able to decide when to choose a for loop and when should he prefer the while loop.

But before you move to the questions and answers section, please check below if you’ve not read the basic differences between the two types of loops.

Also, if you are aware of any other difference, then do let us know as well.

Explanation:

There is a semantic difference between a for and while loop which you must understand. While loops are meant to handle an indefinite no. of iterations. So you should use it in cases like while reading a file to its EOF. Whereas, the for loops are more appropriate to tackle definite no. of operations. For example – traversing through the elements in a list.

Similarly, there are ways to use an if…else block so that your code can produce correct results with minimum iterations.

Let’s now begin to read the top 15 C# questions – for, while loops and conditional operators.

Similar questions