#include<iostream>
#include<conio.h>
#include<string.h>
using namespace std;
struct student
{
int rn;
char name[15];
int score;
};
void get(student s[],int n)
{
for(int i=0;i<n;i++)
{
cout<<"ENTER ROLL NO.:";
cin>>s[i].rn;
cout<<"ENTER NAME:";
cin>>s[i].name;
cout<<"ENTER SCORE:";
cin>>s[i].score;
}
}
void bubblesort(student a[],int n)
{
int i,j,flg;
student temp;
for(i=0;i<n;i++)
{
flg=0;
for(j=0;j<n-i-1;j++)
{
if(strcmp(a[j].name,a[j+1].name)>0)
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
flg=1;
}
}
if(flg==0)
break;
}
for(i=0;i<n;i++)
cout<<a[i].rn<<" "<<a[i].name<<" "<<a[i].score<<endl;
}
int main()
{
student s[10];
int n;
char ans;
system("cls");
cout<<endl<<endl;
cout<<"*****************************************************************************";
cout<<endl<<endl;
cout<<"ENTER NUMBER OF RECORDS YOU WANT TO ADD(max 10):";
cin>>n;
get(s,n);
bubblesort(s,n);
cout<<"*****************************************************************************";
getch();
return 0;

}

USERS VISITED
http://www.hitwebcounter.com/