#include <stdio.h>


void bubbleSort(int arr[],int n){
    for(int i=0;i<n-1;i++)  {

          for(int j=0;j<n-1;j++){
              if(arr[j]>arr[j+1]);{
              int temp=arr[j];
              arr[j]=arr[j+1];
              arr[j+1]=temp;
          }
          }}
    }
int main(){
int arr[]={12,45,1,78,32,65};
int n=sizeof(arr)/sizeof(arr[0]);
printf("original array:\n");
for(int i=0;i<n;i++)
    {
        printf("%d",arr[i]);
        
    }
bubbleSort(arr,n);
printf("\nsorted array:");
for(int i=0;i<n;i++)
         printf("%d",arr[i]);}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: