Enter the input reference number for the processing of output: 10
Enter number of row/s: 6
Generated screen output:
1 10 2 9 3 8 4 7 5 6
1 10 2 9 3 8 4 7 5 6
1 10 2 9 3 8 4 7 5 6
1 10 2 9 3 8 4 7 5 6
1 10 2 9 3 8 4 7 5 6
1 10 2 9 3 8 4 7 5 6
using System;
using System.Collections.Generic;
namespace App
{
class Program
{
public static void Main()
{
Console.Write("Enter the input reference number for the processing of output: ");
int number = int.Parse(Console.ReadLine());
Console.Write("Enter number of row/s: ");
int row = int.Parse(Console.ReadLine());
for (int k = 0; k < row; k++)
{
int j = number;
for (int i = 1; i < (number / 2) + 1; i++, j--)
{
Console.Write("{0} {1} ", i, j);
}
Console.WriteLine();
}
Console.ReadLine();
}
}
}
Comments
Leave a comment