Tuesday, November 18, 2014

Functions

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

namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("type any number!");
            ConsoleKeyInfo keyInfo = Console.ReadKey();

            PrintFooToScreen100Times();

            //if (keyInfo.KeyChar == "a")
            //  {
            //   Console.WriteLine("That's not a number!");
            //  }
            //else
            //{
            Console.WriteLine("Did you type {0}", keyInfo.KeyChar.ToString());
            //}
        }
            /// Functions
            static void PrintFooToScreen()
            {
            Console.WriteLine("Foo");
            }
            /// Functions
            static void PrintFooToScreen100Times()
            {
            for (int counter=0; counter <= 100; counter++)
            {
            PrintFooToScreen();
            }
            }

       
    }
}

No comments:

Post a Comment