// A program to find the difference of three numbers.
import java. lang.*;
import java. util.*;
class difference
{
public static void main(String args [])
{
int a, b, c, diff;
a=20;
b=10;
c=30;
diff = a-b-c;
[Link] (“Difference of three numbers :” + c);
}
}
// A program to find the product of three numbers.
import java. lang.*;
import java. util.*;
class product
{
public static void main(String args[])
{
int a, b, c, pro;
a=10;
b=20;
c= 30;
c=a* b* c;
[Link] (“Product of two numbers :” + c);
}
}
// A program to find the area and perimeter of rectangle.
import java. lang.*;
import java. util.*;
class Rectangle
{
public static void main(String args[])
{
double l, b, area, perimeter;
l = 20.22;
b = 32.32;
area = l * b;
perimeter = 2 * ( l + b);
[Link] (“Area=” + area);
[Link] (“Perimeter=” + perimeter);
}
}
// A program to find the square of given number.
import java .lang.*;
import java .util.*;
class Square
{
public static void main(String args[])
{
int a, b;
a = 35;
b = a * a;
[Link] (“Square=” + b);
}
}
// A program to find the Area of circle.
import java. lang.*;
import java. util.*;
class circle
{
public static void main(String args[])
{
double r, a;
r = 20.33;
a=3.14*r*r;
[Link] (“Area=”+a);
}
}
// A program to find the Area of triangle.
import java. lang.*;
import java. util.*;
class triangle
{
public static void main(String args[])
{
double b, h, a;
b = 10.23;
h = 23.33;
a=0.5*b*h;
[Link](“Area=”+a);
}
}
// A program to find the Circumference of circle.
import java. lang.*;
import java. util.*;
class circle
{
public static void main(String args[])
{
double r, c;
r = 45.22;
c=2*3.14*r;
[Link](“Circumference=”+c);
}
}
// A program to find the Sum of squares of 2 numbers.
import java. lang.*;
import java. util.*;
class Sum
{
public static void main(String args[])
{
int m, n, s;
s=m*m + n*n;
[Link](“sum of squares=”+s);
}
}
// A program to find the Average of 3 numbers.
import java. lang.*;
import java. util.*;
class Average
{
public static void main(String args[])
{
double a, b, c, avg, sum;
sum = a + b + c;
avg = sum/3;
[Link](“Average=”+ avg);
}
}
// A program to find the cube of given numbers.
import java. lang.*;
import java. util.*;
class cube
{
public static void main(String args[])
{
int n, c;
c=n*n*n;
[Link](“cube=”+c);
}
}
// A program to find the Perimeter of square
import java. lang.*;
import java. util.*;
class Square
{
public static void main(String args[])
{
double s, p;
s = 66.44;
p = 4 * s;
[Link](“Perimeter of square=”+p);
}
}
// A program to Print series of 3 numbers.
import java. lang.*;
import java. util.*;
class Series
{
public static void main(String args[])
{
int n, a, b;
n = 20;
a=n-1;
b=n+1;
[Link](a+ “,”+ n + “,” +b);
}
}
// A program to Print series of 4 alternating numbers.
import java. lang.*;
import java. util.*;
class Series4
{
public static void main(String args[])
{
int n, a, b, c;
n = 12;
a = n + 2;
b = a + 2;
c = b + 2;
[Link](n+ “,”+ a + “,” +b + “,”+c);
}
}
// A program to convert meters into centimeter &
kilometer.
import java. lang.*;
import java. util.*;
class convert
{
public static void main(String args[])
{
double m, cm, km;
cm = m*100;
km = m/1000;
[Link](“Centimeter=” + cm);
[Link](“Kilometer=” + km);
}
}
// A program to find Simple Interest.
import java. lang.*;
import java. util.*;
class Sinterest
{
public static void main(String args[])
{
double p, r, t, si ;
p = 10.22;
r = 40.22;
t = 42.54;
si = (p * r * t)/100;
[Link](“Simple Interest=” + si);
}
}
// A program to find sum of square and cube of number.
import java. lang.*;
import java. util.*;
class Abc
{
public static void main(String args[])
{
int n, s, c, sum;
n = 55;
s = n * n;
c = n * n * n;
sum = s+c;
[Link](sum);
}
}
// A program to perform swap of two numbers with
using third variable.
import java. lang.*;
import java. util.*;
class swap
{
public static void main(String args[])
{
int a, b, c;
a = 10;
b = 20;
c = a;
a = b;
b = c;
[Link](a);
[Link](b);
}
}
// A program to perform swap of two numbers without
using third number.
import java. lang.*;
import java. util.*;
class swap
{
public static void main(String args[])
{
int a, b, c;
a = 10;
b = 20;
a = a + b;
b = a-b;
a = a-b;
[Link](a);
[Link](b);
}
}