#include <stdio.h>
#include <string.h>
struct school
{
char schoolname[20];
char schoollocation[30];
int numberofpupils;
int year;
};

void main()
{
school schools[3];
int i,totalpupils=0;

schools[0].numberofpupils=12;
schools[0].year=2014;
strcpy(schools[0].schoolname,"BestSchool");
strcpy(schools[0].schoollocation,"Swansea");

schools[1].numberofpupils=11;
schools[1].year=2013;
strcpy(schools[1].schoolname,"GoodSchool");
strcpy(schools[1].schoollocation,"Swansea");

schools[2].numberofpupils=10;
schools[2].year=2012;
strcpy(schools[2].schoolname,"BadSchool");
strcpy(schools[2].schoollocation,"Swansea");

for(i=0;i<3;i++)//add the pupils
{
	
totalpupils=totalpupils+schools[i].numberofpupils;
}
printf("Total pupils %d",totalpupils);

}