online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <stdio.h> // 내림차순으로 정렬하는 버블 소트 함수 void bubbleSortDescending(int arr[], int n) { for (int i = 0; i < n - 1; i++) { for (int j = 0; j < n - 1 - i; j++) { // 오름차순: arr[j] > arr[j+1] // if (arr[j] > arr[j + 1]) { // 내림차순: arr[j] < arr[j+1] if (arr[j] < arr[j + 1]) { // swap int temp = arr[j]; arr[j] = arr[j + 1]; arr[j + 1] = temp; } } } } int main(void) { int data[] = { 7, 4, 5, 1, 3 }; int n = sizeof(data) / sizeof(data[0]); printf("정렬 전 배열: [ "); for (int i = 0; i < n; i++) { printf("%d ", data[i]); } printf("]\n"); bubbleSortDescending(data, n); printf("내림차순 정렬 후: [ "); for (int i = 0; i < n; i++) { printf("%d ", data[i]); } printf("]\n"); return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue