Print pyramid shape by numbers between 1 to 9 in C#
Hello friends, try below code for printing Pyramid shape by any numbers between 1 to 9. E.g. If number=4, print pyramid shape as below: 1 21 321 4321 public class Program { static void Main(string[] args) { Console.Write("Enter any number between 1 to 9 : "); int num = Convert.ToInt32(Console.ReadLine()); for (int i = 1; i <= num; i++) { //printing space for (int j = i; j <= num - 1; j++) Console.Write(" "); ...