Answer on Question #47787 - Programming, C#
Generate the series 3 6 9 2 5 8 1 4 7 0 using using loop in c #
Solution.
// Connecting library
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NewApp
{
class Program
{
static void Main(string[] args)
{
//3 6 9 2 5 8 1 4 7 0
for (int k = 3, j = 0, i = k, n = 12; i <= n; i += 3, j++)
{
if (j == 3) { j = 0; n--; k--; i = k; }
if (i == -1) { break; }
Console.Write(i + " ");
}
Console.Read();
}
}
}http://www.AssignmentExpert.com/