C# Program: Name Of The Shapes that Can Be Drawn By Lines Corresponding To The Number(1-5) Entered By User

Sunday, 12 February 2012
using System;
class Shapes
{
    public static void Main()
   {
        int number1;
        Console.WriteLine("Enter No Between 1 to 5:");
        number1=Convert.ToInt32(Console.ReadLine());
        if(number1==1)
        {
              Console.WriteLine("You can draw a Single line");
        }
        else if(number1==2)
        {
              Console.WriteLine("You can draw a Angle");
        }
        else if(number1==3)
        {
              Console.WriteLine("You can draw a Traingle");
        }
        else if(number1==4)
        {
             Console.WriteLine("You can draw 3 shapes i.e. Square,Rectangle,Trapezoid");
        }
        else if(number1==5)
        {
             Console.WriteLine("You can draw Pentagon");
        }
        else
        {
             Console.WriteLine("Please Enter No Between 1 to 5");
         }
    }
}
Output:

0 comments:

Post a Comment