MCQs > IT & Programming > C Programming > Following code where num is an integer array and n is the length of the array: for(i=0;i num[j]) { var=num[i]; num[i]=num[j]; num[j]=var; } } } What does the above code do?

C Programming MCQs

Study the following code where num is an integer array and n is the
length of the array:
for(i=0;i<n-1;i++)
{
 
for(j=i+1;j<n;j++)
{
if(num[i] > num[j])
{
var=num[i];
num[i]=num[j];
num[j]=var;
}
}
}
What does the above code do?

Answer

Correct Answer: It sorts the array in the ascending order

Explanation:

Note: This Question is unanswered, help us to find answer for this one

C Programming Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

C Programming Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it