Practical No 6 - 7 Bubble Sort
Practical No 6 - 7 Bubble Sort
#include <stdio.h>
int main()
scanf("%d", &n);
scanf("%d", &array[i]);
if (array[j] > array[j+1]) /* For decreasing order use '<' instead of '>' */
temp = array[j];
array[j] = array[j+1];
array[j+1] = temp;
printf("%d\n", array[i]);
return 0;
OUTPUT:-
Enter 4 integers
8692
9
// Practical NO 7 WAP to perform Bubble sort on String data
#include <stdio.h>
#include <string.h>
int main() {
printf("\n\nSorts the strings of an array using bubble sort :\n"); // Display information about the
task
printf("-----------------------------------------------------\n");
printf("%s\n", name[i],stdin);
OUTPUT:-
-----------------------------------------------------
Input string 4 :
Digital Techniques
Data Structures
-----------------------------------------------------
Data Structures
Digital Techniques
-----------------------------------------------------