Reference no: EM131390191 , Length: 2
Question: I got this question in class of software testing and I want you to do it in statement coverage method.
1. public class arrSort
2. {
3. public static void main (String args[])
4. {
5. int num[]=new int[] {20, 50, 10, 70, 40, 80, 30, 90, 60};
6. int t=0;
7. for (int i=0; i<num.lenght; i++)
8. {
9. for (int j=i+1; j<num.length; j++)
10. if (num[i]>num[j])
11. {
12. t=num[i];
13. num[i]=num[j];
14. num[j]=t;
15. }
16. }
17. System.out.println("Sorting elements in Ascending Order:\n");
18. for (int i=0; i<num.lenght; i++)
19. System.out.println(num[i]);
20. }
21. }
Attachment:- Assignment Files.rar