namespace CuriousTabConsoleApplication { class SampleProgram { static void Main(string[ ] args) { int i = 5; int j; fun1(ref i); fun2(out j); Console.WriteLine(i + ", " + j); } static void funl(ref int x) { x = x * x; } static void fun2(out int x) { x = 6; x = x * x; } } }
class Sample { public void MyFun(int i, Single j) { Console.WriteLine("Welcome to CuriousTab !"); } }
delegate void del(int i);
Sample s = new Sample();
del d = new del(ref s.MyFun);
d(10, 1.1f);
delegate void del(int i, Single j);
del d;
Sample s = new Sample();
d = new del(ref s.MyFun);
d(10, 1.1f);
Sample s = new Sample();
delegate void d = new del(ref MyFun);
d(10, 1.1f);
delegate void del(int i, Single]);
Sample s = new Sample();
del = new delegate(ref MyFun);
del(10, 1.1f);
delegate void del(int i, Single j);
del d;
Sample s = new Sample();
d = new del(ref s.MyFun);
d(10, 1.1f);
namespace CuriousTabConsoleApplication { class SampleProgram { static void Main(string[ ] args) { object[] o = new object[] {"1", 4.0, "India", 'B'}; fun (o); } static void fun (params object[] obj) { for (int i = 0; i < obj.Length-1; i++) Console.Write(obj[i] + " "); } } }
int[] intMyArr = {25, 30, 45, 15, 60};
using System;
public class Test
{
public static void Main()
{
int[] intMyArr = { 25, 30, 45, 15, 60, 78, 99 };
Console.WriteLine(intMyArr.Length);
Console.WriteLine(intMyArr.GetUpperBound(0)+1);
}
}
/*
Output :
7
7
*/
namespace CuriousTabConsoleApplication { class SampleProgram { static void Main(string[ ] args) { int i; int res = fun(out i); Console.WriteLine(res); } static int fun (out int i) { int s = 1; i = 7; for(int j = 1; j <= i; j++) { s = s * j; } return s; } } }
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.