#include<stdio.h>
#include<conio.h>
void main()
{
int arr[10],i,n,x,m;
clrscr();
printf("enter the number of size:");
scanf("%d",&n);
printf("enter the value:");
for (i=0;i<n;i++)l
{
scanf("%d",&arr[i]);
}
for (i=0;i<n-1;i++)
{
for (x=i+1;x<n;x++)
{
if(arr[x]>arr[i])
{
m=arr[i];
arr[i]=arr[x];
arr[x]=m;
}
}
}
printf("asendeing order:\n");
for(i=0;i<n;i++)
{
printf("%d ",arr[i]);
}
getch();
}
#include<conio.h>
void main()
{
int arr[10],i,n,x,m;
clrscr();
printf("enter the number of size:");
scanf("%d",&n);
printf("enter the value:");
for (i=0;i<n;i++)l
{
scanf("%d",&arr[i]);
}
for (i=0;i<n-1;i++)
{
for (x=i+1;x<n;x++)
{
if(arr[x]>arr[i])
{
m=arr[i];
arr[i]=arr[x];
arr[x]=m;
}
}
}
printf("asendeing order:\n");
for(i=0;i<n;i++)
{
printf("%d ",arr[i]);
}
getch();
}
0 Comments