APNA
COLLEGE
OPERATORS QUESTIONS
Question :
What will be the output ofthe following programs
t
()
public class Test {
bo
public static void nain (String [] args) {
int x = 2, y = 5;
int expl = (x *
y / x);
h_
int exp2 = (x *
(y / x))
System.out.print (exp1 + ",");
system.out.print (exp2) ;
tc
ba
(i)
public class Test
public static void main (String[l args) {
a
int x = 200, y = 50, z = 100;
if (x > y && y > z) {
ph
System.out.println ("Hello") ;
(z z < x)
if y && {
System.out.println ("Java") ;
al
if( (y+200)< x && (y+150) < z){
System.out.println ("Hello Java") ;
@
)
APNA
COLLEGE
ii)
public class Test {
publicstatic void main (String ll args) {
int x, Y Z
x = Y = z = 2;
X * Y
t
Y **
Z;
z /= (x + y) ;
bo
System.out.println (x +" "+ Y+ " "
+z) ;
h_
(iv)
pubiiC CLasS Test
public static void main (String [l args) {
int x = 9, y = 12
tc
int a = 2, b = 4, c=6;
ba
int exp = 4/3 * (x + 34) +9 *
(a +b * c) + (3 + y * (2 + a))/ (a + b*y)
System.out.println (exp) ;
a
ph
(V)
{
public class Test
public static void main (String [l args)
al
int x = 10, y= 57
int expl = (y * (x / y * x / y));
@
int exp2 = (y *x y +y *
x/ y)i
System. out .println (exp1)
system.out.println (exp2) ;