Header Ads

Learn Together, Stay Connected.

সর্ট - ২-C


#include<stdio.h>
#include<math.h>
int main()
{
int a,b,c,d,e,i,ara[5],j,temp;
scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
ara[0]=a;
ara[1]=b;
ara[2]=c;
ara[3]=d;
ara[4]=e;
for(i=0; i<4; i++)
{
for(j=0; j<4; j++)
{

if(ara[j]<ara[j+1])
{
temp=ara[j];
ara[j]=ara[j+1];
ara[j+1]=temp;
}
}

}
for(i=0; i<5; i++)
{
if(i!=4)
{
printf("%d ",ara[i]);
}
else
{
printf("%d\n",ara[i]);
}
}

return 0;
}

No comments

Theme images by Dizzo. Powered by Blogger.