#include<iostream>
#include<conio.h>
using namespace std;
struct student
{
int rn;
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 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(a[j].score>a[j+1].score)
{
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].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/