implement to bubblesort in c language #youtubeshorts #cprogramming #programming #shorts

preview_player
Показать описание
implement to bubblesort in c language #youtubeshorts #cprogramming #programming #shorts
#shirts #youtubeshorts #like #foryou #programming #like
Рекомендации по теме
Комментарии
Автор

#include<stdio.h>
void printarray(int arr[], int n)
{
for(int I=0;I<n;I++)
{
printf("%d", arr[I]);
}
printf("\n");
}
void bubblesort(int arr[], int n)
{
int temp;
int issorted=0;
for(int I=0;I<n-1;I++)
{
for(int j=0;j<n-1-I;j++)
{
if(arr[j]>arr[j+1])
{
temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
}
}
int main()
{
int arr[]={1, 22, 3, 42, 5, 63};
int n=6;
printf ("printing the array before sorting\n");
printarray(arr, n);
bubblesort (arr, n);
printf ("printing the array after sorting\n");
printarray(arr, n);
return 0;
}


Please support💪💪

codewithmames
welcome to shbcf.ru