Write down the program to sort the array.

Answer Posted / ashutosh shashi

for(i=0;i<n-1;i++)
{
for(j=0;j<n-i-1;j++)
{
if(arr[j] >a[j+1])
{
temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
}

Is This Answer Correct ?    15 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how do you use a pointer to a function?

640


What is formal argument?

648


Explain how can I read and write comma-delimited text?

651


Why calloc is better than malloc?

572


What are enumerated types?

654






What is a const pointer?

632


what is the structure pointer?

1644


What is the advantage of a random access file?

639


Why n++ execute faster than n+1 ?

1842


What are the three constants used in c?

544


What does double pointer mean in c?

576


Why is c so powerful?

683


Explain what is page thrashing?

609


What are header files and explain what are its uses in c programming?

607


What is #define?

573