DATA STRUCTURES

A linear array “marks” consisting of the MARKS” OF FIVE STUDENTS OF CLASS

MARKS array position

250
241
262
273
234

MARKS IS NAME OF THE ARRAY AND 25,24,26,27 ARE ITS DATA STRUCTURE ELEMENTS

                Marks[0] denotes 25

                Marks[1] denotes 24

                Marks[2] denotes 26

                Marks[3] denotes 27

                Marks[4] denotes 23

Length of array “marks” is UB-LB+1

Here UB=4, LB=0

Length=4-0+=5

PROGRAM: WAP TO READING AND WRITING OF THE ARRAY

# include<stdio.h>

main()

int a[10],i;

printf(“enter the array”);

for(i=0;i<=9;i++)

{

scanf(“”%d”,,&a[i]);

}

printf(“the entered the array”);

for(i=0;i<=9;i++)

{

printf(”%d”,,a[i]);

}

Output:

Enter the array 12345678910

1

2

3

4

5

6

7

8

9

10

Leave a Reply

Your email address will not be published. Required fields are marked *