#include<stdio.h>int main() {int a[50], n, i, j, temp = 0;printf("Enter how many numbers you want:\n");scanf("%d", &n);printf("Enter the %d elements:\n", n);for (i = 0; i < n; i++) {scanf("%d", &a[i]);}printf("\n\t\tThe given array is:\n");for (i = 0; i < n; i++) {printf("\n\t\t%d", a[i]);}for (i = 0; i < n; i++) {for (j = i + 1; j < n; j++) {if (a[i] > a[j]) {temp = a[i];a[i] = a[j];a[j] = temp;}}}printf("\n\n\n\t\tThe sorted array using Buble sort is:\n");for (i = 0; i < n; i++) {printf("\n\t\t%d", a[i]);}return 0;}
- Home
- C Programming
- _Algorithm & Flow Chart in C
- _Introduction to C
- _Control Statement & Looping
- _Function in C
- _Array in C
- _Pointer in C
- _Structure & Union in C
- _List of C Programs
- __Tricky Programs
- __Pattern in C
- _C Compiler
- _C Programming हिंदी में (Videos के साथ)
- C++ Programming
- _List of C++ Programs
- _C/C++ Questions
- _Minor Project 2021-22
- Projects
- App. Physics
- _Assignment 1 (2023-24)
- _Assignment 2 (2023-24)
- _Assignment 3 (2023-24)
- _AP Assignment 2
- _AP Assignment 3
- _Assignment No.2.1
- _Assignment No. 2.2
- _Office Automation & Tools
- _Introduce Yourself
- Online Exams
- _Online Attendance
- _Interview Questions
- _Youtube Channel
- More Tutorials
- _UPBTE Links
- _URISE
- _Internal Marks
- _Enrolment No
- _More Tutorials