I have a code as shown below, which produces output as below
83,72,91,42,0,78,92,81,68,0,82,55,36,22,11,
but actually I want output in ascending order like
0,0,11,22,36,42,55,68,72,78,81,82,83,91,92
How it can be done?
Code:#include <iostream> #include <stdio.h> using namespace std; int main () { int array[3][5]= {{83,72,91,42},{78,92,81,68},{82,55,36,22,11}},i,j; for (i=0; i<3; i++) { for (j=0; j<5; j++) { cout << array[i][j]; cout << ","; } } cin.get (); }