0 votes
162 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 127 views
0 votes
1 answer 128 views
0 votes
1 answer 101 views
0 votes
1 answer 136 views
0 votes
1 answer 107 views
asked May 14, 2022 in C program by CodeWithHarry (1.7k points)
0 votes
1 answer 182 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

559 users

...