Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Sok

import java.util.*;

public class Sok{
//static Scanner sc=new Scanner(System.in);

public static void main(String []args){
    int [] lista ={6,3,8,1,5};
    int index= -1;
    int varde=3;
    
    System.out.println("talet finns i listan"+ index);

for(int i = 0; i<lista.length;i++){
    if(lista[i] == varde)
    {
        index = i;
        break;
    }
    }
        //return index;


}
}

//bubbelsortering
/*public static void bubbleSort(double data[]) {
		
		for(int m = data.length-1; m > 0; m--) {
			
			for(int n = 0; n < m; n++) {
				
				if(data[n] > data[n+1]) {
					double temp = data[n];
					data[n] = data[n+1];
					data[n+1] = temp;
				}
			}
		}
	}


//https://www.youtube.com/watch?v=RqfWvIsYmsc



}*/

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.