Loops are used for array
input/outputs. To access the individual elements of array, we use subscripts as
a[subscript], where subscript could be a constant integer like 0 , 1, 5 or a
integer variable like i, j or a integer expression like (i+j+2). One important
thing to note is that the value of subscript should be integer. e.g:
|
This example shows how to input array elements by users and output them. This program asks 10 integers from user and then displays these numbers.
Comments
Post a Comment