Warning: mkdir(): No space left on device in /var/www/hottg/post.php on line 59

Warning: file_put_contents(aCache/aDaily/2025-07-22/post/C_Codings/--): Failed to open stream: No such file or directory in /var/www/hottg/post.php on line 72
126. Program to sort array using Bubble Sort. @C Language πŸ‘¨β€πŸ’»
TG Telegram Group & Channel
C Language πŸ‘¨β€πŸ’» | United States America (US)
Create: Update:

126. Program to sort array using Bubble Sort.

#include<stdio.h>
#include<conio.h>

void main()
{
int total, element[100], i, j, temp;
clrscr();

printf("Enter total number of elements :");
scanf("%d", &total);

for(i=0; i<total; i++)
{
printf("Enter element no%d :", i+1);
scanf("%d", &element[i]);
}

for (i=0; i<(total - 1); i++)
{
for (j = 0; j < total - 1; j++)
{
if (element[j] > element[j + 1])
{
temp = element[j];
element[j] = element[j + 1];
element[j + 1] = temp;
}
}
}

printf("\nSorted list in ascending order :");

for (i = 0; i < total; i++)
{
printf("\n%d", element[i]);
}
getch();
}
//To sort in descending order, use < (less than) in if condition.
@C_Codings

126. Program to sort array using Bubble Sort.

#include<stdio.h>
#include<conio.h>

void main()
{
int total, element[100], i, j, temp;
clrscr();

printf("Enter total number of elements :");
scanf("%d", &total);

for(i=0; i<total; i++)
{
printf("Enter element no%d :", i+1);
scanf("%d", &element[i]);
}

for (i=0; i<(total - 1); i++)
{
for (j = 0; j < total - 1; j++)
{
if (element[j] > element[j + 1])
{
temp = element[j];
element[j] = element[j + 1];
element[j + 1] = temp;
}
}
}

printf("\nSorted list in ascending order :");

for (i = 0; i < total; i++)
{
printf("\n%d", element[i]);
}
getch();
}
//To sort in descending order, use < (less than) in if condition.
@C_Codings


>>Click here to continue<<

C Language πŸ‘¨β€πŸ’»




Share with your best friend
VIEW MORE

United States America Popular Telegram Group (US)


Warning: Undefined array key 3 in /var/www/hottg/function.php on line 115

Fatal error: Uncaught mysqli_sql_exception: Too many connections in /var/www/db.php:16 Stack trace: #0 /var/www/db.php(16): mysqli_connect() #1 /var/www/hottg/function.php(212): db() #2 /var/www/hottg/function.php(115): select() #3 /var/www/hottg/post.php(351): daCache() #4 /var/www/hottg/route.php(63): include_once('...') #5 {main} thrown in /var/www/db.php on line 16