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, j; int[ , ] arr = new int[ 2, 2 ]; for(i = 0; i < 2; ++i) { for(j = 0; j < 2; ++j) { arr[i, j] = i * 17 + i * 17; Console.Write(arr[ i, j ] + " "); } } } } }
int[][] a = new int[2][]; a[0] = new int[4]{6, 1, 4, 3}; a[1] = new int[3]{9, 2, 7}; Console.WriteLine(a[1].GetUpperBound(0));
struct Emp { public String name; public int age; public Single sal; } Emp e = new Emp();
e.name = "Amol";
e.age = 25;
e.sal = 5500;
With e
{
.name = "Amol";
.age = 25;
.sal = 5500;
}
With emp e
{
.name = "Amol";
.age = 25;
.sal = 5500;
}
e -> name = "Amol";
e -> age = 25;
e -> sal = 5500;
name = "Amol";
age = 25;
sal = 5500;
e.name = "Amol";
e.age = 25;
e.sal = 5500;
struct Book { private String name; protected int totalpages; public Single price; public void Showdata() { Console.WriteLine(name + " " + totalpages + " " + price); } Book() { name = " "; totalpages = 0; price = 0.0f; } } Book b = new Book();
class Trial { int i; Decimal d; } struct Sample { private int x; private Single y; private Trial z; } Sample samp = new Sample();
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.