What is the advantage of an array over individual variables?

4 years ago
C Programming

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]).

0
Sanisha Maharjan
Jan 20, 2022
More related questions

Questions Bank

View all Questions