programplug Logo




C++ Structure With Array


Structure can store many information of different data types.Collection of structures is known as array of structure.

    #include    
    struct student
	{    
    int rollno;    
    char name[10];    
    };    
    void main()
	{    
    int i;    
    struct student s[2];    
    cout<<"Enter Records of 2 students";    
    for(i=0;i<2;i++)
	{    
    cout<<"Enter Rollno:";    
    cin>>s[i].rollno;    
    cout<<"\n Enter Name:";    
    cin>>s[i].name;    
    }    
    cout<<"\n Student Informations :";    
    for(i=0;i<2;i++)
	{    
    cout<<"\n Rollno: "<< s[i].rollno;
	cout<<"\n Name:" << s[i].name;    
    }     
    }    

Output
Enter Records of 2 students
Enter Rollno:1
Enter Name:Rahul Bisht
Enter Rollno:2
Enter Name:Rohit Kumar
Student Informations:
Rollno:1, Name:Rahul Bisht
Rollno:2, Name:Rohit Kumar






Our Services

Developing Cheapest Websites
Offer Digital Marketing
Provide College Projects
Attractive Website Developing
Summer Training,Industrial Training
SCO,SMO

Contact Us

Dehradun Uttarakhand India
www.programplug.com
info@programplug.com
000000000

Other Link

About Us

Contact Us

Disclaimer

Privacy Policy