C > Beginners Lab Assignments
Program to sort an array in decending order
Program to sort an array in decending order #include
#include
void main() { int i[100],j[100],temp[100]; int a,b=1,c,i1=2,k,b2=0; printf("ENTER NUMBER OF DATA (MAXIMUM 100):"); scanf("%d",&k); printf("ENTER DATA (IN INTEGER): "); for(a=0;a
0) { temp[a]=i[b]; temp[b]=i[a]; i[a]=temp[a]; i[b]=temp[b]; } for(c=i1;c
0) { temp[a]=i[c]; temp[c]=i[a]; i[a]=temp[a]; i[c]=temp[c]; } } i1++; } printf(" YOUR ARRAY IN DECENDING ORDER IS AS FOLLOWS: YOUR ARRAY[%d]= ",k); for(b2=0;b2
C Codes
Beginners
C on Unix
Code Snippets
Data Structures
File Operations
Games Graphics
Gnu-Linux
Hardware
Mathematics
Miscellaneous
Small Programs
Sorting