Header Ads

Learn Together, Stay Connected.

সর্ট - ১-C


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

for(i=0; i<3; i++)
{
for(j=0; j<3; j++)
{

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

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

return 0;
}

No comments

Theme images by Dizzo. Powered by Blogger.