Friday, August 22, 2014

Increment Operators In Java Programming

Program:

package munim2;
import java.util.Scanner;
public class prefatch {
public static void main(String args[]){
Scanner moni=new Scanner(System.in);
int tree;
tree=moni.nextInt();
System.out.print("the number of tree is :");
System.out.println(++tree);
System.out.print("the changing number of tree is :");
System.out.println(--tree);
tree++;
tree++;
System.out.print("another number of tree is :");
System.out.println(tree);
}

}

Screenshots



Output


No comments: