Tuesday, 26 November 2013

C# String Hello Program using For loop for beginners-------||||||||

Code:

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

namespace CSharp_Hello_Program_by_Forloop
{
    public class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("\n Enter number so that how many times you want to say Hello");
            int n = int.Parse(Console.ReadLine());
            string str = "Hello";
            for (int i = 1; i <= n; i++)
            {
                Console.WriteLine("\n");
                Console.WriteLine(str);
                Console.ReadKey();
            }
        }
    }
}


Output:




No comments:

Post a Comment