Search This Blog

UI/UX Design | Web Development | Mobile Application Development

Whether you need UI/ UX design, web development services, or mobile app development services, Qaabil Digitals will be more than happy to help you. We work with top software developers, designers, and project managers. We tailor our services to suit your exact needs. We closely look at your company, listen to your story, and bring about the best ideas and solutions that can help you drive solid results. We don’t just produce work that works. We produce work that matters. Get a quote now Or Talk to us

Monday 13 June 2011

Using different arithmatic assignment operators in java program


class assignops
{
public static void main (String arg[])
{
int a=10,b=25,c=5,d=18,e=49;
a+=10;
b-=10;
c*=10;
d/=2;
e%=7;
System.out.println ("\n\t a = "+a);

System.out.println ("\n\t b = "+b);
System.out.println ("\n\t c = "+c);

System.out.println ("\n\t d = "+d);
System.out.println ("\n\t e = "+e);
}
}

Note:
          After execution you will observe following five changes
  1. Value of 'a' is increased by 10
  2. Value of 'b' is decreased by 10
  3. Value of 'c' is 50 (due to multiplying by 10)
  4. Value of 'd' is 9 (because we are dividing 'c' by 2)
  5. Value of 'e' is 0 (because 7 divides 49 properly)
 

    No comments:

    Post a Comment

    Share