import java.lang.*;

class Inc_dec_operators
{
public static void main(String args[])
{
int a=10;
System.out.println(“\nIncrement Operators:\n”);
System.out.println(“\nPre Increment Operator:\n”);
System.out.println(“a : “+a);
System.out.println(“++a : “+(++a));
System.out.println(“a : “+a);

System.out.println(“\nPost Increment Operator:\n”);
System.out.println(“a : “+a);
System.out.println(“a++ : “+(a++));
System.out.println(“a : “+a);

System.out.println(“\nDecrement Operators:\n”);
System.out.println(“\nPre Decrement Operator:\n”);
System.out.println(“a : “+a);
System.out.println(“–a : “+(–a));
System.out.println(“a : “+a);

System.out.println(“\nPost Decrement Operator:\n”);
System.out.println(“a : “+a);
System.out.println(“a– : “+(a–));
System.out.println(“a : “+a);
}
}

82,089 total views, 128 views today

Get Free Email Updates..!
Join us for FREE to get instant email updates..! GobsInfo- Everything Unlimited
We hate spam. Your email address will not be sold or shared with anyone else.

5,256 Thoughts to “Java Program To Demonstrate Increment And Decrement Operators”

  1. It’s appropriate time to make some plans for the future and
    it’s time to be happy. I’ve learn this post and if I may just I
    desire to recommend you some interesting things or suggestions.
    Perhaps you can write subsequent articles regarding this article.
    I want to read more issues about it!

  2. I am genuinely thankful to the owner of this web page who
    has shared this fantastic piece of writing at here.

  3. Please let me know if you’re looking for a article author for your blog.

    You have some really good articles and I believe I would be a good
    asset. If you ever want to take some of the load off, I’d love to write some content for your
    blog in exchange for a link back to mine. Please send me an e-mail if interested.
    Regards!

Leave a Comment