Loading test
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
namespace Loading
{
public static class Program
{
public static void Main()
{
int counter = 0;
Console.WriteLine("Enter a number ");
int num = int.Parse(Console.ReadLine());
int answer = num * num;
int delay;
if (num % 2 == 0)
delay = 500;
else
delay = 1000;
while (counter < 1)
{
Console.Clear();
Console.WriteLine("Loading");
for (int i = 1; i < 8; i++)
{
Console.Write("*");
System.Threading.Thread.Sleep(delay);
}
counter++;
}
Console.Clear();
Console.WriteLine("Program Loaded");
Console.WriteLine("{0}² = {1}", num, answer);
}
}
}
Comments
Post a Comment