publicvoidMain()
{
int[] a = new[];
int i = 0;
int n = 0;
int lb = 0;
int ub = 0;
int length = 0;
int p = 0;
Console.WriteLine("Enter the Five Number:=>");
for (i = 1; i <= 5; i++) {
a[i] = Console.ReadLine();
lb = a.GetLowerBound(0);
ub = a.GetUpperBound(0);
length = a.GetLength(0);
}
Console.WriteLine("LowerBound:=>" + lb);
Console.WriteLine("UpperBound:=>" + ub);
Console.WriteLine("Length:=>" + length);
for (i = 1; i <= 5; i++) {
Console.WriteLine("ARRAY:=>" + a[i]);
}
Array.Resize(ref a, 11);
Console.WriteLine("Enter the Five Number:=>");
for (i = 6; i <= 10; i++) {
a[i] = Console.ReadLine();
lb = a.GetLowerBound(0);
ub = a.GetUpperBound(0);
length = a.GetLength(0);
}
Console.WriteLine("LowerBound:=>" + lb);
Console.WriteLine("UpperBound:=>" + ub);
Console.WriteLine("Length:=>" + length);
for (i = 6; i <= 10; i++) {
Console.WriteLine("ARRAY:=>" + a[i]);
}
Console.WriteLine("The Final Array After Reassigning : ");
for (i = 1; i <= 10; i++) {
Console.WriteLine("A(" + i + ") = " + a[i]);
}
Console.ReadLine();
}
0 comments
Comments
Join the conversation! Your thoughts help the community grow.
Join to leave a comment
Members earn 10 SHARP for a comment, 10 SHARP for a reaction, and 250 SHARP for every blog they publish.
Join the conversation! Your thoughts help the community grow.