1

Consider the following program:
int result=0, x = 1 ;
while (x <= 10)
{
if (x%2 == 0)
result += x ;
++x ;
}
System.out.println(result) ;

Which of the following will be the output of the above program?

  • A

    55

  • B

    30

  • C

    25

  • D

    35