Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. /* Bubble Sort */ 2. #include <stdio.h> 3. #include <stdlib.h> 4. 5. #define

ID: 3648705 • Letter: 1

Question

1. /* Bubble Sort */
2. #include <stdio.h>
3. #include <stdlib.h>
4.
5. #define MAX 10
6.
7. int a[MAX];
8. int rand_seed=10;
9. void bubble_sort(int m);
10.
11. int main(void)
12. {
13. int i;
14. /* fill array */
15. for (i=0; i < MAX; i++)
16. {
17. a[i]=rand();
18. printf("%d ",a[i]);
19. }
20. bubble_sort(MAX);
21. /* print sorted array */
22. printf("-------------------- ");
23. for (i=0; i < MAX; i++)
24. printf("%d ",a[i]);
25.
26. return 0;
27. }
28.
29.
30. void bubble_sort(int m)
31. {
32. int x,y,t;
33. for (x=0; x < m-1; x++)
34. for (y=0; y < m-x-1; y++)
35. if (a[y] > a[y+1])
36. {
37. t=a[y];
38. a[y]=a[y+1];
39. a[y+1]=t;
40. }
41. }
I

which line is a compiler directive?
A. 2,3
B. 7,8
C. 9,30
D. 20,30

Explanation / Answer

C. 11