Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
127 views
in Arrays by (29.8k points)
closed by

Suppose you are given Total mark of 50 students in a class 

1. How will you store these values using ordinary variable? 

2. Is there any other efficient way to store these values? Give reason.

1 Answer

+1 vote
by (29.6k points)
selected by
 
Best answer

We have to declare 50 variables individually to store total marks of 50 students. It is a laborious work. 

Hence we use array, it is an efficient way to declare 50 variables. With a single variable name we can store multiple elements.

eg: int mark[50]. 

Here we can store 50 marks. 

The first mark is in mark[0], second is in mark[1]…. etc the fiftieth mark is in mark[49],

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...