Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a program to implement a bubble sort algorithm on an array.

Medium

Problem Statement

Write a program to implement a bubble sort algorithm on an array.

Sample Input

int arr[] = {64, 34, 25, 12, 22, 11, 90};

Sample Output

Sorted array: 11 12 22 25 34 64 90 

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
#include <iostream> int main() { int arr[] = {64, 34, 25, 12, 22, 11, 90}; // Logic to implement bubble sort return 0; }
Log in or sign up to run or submit your code.Log inSign up
Input
int arr[] = {64, 34, 25, 12, 22, 11, 90};
Expected Output
Sorted array: 11 12 22 25 34 64 90