Showing posts with label Array in C. Show all posts
Showing posts with label Array in C. Show all posts

Monday, August 27, 2012

ARRANGE THE ELEMENTS IN ARRAY IN DESSENDING ORDER

/*****<soeasyprograms.blogspot.in>*****/
  #include<stdio.h>
 #include<conio.h>
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();