Guest User

Untitled

a guest
Mar 23rd, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. int[] Math={85,65,40,20};
  2. int[] English={35,55,68,75};
  3. int[] ICT={50,35,69,95};
  4.  
  5. int i;
  6. int x=1;
  7.  
  8. int[] marks;
  9.  
  10. if (x==1) {
  11. marks=Math;
  12. }
  13. else if (x==2) {
  14. marks=English;
  15. }
  16. else if (x==3) {
  17. marks=ICT;
  18. }
  19. for (i=0; i<4; i++ )
  20. {
  21. // check Marks array inside a for loop
  22. }
  23.  
  24. int[] Math = {85,65,40,20};
  25. int[] English = {35,55,68,75};
  26. int[] ICT = {50,35,69,95};
  27.  
  28. int i;
  29. int x=1;
  30.  
  31. int[] marks = new int[4];
  32.  
  33. if (x==1) {
  34. marks=Math;
  35. }
  36. else if (x==2) {
  37. marks=English;
  38. }
  39. else if (x==3) {
  40. marks=ICT;
  41. }
  42.  
  43. for (i=0; i<4; i++ )
  44. {
  45. System.out.print(marks[i] + " ");
  46. }
Add Comment
Please, Sign In to add comment