Operators Questions
Operators Questions
Operators Questions
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 (exp2) ;
tc
ba
(i)
public class Test
System.out.println ("Hello") ;
(z z < x)
if y && {
System.out.println ("Java") ;
al
)
APNA
COLLEGE
ii)
public class Test {
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
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
int x = 10, y= 57
int exp2 = (y *x y +y *
x/ y)i
system.out.println (exp2) ;