public static void Main()
Console.WriteLine("Input first number");
int iNumber = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Input number");
int myInt1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Input number");
int myInt2 = Convert.ToInt32(Console.ReadLine());
if (myInt1 > 255 || myInt2 > 255)
Console.WriteLine("These numbers are too big!");
Console.WriteLine("Please enter a whole number.");
string strInput = Console.ReadLine();
bool IsValidNumber = Int32.TryParse(strInput, out intNumber);
if (IsValidNumber == false)
Console.WriteLine("Please enter a valid number!");
Console.WriteLine("Valid whole number is {0}", intNumber);
Console.WriteLine(result);
string[] strNames = new string[4];
Console.WriteLine(strNames.GetUpperBound(0));
int[,] iScores = new int[3,4];
Console.WriteLine("UpperBound for Row is: " + iScores.GetUpperBound(0));
Console.WriteLine("UpperBound for Column is: " + iScores.GetUpperBound(1));
string myString= "My first string.";
intStringSize = myString.Length;
Console.WriteLine("String Length: " + intStringSize);
string xString= "My first string.";
xString= xString.ToUpper();
Console.WriteLine(xString);
string strEmail = "superman@indiana.edu";
strUsername = strEmail.Substring(0, 8);
strDomain = strEmail.Substring(9,11);
Console.WriteLine("{0},{1}",strUsername,strDomain);
string strPhone = "812.212.3456";
strPhone = strPhone.Replace(".", "-");
strPhone = strPhone.Remove(0, 4);
string phone = "8122123456";
phone = phone.Insert(3, "-");
phone = phone.Insert(7, "-");
Console.WriteLine(phone);
string strFirstname = "Homer";
string strLastname = "Simpson";
string strFullname = strFirstname + " " + strLastname;
string strAreaCode, strPhonePart1, strPhonePart2;
string newphone = "812.797.9348";
strAreaCode = newphone.Substring(0, 3);
strPhonePart1 = newphone.Substring(4, 3);
strPhonePart2 = newphone.Substring(8, 4);
strPhone = String.Format("({0})-{1}-{2}", strAreaCode, strPhonePart1, strPhonePart2);
Console.WriteLine(strPhone);
double dblPrice = 119.99;
strPrice = dblPrice.ToString("C2");
Console.WriteLine(strPrice);
double dblPercent = .76458;
strPercent = dblPercent.ToString("P1");
DateTime datToday = DateTime.Now;
string strShortDate, strLongDate ;
strShortDate = String.Format("{0:MM/dd/yyyy}", datToday);
strLongDate = String.Format("{0:dddd, MMMM d, yyyy}", datToday);
Console.WriteLine(strShortDate);
Console.WriteLine(strLongDate);
string strIU = "Celebrating 200 year of Indiana University";
yearLoc = strIU.IndexOf("year");
strIU = strIU.Insert(yearLoc + 4, "s");
Console.WriteLine(strIU);
int[] thisArray = {10,99,55,33,22,16,18};
foreach(int num in thisArray)
totalsum = totalsum + num;
average = totalsum / thisArray.Length;
Console.WriteLine("The average of this array is " + average);