#include<stdio.h>
int main() {
int arr[5] = {44, 33, 55, 22, 11};
int temp;
for(int i = 0; i<=3; i++) {
for(int j = 0; j<=3; j++ ) {
if(arr[j] > arr[j + 1]) {
temp = arr[j];
arr[j] = arr[j + 1];
arr[j+1] = temp;
}
}
}
for(int i = 0; i<=4; i++) {
printf("%d", arr[i]);
}
return 0;
}
Saturday, November 27, 2021
Subscribe to:
Post Comments (Atom)
Priority queue deleting elements after ascending inputs Gaand Fadd
using namespace std; #include<iostream> #define N 5 class pq { public: int* arr; int front; int rear; pq() { ...
-
//See sabse pehle ek khali node bana lena jiska prev and next null ho uske bad use return kar le fir saare operation perform kar lena //Tim...
-
#include<stdio.h> #include<stdlib.h> struct node { int data; struct node* next; }; void add(struct node** tail, int val...
-
#include<stdio.h> #include<stdlib.h> struct node { int data; struct node* next; }; void inElFr(struct node** head, int ...
No comments:
Post a Comment