#include<conio.h>
#include<stdio.h>
int main()
{
int a[10],sum=0,i,j,temp;
for(i=0;i<=9;i++)
{
printf("enter the value of array");
scanf("%d",&a[i]);
}
for(i=0;i<=9;i++)
{
for(j=0;j<=9;j++)
{
if(a[i]<a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
for(i=0;i<=9;i++)
printf("\n %d",a[i]);
}
#include<stdio.h>
int main()
{
int a[10],sum=0,i,j,temp;
for(i=0;i<=9;i++)
{
printf("enter the value of array");
scanf("%d",&a[i]);
}
for(i=0;i<=9;i++)
{
for(j=0;j<=9;j++)
{
if(a[i]<a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
for(i=0;i<=9;i++)
printf("\n %d",a[i]);
}
No comments:
Post a Comment