123 Eng

### Engineering the engineers™

Home
Source Codes
Engineering Colleges

Training  Reports
Seminar Reports
Placement Papers

Forums

Computer Science / IT
Electronics
Electrical
Mechanical
Chemical
Civil

CAT / MBA

GMAT / Foreign MBA
Latest Jobs

Displaying  Source Code(s)

 Prg. to sort any no. of numeral i/p in ascending or descending order. -------------------------------------------------------------------------------- void sort(void); int c,a[20],l; void main() { clrscr(); printf("Enter no. of elements in the list:- "); scanf ("%d",&l); printf(" CHOICE:-"); printf(" (1) Sort in ascending order."); printf(" (2) Sort in descending order."); printf(" CHOICE:- "); scanf("%d",&c); if (c!=1 && c!=2) { printf(" ERROR"); getch(); exit(0); } sort(); getch(); } void sort(void) { int n,i,j,temp=0,min,k; for (i=1;i<=l;i++) { printf(" Enter no.:- "); scanf("%d",&a[i]); } for (i=1;i<=(l-1);i++) { min=a[i]; k=i; for (j=(i+1);j<=l;j++) { if (a[j]=1;i--) printf(" %d",a[i]); break; default: printf(" ERROR"); } return; }

Contribute content or training reports / feedback / Comments
job placement papers