PrepAway - Latest Free Exam Questions & Answers

Which of the following represents the code you should write?

You are employed as a developer at ABC.com. You make use of C# and ASP.NET for
development purposes.
You have been instructed to create a new application for ABC.com using C#. The new application
must process a loop repeatedly for precisely 7 times.
Which of the following represents the code you should write?

PrepAway - Latest Free Exam Questions & Answers

A.
int count = 1;
while (count <= 7)
{
Console.WriteLine(“The value of count = {0}”, count);
count++;
}

B.
int count = 0;
while (count <= 7)
{
Console.WriteLine(“The value of count = {7}”, count);
count++;
}

C.
int count = 1;
while (count <= 7)
{
Console.WriteLine(“The value of count = {7}”);
count++;
}

D.
int count = 0;
while (count <= 7)
{
Console.WriteLine(“The value of count = {0}”);
count++;
}

One Comment on “Which of the following represents the code you should write?


Leave a Reply