using System; namespace CuriousTabConsoleApplication { class MyProgram { static void Main(string[] args) { int index; int val = 55; int[] a = new int[5]; try { Console.Write("Enter a number: "); index = Convert.ToInt32(Console.ReadLine()); a[index] = val; } catch(FormatException e) { Console.Write("Bad Format "); } catch(IndexOutOfRangeException e) { Console.Write("Index out of bounds "); } Console.Write("Remaining program "); } } }
Console.WriteLine(13 / 2 + " " + 13 % 2);
int[][]intMyArr = new int[2][]; intMyArr[0] = new int[4]{6, 1, 4, 3}; intMyArr[1] = new int[3]{9, 2, 7};
Sample.Length = 20;
Sample m = new Sample(); m.Length = 10;
Console.WriteLine(Sample.Length);
Sample m = new Sample(); int len; len = m.Length;
Sample m = new Sample(); m.Length = m.Length + 20;
interface IMyInterface { void fun1(); void fun2(); } class MyClass: IMyInterface { private int i; void IMyInterface.fun1() { // Some code } }
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.