// Online C compiler to run C program online #include <stdio.h> #include <stdbool.h> int main() { int size; printf("Enter the size of the array: "); scanf("%d", &size); int arrange[size]; bool flag = true; for(int i = 0; i < size; i++){ printf("\nElement - %d: ", i+1); scanf("%d", &arrange[i]); } for(int i = 0; i < size-1; i++){ if(arrange[i] < arrange[i+1]) flag = false; } if(flag == true) printf("The array is sorted in a decending order"); else printf("The array is not sorted in a decending order"); return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter