0% found this document useful (0 votes)
3 views7 pages

Logical Operator

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)
3 views7 pages

Logical Operator

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
You are on page 1/ 7

Logical Operator MCQs: .

1. What is the output of the program:


2. What is the output of the program:
3. What is the output of the program?
4. What is the output of the program:

class Program1
{
public static void main(String[] args)
{
int a=20;
int b=30;
System.out.println(a++>15 && b++>20);
System.out.println(a);
System.out.println(b);
}
}
a) true, 20, 30
b) false, 21, 30
c) true, 21, 31
d) false, 21, 31
5. What is the output of the program:
class Program1
{
public static void main(String[] args)
{
int a=20;
int b=30;
System.out.println(a++>25 && b++>20);
System.out.println(a);
System.out.println(b);
}
}
a) true, 20, 30
b) false, 21, 30
c) true, 21, 31
d) false, 21, 31
6. What is the output of the program:

class Program1
{
public static void main(String[] args)
{
int a=20;
int b=30;
System.out.println(a++>25 || b++>20);
System.out.println(a);
System.out.println(b);
}
}
a) true, 20, 30
b) false, 21, 30
c) true, 21, 31
d) false, 21, 31
7. What is the output of the program:
class Program1
{
public static void main(String[] args)
{
int a=20;
int b=30;
System.out.println(a++>15 || b++>20);
System.out.println(a);
System.out.println(b);
}
}
a) true, 21, 30
b) false, 21, 30
c) true, 21, 31
d) false, 21, 31

You might also like