16 October, 2020

write a java program for increment and decrement operator.

increment and decrement operators,increment and decrement operators in c,increment and decrement operators examples,increment and decrement operators in c with examples,how to solve increment and decrement operators in c,decrement operator,increment operator,increment decrement operators,increment & decrement operators,increment and decrement operator,increment and decrement operators in hindi,concept of increment and decrement operators,increment and decrement operators in java
import java.util.Scanner;
class increment_decrement_operator
{
	public static void main(String arg[])
	{
		int a;
		Scanner obj= new Scanner(System.in);
		System.out.print("Enter A:-");
		a=obj.nextInt();
		++a;
		System.out.println("Increment operator (++a):-"+a);
		a++;
		System.out.println("Increment operator (a++):-"+a);
		--a;
		System.out.println("Decrement operator (--a):-"+a);
		a--;
		System.out.println("Decrement operator (a--):-"+a);
	}
}
29
NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post
NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post