int count = 0;
while (count < 10)
{
count = count + 1;
}
for (int i = 0; i < 5; i++)
{
count = count - 1;
}
MessageBox.Show("The answer is " + count);
int count = 0;
while (count < 10)
{
count = count + 1;
}
for (int i = 0; i < 5; i++)
{
count = count - 1;
}
MessageBox.Show("The answer is " + count);
int count = 0;
while (count < 10)
{
count = count + 1;
}
for (int i = 0; i < 5; i++)
{
count = count - 1;
}
MessageBox.Show("The answer is " + count);
// Declares int count and sets it value to 0
int count = 0;
// Loops while count is less than 10
while (count < 10)
{
// Adds 1 to count on each loop (Will end with 10)
count = count + 1;
}
// Declares int i, sets its value to 0, loops while i is less than 5 and adds 1 to i on each loop
for (int i = 0; i < 5; i++)
{
// Decreases value of count by 1 on each loop (loops 5 times = output is 10 - 5)
count = count - 1;
}
// Shows message box with the end value (5).
MessageBox.Show("The answer is " + count);
int count = 0;
while (count < 10)
{
count = count + 1;
}
for (int i = 0; i < 5; i++)
{
count = count - 1;
}
MessageBox.Show("The answer is " + count);
Copyright © 2024, NextGenUpdate.
All Rights Reserved.