while loop that is repeated if i is less than twice j. Inside the loop double the value of i and decrement j.
Count the number of times the loop is executed
Count the number of times the loop is executed
using System;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
int i = 1; int j = 10;
int count = 0;
while(i<(2*j))
{
i++;
count++;
}
Console.WriteLine("The loop repeated " + count + " times and now j is " + j + " and i is " + i);
}
}
}

Vincent Maverick DuranoRank #238 · 10.3K reputationPosted Dec 14, 2018, 1:22 PM EST
Vincent Maverick DuranoRank #238 · 10.3K reputationPosted Dec 14, 2018, 1:14 PM EST
anti virus15 reputationPosted Dec 14, 2018, 1:17 PM EST