You are on page 1of 2

NAME: Justine Grace Ferry

SECTION: 1BSIT-3

WEEK 6-8 IF CONDITION LEC ASSESSMENT 2

OUTPUT:

Value of x is -4
Value of y is 14
Value of c is 11
SYNTAX:

public class Main


{
public static void main(String[] args) {

int x=-1, y=7, c=0;

c= y + x * -4;
y += c;
x -= 3;

if (x>0)
{
x++;
}
if ((c>=20) || (y > 8))
{
y += x;
}
else
{
y %= 3;
x *= c;
c--;
}
System.out.println("Value of x is " + x);
System.out.println("Value of x is " + y);
System.out.println("Value of x is " + c);
}
}

You might also like