Answers for "how to move all negative number of array in java"

0

how to move all negative number of array in java

static void arrangebySign(int a[],int s){
		
		int j=0,temp;
		for(int i=0;i<s;i++){
			if(a[i]<0){
				if(i != j){
					temp=a[i];
					a[i]=a[j];
					a[j]=temp;
				}
				j++;
			}
			
		}
		
	}
Posted by: Guest on September-12-2021

Code answers related to "how to move all negative number of array in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language