Tuesday, 29 October 2019

For...For...Loop(Nested Loop) Condition and Find * pattern_20


For...For...Loop(Nested Loop) Condition and Find * pattern_20
            ///     5
            ///    454
            ///   34543
            ///  2345432
            /// 123454321
            int i, j, n;
            Console.Write("Enter number of lines.....>");
            n = Convert.ToInt32(Console.ReadLine());
            for (i = n; i >= 1; i--)
            {
                for (j = i; j > 1; j--)
                    Console.Write(" ");
                for (j = i; j <= n; j++)
                    Console.Write(j);
                for (j = n - 1; j >= i; j--)
                    Console.Write(j);
                Console.ReadLine();
            }
https://www.youtube.com/channel/UCKLRUr6U5OFeu7FLOpQ-FSw/videos

0 comments

Post a Comment