main()
{
struct Batsman
{
char Batsman_name[30];
char Batsman_country[10];
float Batsman_avg;
};
struct Batsman PLAYER[3];
char temp[1];
int i,j,k,l,m;
for (i=0;i<11;i++)
{
printf("Enter Batsman name: ");
gets(PLAYER[i].Batsman_name);
printf("Enter Batsman Country: ");
gets(PLAYER[i].Batsman_country);
printf("Enter Batsman Average: ");
scanf("%f",&PLAYER[i].Batsman_avg);
gets(temp);
}
for(j=0;j<11;j++)
{
m=0;
for(k=0;k
{
m++;
break;
}
if (m==0)
{
printf("\fCountry '%s' batsman are :-\n\n",PLAYER[j].Batsman_country);
for(l=0;l<11;l++)
if(strcmp(PLAYER[j].Batsman_country,PLAYER[l].Batsman_country)==0)
{
printf("%s\t",PLAYER[l].Batsman_name);
printf("%s\t",PLAYER[l].Batsman_country);
printf("%.4f",PLAYER[l].Batsman_avg);
printf("\n");
}
}
}
}
No comments:
Post a Comment