package Logical;
public class Logical
{
public static void main(String[] args)
{
boolean a = true, b = true , c = false, result;
prln("a = "+a+"\t b = "+b+ "\t c = "+c);
result = a && b || c;
prln("a && b || c = "+result);
result = a || b && c;
prln("a || b && c = "+result);
result = a && !a;
prln("a && !a = "+result);
result = a || !a;
prln("a || !a = "+result);
result = c && !c;
prln("c && !c = "+result);
result = c || !c;
prln("c || !c = "+result);
}
static void prln(Object anyObject)
{
System.out.println(anyObject);
}
static void pr(Object anyObject)
{
System.out.print(anyObject);
}
}
0 comments:
Post a Comment