//The Code I wrote is this
import java.util.*;
class Example{
public static void main(String args[]){
Random input=new Random();
int x;
for(int i=0; i>-1; i++){
x=input.nextInt(99)+1;
int y;
y= (x%2)=1? x : x-1;//***is here any issue?***
System.out.println(y);
}
}
}
//Why can't I compile this? Is there any issue in "Ternary" part?
Aucun commentaire:
Enregistrer un commentaire