Showing posts with label ARRANGE THE ELEMENTS IN ARRAY IN DESSENDING ORDER. Show all posts
Showing posts with label ARRANGE THE ELEMENTS IN ARRAY IN DESSENDING ORDER. Show all posts

ARRANGE THE ELEMENTS IN ARRAY IN DESSENDING ORDER

main()
{
int a[100],i,n,j,search,temp;
printf("\n how many no's in array");
scanf("%d",&n);
printf("\n enter %d elements in array",n);
for(i=0;i
scanf("%d",&a[i]);
for(i=0;i
{
for(j=i+1;j
{
if(a[i]
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
printf("%4d",a[i]);
}
getch();
}

Labels