#include<stdio.h>
#include<conio.h>
void main()
{
int array[25], num, i, j, temp;
clrscr();
printf ("Please Enter the maximum elements\n");
scanf ("%d",&num);
printf ("Please Enter the elements to be sort:\n");
for (i = 0; i < num; i++)
scanf ("%d", &array[i]);
for (j = 0; j < num - 1; j++){
temp = array[0];
for (i = 1; i < num; i++){
if (array[i] < temp){
array[i - 1] = array[i];
array[i] = temp;
}
else
temp = array[i];
}
}
printf ("Sorted Elements are:\n");
for (i = 0; i < num; i++)
printf("%d\n", array[i]);
}
Showing posts with label Bubble sort using C. Show all posts
Showing posts with label Bubble sort using C. Show all posts
Subscribe to:
Posts (Atom)
How to Answer "Do You Use AI?" in an Interview (Without Lying or Bragging) – 2026 Guide
How to Answer "Do You Use AI?" in an Interview (Without Lying or Bragging) – 2026 Guide Learn how to answer "Do you use AI?...
-
Date of Job Mela: November 12th 13th 2016 Venue: Karwar Medical College Time: 10.00 am Job Oppurtunity for all categories: Inform...
-
Walkin Interview in SLK Software Bangalore June 11th 12th 2011 Date: 11th and 12th June 2011 (Saturday and Sunday) Time: NA Venue: ...