package Mobile.OperatorsAndExpressions;
import java.util.Scanner;
public class IncAndDecOperators
{
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);
}
}
import java.util.Scanner;
public class IncAndDecOperators
{
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);
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.