//https://csprograms4u.blogspot.com/
//Chapter 1
//Program 4
//Increment and
Decrement Operators
import
java.util.Scanner;
public
class IDO
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int a,b,p1,p2,p3;
System.out.println("Enter First
Number");
a=sc.nextInt();
System.out.println("Enter Second
Number");
b=sc.nextInt();
System.out.println("a="+a);
System.out.println("b="+b);
p1=a*b;
System.out.println("Product="+p1);
a++;
b--;
System.out.println("a is inc and b
is dec");
System.out.println("Now
a="+a);
System.out.println("and
b="+b);
p2=a*b;
System.out.println("New
Product="+p2);
a=a+2;
b=b-2;
System.out.println("a is inc by 2
and b is dec by 2");
System.out.println("Now
a="+a);
System.out.println("and
b="+b);
p3=a*b;
System.out.println("New
Product="+p3);
}
}
Very nice good efforts��
ReplyDeleteVery nice good efforts��
ReplyDelete