1.Create a student database using an array of structures and apply sorting techniques (Bubble Sort, Insertion Sort, Selection Sort). #include #include struct Student { int rollno; char name[50]; float marks; }; void display(struct Student s[], int n) { printf("\nRollNo\tName\tMarks\n"); for (int i = 0; i < n; i++) { printf("%d\t%s\t%.2f\n", s[i].rollno, s[i].name, s[i].marks); } } // Bubble Sort void bubbleSort(struct Student s[], int n) { struct Student temp; for (int i = 0; i < n - 1; i++) { for (int j = 0; j < n - i - 1; j++) { if (s[j].marks > s[j + 1].marks) { temp = s[j]; s[j] = s[j + 1]; s[j + 1] = temp; } } } } // Insertion Sort void insertionSort(struct Student s[], int n) { int i, j; struct Student key; for (i = 1; i < n; i++) { key = s[i]; j = i - 1; while (j >= 0 && s[j].marks > key.marks) { s[j + 1] = s[j]; j--; } s[j + 1] = key; } } // Selection Sort void selectionSort(struct Student s[], int n) { int i, j, min; struct Student temp; for (i = 0; i < n - 1; i++) { min = i; for (j = i + 1; j < n; j++) { if (s[j].marks < s[min].marks) min = j; } temp = s[i]; s[i] = s[min]; s[min] = temp; } } int main() { struct Student s[50]; int n, choice; printf("Enter number of students: "); scanf("%d", &n); for (int i = 0; i < n; i++) { printf("\nEnter details of student %d\n", i + 1); printf("Roll No: "); scanf("%d", &s[i].rollno); printf("Name: "); scanf("%s", s[i].name); printf("Marks: "); scanf("%f", &s[i].marks); } printf("\nChoose Sorting Technique:\n"); printf("1. Bubble Sort\n2. Insertion Sort\n3. Selection Sort\nEnter choice: "); scanf("%d", &choice); switch (choice) { case 1: bubbleSort(s, n); printf("\nAfter Bubble Sort (by Marks):"); display(s, n); break; case 2: insertionSort(s, n); printf("\nAfter Insertion Sort (by Marks):"); display(s, n); break; case 3: selectionSort(s, n); printf("\nAfter Selection Sort (by Marks):"); display(s, n); break; default: printf("\nInvalid choice!"); } return 0; }