// Install Rouge , Pygments and Coderay on your computer
// Add any required attributes in the header for source highlighting - Read chapter
// You can only see the highlighted code in the HTML or PDF Output
// Use asiidoctor or asciidoctor-pdf to render HTML or PDF


= Code Highlighting Example 
:icons: font


// Use Rouge , Pygments and Coderay one by one to highlight the following Python code
//Hint - Use [source,python]


#This is a comment
x, y, z = "Orange", "Banana", "Cherry"
print(x)
print(y)
print(z)
def hello(name):
print("Hello "+ name)
hello("Everyone")


// The following is C++ code for the bubble sort algorithm
// Hint - Use [source,cpp]


#include <iostream>
using namespace std;
// Function to perform bubble sort
void bubbleSort(int arr[], int n) {
    for (int i = 0; i < n - 1; i++) {
        // Track if a swap was made
        bool swapped = false;
        for (int j = 0; j < n - i - 1; j++) {
            // Compare adjacent elements
            if (arr[j] > arr[j + 1]) {
                // Swap if they are in the wrong order
                swap(arr[j], arr[j + 1]);
                swapped = true;
            }
        }
        // If no two elements were swapped, the array is sorted
        if (!swapped) {
            break;
        }
    }
}
// Function to print the array
void printArray(int arr[], int n) {
    for (int i = 0; i < n; i++) {
        cout << arr[i] << " ";
    }
    cout << endl;
}
// Main function
int main() {
    int arr[] = {64, 34, 25, 12, 22, 11, 90};
    int n = sizeof(arr) / sizeof(arr[0]);
    cout << "Unsorted array: ";
    printArray(arr, n);
    bubbleSort(arr, n);
    cout << "Sorted array: ";
    printArray(arr, n);
    return 0;
}


// Can you make line numbers visible in HTML and PDF in the above C++ code
