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];    
    printf("Enter Records of 2 students");    
    for(i=0;i<2;i++)
	{    
    printf("\n Enter Rollno:");    
    scanf("%d",&s[i].rollno);    
    printf("\n Enter Name:");    
    scanf("%s",&s[i].name);    
    }    
    printf("\n Student Informations :");    
    for(i=0;i<2;i++)
	{    
    printf("\n Rollno:%d, Name:%s",s[i].rollno,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
08534019974
Designed By : Mridul Gupta

Other Link

About Us

Contact Us

Disclaimer

Privacy Policy