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?
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++;
}
A. and C.
Both variant execute for 7 times but the output is not the same.