Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public void validateMarks(int [] array){
  2. int [] array1 = new int[5];
  3.  
  4.  
  5. for(int i = 0; i<array.length; i++){
  6. if(array[i] < 0 || array[i] > 100){
  7. int f= array1.length-1;
  8.  
  9. array1[f] = array[i];
  10. array1[f] = 0;
  11. f--;
  12. }
  13.  
  14. else if(array[i] > 0 || array[i] < 100){
  15.  
  16. array1[i] = array[i];
  17.  
  18. }
  19. System.out.println(array1[i]);
  20. }
  21.  
  22.  
  23.  
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement