Answer Posted / rama krishna sidhartha
//code for ascending order
for(i=0;i<n-1;i++)
{
for(j=1+1;j<n;j++)
{
if(a[j] >a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
//code for descending order
for(i=n-1;i>0;i--)
{
for(j=n;j>i+1;j--)
{
if(a[j]<a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
| Is This Answer Correct ? | 7 Yes | 4 No |
Post New Answer View All Answers
Differentiate between Macro and ordinary definition.
Explain what is operator promotion?
What is the use of ?
Explain the properties of union. What is the size of a union variable
what type of questions arrive in interview over c programming?
Does free set pointer to null?
Why pointers are used in c?
What does. int *x[](); means ?
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
What is the advantage of a random access file?
Tell us something about keyword 'auto'.
What are the functions to open and close the file in c language?
Why c is called top down?
What is integer constants?
What would be an example of a structure analogous to structure c?