Thursday, 17 November 2016

Array with structure


      Structure may consist of one or more arrays as its elements. As we know when we need to store list of elements, then we can use array. In this case the elements of structures of a specified type.

Example of arrays of structure:

struct student
{

int marks[6];

long rollno;

} s;

In above example structure student it contains one arrays as structure member marks. Where it can store the marks of 6 students.

Program:- 





























Output:






No comments:

Post a Comment