#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 solving method using C. Show all posts
Showing posts with label Bubble sort solving method using C. Show all posts
Subscribe to:
Posts (Atom)
IAF Agniveervayu Recruitment Rally 2026: Check Eligibility, Dates, Venues & Selection Process
IAF Agniveervayu Recruitment Rally 2026: Check Eligibility, Dates, Venues & Selection Process IAF Agniveervayu Recruitment Rally 2026 fo...
-
Date of Job Mela: November 12th 13th 2016 Venue: Karwar Medical College Time: 10.00 am Job Oppurtunity for all categories: Inform...
-
Union Bank Recruitment 2026-27: 395 Officer Vacancies, Apply from July 21 Union Bank of India Recruitment Project 2026-27 opens July 21, 20...