using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace For_five
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("---
For 1 ---");
for (int i = 0; i
<= 10; i++)
{
Console.WriteLine(i);
}
Console.WriteLine("---
For 2 ---");
for (int i = 10 - 1;
i >= 0; i--)
{
Console.WriteLine(i);
}
Console.WriteLine();
Console.WriteLine("---
For 3 ---");
for (int i = 0; i
< 10; i += 2)
{
Console.WriteLine(i);
}
Console.WriteLine();
Console.WriteLine("---
For 4 ---");
for (int i = 10 - 1;
i >= 0; i -= 2)
{
Console.WriteLine(i);
}
Console.WriteLine();
Console.WriteLine("---
For 5 ---");
for (int i = 0; i
< (20 / 2); i += 2)
{
Console.WriteLine(i);
}
Console.ReadLine();
}
}
}
No comments:
Post a Comment