https://github.com/patilyashh/ascending-array-
Day 12 of 75 Days C programing challenge || #12 ||
https://github.com/patilyashh/ascending-array-
Last synced: 11 months ago
JSON representation
Day 12 of 75 Days C programing challenge || #12 ||
- Host: GitHub
- URL: https://github.com/patilyashh/ascending-array-
- Owner: PATILYASHH
- Created: 2024-02-22T16:14:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-22T16:24:52.000Z (over 2 years ago)
- Last Synced: 2025-01-13T03:33:19.319Z (over 1 year ago)
- Language: C
- Size: 79.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sorting Array of Integers in Ascending Order
This C program sorts an array of integers in ascending order using the bubble sort algorithm.
## Usage
1. Compile the program using a C compiler such as GCC:
```
gcc -o sort_integers sort_integers.c
```
2. Run the compiled executable:
```
./sort_integers
```
## Description
The program initializes an array of integers with some values. It then sorts the array in ascending order using the bubble sort algorithm. Finally, it prints the sorted array to the console.
## Algorithm
1. Start with an unsorted array of integers.
2. Iterate through the array and compare each pair of adjacent elements.
3. If the elements are in the wrong order, swap them.
4. Repeat steps 2-3 until the entire array is sorted.
5. Print the sorted array.
## Example
Given the array: `{978, 654, 2645, 5687, 2453, 9678}`
After sorting, the array becomes: `{654, 2453, 2645, 5687, 9678, 978}`
## License
This program is licensed under the [MIT License](https://opensource.org/licenses/MIT).