0 votes
159 views
in C program by (98.9k points)
edited

How do you access the values within an array?

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer
Arrays contain a number of elements, depending on the size you gave it during variable declaration. Each element is assigned a number from 0 to number of elements-1. To assign or retrieve the value of a particular element, refer to the element number. For example: if you have a declaration that says “intscores[5];”, then you have 5 accessible elements, namely: scores[0], scores[1], scores[2], scores[3] and scores[4].

Related questions

0 votes
1 answer 125 views
0 votes
1 answer 116 views
0 votes
1 answer 134 views
0 votes
1 answer 105 views
asked May 14, 2022 in C program by CodeWithHarry (1.7k points)
0 votes
1 answer 180 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

554 users

...