0% found this document useful (0 votes)
16 views2 pages

Java Operators Assignment Questions

Uploaded by

Tamilselvi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

Java Operators Assignment Questions

Uploaded by

Tamilselvi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Assignment on Operators

1. If p= 5; find d= ++p +5
2. If a = 48
a= a++ + ++a;
3. If c = 2
d = ++c + c++ + 4;
4. If m=12
n = m++ * 5 + --m;
5 . What will be the output of the following code?
int a = 5;
a++;
a -= (a--) - (--a);
[Link](a);
6. if a= 12,b=8

a*= ++a/6 + b++ %3;

7. What will be the output of the following code?

int k=5, j=9;

k += k++ - ++j + k;

[Link](“k=”+k);

[Link](“j=”+j);

8. What will be the value of following if j = 5

i) (5* ++j)%6

ii) (5* j++)%6

[Link] is the value of y after evaluating the expression given below?

y += ++y + y-- + --y; when int y = 8.

10. What is the output of the code snippet?

int x = 'a';
[Link](x);

11. What is the result stored in x, after evaluating the following expression?

int x = 5;

x = x++ * 2 + 3 * --x;

12. What will be the result stored in X after evaluating the following
expression?

int X = 4;

X += (X++) + (++X) + X;

[Link] expression 8 % 2 * 3 evaluates to:

[Link] value of b evaluates to:

boolean b = (true == false) ? true : false;

[Link] is the output of the code snippet?

char c = (char)65;

[Link](c);

You might also like