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
What are the characteristics of arrays in c?
When should you use a type cast?
Is c# a good language?
When do we get logical errors?
Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers
Does c have enums?
What is the difference between int main and void main?
How to write a multi-statement macro?
What is scope and lifetime of a variable in c?
What are the various types of control structures in programming?
Explain what are preprocessor directives?
What are the types of macro formats?
State the difference between x3 and x[3].
What are the different types of errors?
Explain union.