Thursday 22 August 2013

Print star (*) horizontally with space in C#

Q:- Print * 10 times Horizontally with spaces between them using C# Console Application??



using System;
using System.Collections.Generic;
using System.Text;

namespace codeforevenorodd
{
    class Program
    {
        static void Main(string[] args)
        {
            for (int i = 1; i < 11; i++)
            {
                Console.Write("*     ");
            }
            Console.ReadLine();
        }
        }
    }
 

No comments:

Post a Comment