0 LIKES LikeUnLike
And please tell me the benefit as well#include <iostream.h>void sort(void);int n[10];main(){for (int i=0;i<=9;i++){ cout<<"Enter value "<<(i+1)<<":"; cin>>n[i]; } cout<<"\nVALUES YOU ENTERED:\n\n"; for(int j=0;j<=9;j++) cout<<n[j]<<"\n"; //sorting sort(); cout<<"\nSORTED LIST:\n "; for (int k=0;k<=9;k++) cout<<n[k]<<endl; system("pause"); }void sort(void){int temp;for (int i=0;i<=9;i++) { for(int j=0;j<=9;j++) { if (i==j) { continue; } else if (n[i]>n[j]) { temp = n[i]; n[i] = n[j]; n[j] = temp; } } } }
Tags:
Report (0) (0) | earlier
Latest activity: earlier. This question has 1 answers.