MCS-011 Problem Solving and Programming

First year, Semester 1

Chapters

Newsletter

Array Subscripts

A subscript is used to refer to individual elements in an array, ranging from 0 to SIZE-1.

Example:

char country[] = "India";

int stud[] = {1, 2, 3, 4, 5};


Array Refrences:


Element no.Subscriptcountry Arrayvaluestud Array

value

10country[0]
'I'stud[0]
1
21country[1]
'n'stud[1]
2
32country[2]
'd'stud[2]
3
43country[3]
'i'stud[3]
4
54country[4]
'a'stud[4]
5


Subscripts provide a way to access and manipulate individual elements within an array.

Report an issue

Reporting: Array Subscripts (topic)

Related Posts