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:
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