Saturday 30 July 2016

Star Programming 7

Introduction


Hi guys, today I will show you how to write a basic star programming in C#, this is generally helpful to the fresher and whoever preparing for interviews.

My previous article was Star Programming 6

static void Main(string[] args)
{
    Console.WriteLine("Please Enter a number");
    int num = Convert.ToInt32(Console.ReadLine());
    for (int i = num; i>0; i--)
    {
        for (int k = i; k < num; k++)
        {
            Console.Write(" ");
        }
        for (int j = 0; j < i; j++)
        {
            Console.Write("*");
        }
        Console.WriteLine();
    }
}

Star Programming 6

Introduction


Hi guys, today I will post how to write a basic star programming in C#, this is generally helpful to the fresher and whoever preparing for interviews.

My previous article was Star Programming 5

static void Main(string[] args)
{
    Console.WriteLine("Please Enter a number");
    int num = Convert.ToInt32(Console.ReadLine());
    for (int i = 0; i < num; i++)
    {
        for (int k = num-1; k > i; k--)
        {
            Console.Write(" ");
        }
        for (int j = 0; j <= i; j++)
        {
            Console.Write("*");
        }
        Console.WriteLine();
    }
}

Star Programming 5

Introduction


Hi guys, today I will post how to write a basic star programming in C#, this is generally helpful to the fresher and whoever preparing for interviews.

My previous post was Star Programming 5 


static void Main(string[] args)
{
    Console.WriteLine("Please Enter a number");
    int num = Convert.ToInt32(Console.ReadLine());
    for (int i = 0; i < num; i++)
    {
        for (int j = 0; j < i; j++)
        {
            if ((i + j) % 2 == 0)
                Console.Write("0");
            else
                Console.Write("1");
        }
        Console.WriteLine();
    }
}

Star Programming 4

Introduction


Hi guys, today I will post how to write a basic star programming in C#, this is generally helpful to the fresher and whoever preparing for interviews.

My previous post was Star Programming 3

static void Main(string[] args)
{
    Console.WriteLine("Please Enter a number");
    int num = Convert.ToInt32(Console.ReadLine());
    for (int i = num; i > 0; i--)
    {
        for (int j = 0; j < i; j++)
        {
            Console.Write("*");
        }
        Console.WriteLine();
    }
}

Friday 29 July 2016

Star Programming 3

Introduction


Hi guys, today I will post how to write a basic star programming in C#, this is generally helpful to the fresher and whoever preparing for interviews.

My previous post was Star Programming 2

static void Main(string[] args)
{
    Console.WriteLine("Please Enter a number");
    int num = Convert.ToInt32(Console.ReadLine());
    for (int i = num; i>0; i--)
    {
        for (int k = num - i; k > 0; k--)
        {
            Console.Write(" ");
        }
        for (int j = 2*i-1; j>0; j--)
        {
            Console.Write("*");
        }
        Console.WriteLine();
    }
}

Thursday 28 July 2016

Star Programming 2

Introduction

Hi guys, today I will post how to write a basic star programming in C#, this is generally helpful to the fresher and whoever preparing for interviews.


Previously I had posted   Star Programming 1        


static void Main(string[] args)
{
    Console.WriteLine("Please Enter a number");
    int num = Convert.ToInt32(Console.ReadLine());
    for (int i = 0; i < num; i++)
    {
        for (int k = 0; k < num - i-1; k++)
        {
            Console.Write(" ");
        }
        for (int j = 0; j <2 * i + 1; j++)
        {
            Console.Write("*");
        }
        Console.WriteLine();
    }
}

Star Programming 1

Introduction


Hi guys, today I will post how to write a basic star programming in C#, this is generally helpful to the fresher and whoever preparing for interviews. Slowly I will post more Star Programming related articles.

*
**
***
****
*****
******
*******
********

static void Main(string[] args)
{
    Console.WriteLine("Enter a number");
    int num = Convert.ToInt32(Console.ReadLine());
    for (int i = 0; i < num; i++)
    {
       for (int j = 0; j <= i; j++)
       {
           Console.Write("*");
       }
       Console.WriteLine();
    }
}