Com base no código abaixo, informe qual o valor de y que será escrito quando o programa for executado.
public class Compara
{
public static void main(String args[])
{
Int x = 10, y=0;
if(x < 10)
y = 1;
if(x>=10)
y = 2;
System.out.println("O valor de y é " + y);
}
}
public class Compara
{
public static void main(String args[])
{
Int x = 10, y=0;
if(x < 10)
y = 1;
if(x>=10)
y = 2;
System.out.println("O valor de y é " + y);
}
}
- A)0
- B)1
- C)2
- D)3