Answer to Question #284396 in C# for OraaKim

Question #284396

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


1
Expert's answer
2022-01-04T08:56:31-0500
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();
        }






    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS