Write a program in java to find the result of the following expressions.(Assume a=20,b=30) i) a%b ii)a/=b iii)(a+b*100)/10iv)a++
Answers
Answered by
5
class s01_02
{
public static void main(String args[])
{
int a=20,b=30;
System.out.println(" i) (a<<2)+(b>>2): "+(a<<2)+(b>>2) );
System.out.println(" ii) (a)||(b>0) : "+(a)||(b>0) );
System.out.println("iii) (a+b*100)/10 : "+(a+b*100)/10 );
System.out.println(" iv) (a&b) : "+(a&b) );
}
}
Similar questions