1 Bubble Sort
1 Bubble Sort
#include<string.h>
using namespace std;
"\n4. Exit";
cin>>choice;
switch(choice)
{
case 1:
{
cout<<"\nEnter number of records:";
cin>>n;
for(int i=0;i<n;i++)
{
cout<<"\nEnter roll number:";
cin>>student[i].roll_num;
cout<<"\nEnter name:";
cin>>student[i].name;
cout<<"\nEnter marks:";
cin>>student[i].marks;
}
break;
}
case 2:
{
cout<<"\n\tRoll number\tName\tMarks";
for(int i=0;i<n;i++)
{
cout<<"\n\t"<<student[i].roll_num<<"\t"<<student[i].name<<"\
t"<<student[i].marks;
}
break;
}
case 3:
{
bubble_sort(student,n);
break;
}
case 4:
{
break;
}
}
}while(choice!=4);
return 0;
}