public void Main(){ 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();}
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: