0 votes
168 views
in C program by (1.7k points)
edited

What is the advantage of an array over individual variables?

1 Answer

0 votes
by (1.7k points)
selected by
 
Best answer
When storing multiple related data, it is a good idea to use arrays. This is because arrays are named using only 1 word followed by an element number. For example: to store the 10 test results of 1 student, one can use 10 different variable names (grade1, grade2, grade3… grade10). With arrays, only 1 name is used, the rest are accessible through the index name (grade[0], grade[1], grade[2]… grade[9]).

Related questions

0 votes
1 answer 123 views
asked May 15, 2022 in C program by Doubtly (98.9k points)
0 votes
1 answer 118 views
+1 vote
1 answer 97 views
0 votes
1 answer 138 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

537 users

...