Console application declare an array of five integers


Discuss the below:

Q: Create a C# console application in which you declare an array of five integers and store five values in the array. Write a try block in which you place a loop that attempts to access each element of the array, incrementing a subscript from 0 to 10. Create a catch block that catches the eventual IndexOutOfRangeException; within the block, display "Now you've gone beyond the bounds of the array" on the screen.

Solution Preview :

Prepared by a verified Expert
DOT NET Programming: Console application declare an array of five integers
Reference No:- TGS01938007

Now Priced at $20 (50% Discount)

Recommended (95%)

Rated (4.7/5)