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
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
What should malloc(0) do?
Can we increase size of array in c?
How do we print only part of a string in c?
How can type-insensitive macros be created?
Explain what does a function declared as pascal do differently?
What do you mean by a sequential access file?
Explain what happens if you free a pointer twice?
Is main an identifier in c?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
List some of the dynamic data structures in C?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
Are there namespaces in c?
What is volatile keyword in c?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.