title: The COntrol of the program does not enter the for loop
body: <p>Here i am pasting the code: </p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace star1
  {
      class Program
      {
          static void Main(string[] args)
          {
              Myclass obj = new Myclass();
              obj.getData();
              obj.pattern();
          }
      }
      class Myclass
      {
          int i, n, j;
  
          public void getData()
          {
              Console.WriteLine("Program for displaying pattern of *.");
              Console.Write("Enter the maximum number of *: ");
              int n = Convert.ToInt32(Console.ReadLine());
          }
  
          public void pattern()
          {
              Console.WriteLine("\nPattern 1 - Left Aligned:\n");
              for (i = 1; i &lt;= n; i++)  // The Control does not enter the for loop
              {
                  for (j = 1; j &lt;= i; j++)
                      Console.Write("*");
                  Console.WriteLine();
              }
          }
      }   
  
  }
  </code></pre>