vinit program

7
1) write a program to find the ,difference and prduct of two numbers // to find the sum,difference and product of two numbers public class simplification { public static void main (String args[]) { int a,b,c,d,e; a= 45;b=20; c=a+b; d=a-b; e=a*b; Sysem.out.println("the sum of two numbers ="+c); Sysem.out.println("the difference of two numbers ="+d); Sysem.out.println("the product of two numbers ="+e); } } 2) write a program to find area of circumfrence of circular ring,whose outer and inner radii are 21cm and 14cm public class circle { public static void main (string args[]) { int r1,r2; double ar,ar1,ar2,c1,c2; r1=14;r2=21; ar1=22/7*r1*r2; ar2=22/7*r2*r2;

Upload: pinky-thakur

Post on 09-Apr-2016

213 views

Category:

Documents


0 download

DESCRIPTION

java program

TRANSCRIPT

Page 1: Vinit Program

1) write a program to find the ,difference and prduct of two numbers

// to find the sum,difference and product of two numbers

public class simplification

{

public static void main (String args[])

{

int a,b,c,d,e;

a= 45;b=20;

c=a+b;

d=a-b;

e=a*b;

Sysem.out.println("the sum of two numbers ="+c);

Sysem.out.println("the difference of two numbers ="+d);

Sysem.out.println("the product of two numbers ="+e);

}

}

2) write a program to find area of circumfrence of circular ring,whose outer and innerradii are 21cm and 14cm

public class circle

{

public static void main (string args[])

{

int r1,r2;

double ar,ar1,ar2,c1,c2;

r1=14;r2=21;

ar1=22/7*r1*r2;

ar2=22/7*r2*r2;

Page 2: Vinit Program

c2=2*22/7*r1;

c2=2*22/7*r2;

Sysem.out.println("the inner area ="+ar1);

Sysem.out.println("the outer area ="+ar2);

Sysem.out.println("the area of ring ="+ar);

Sysem.out.println("the inner circumfrence ="+c1);

Sysem.out.println("the outer area ="+c2);

}

}

Page 3: Vinit Program
Page 4: Vinit Program
Page 5: Vinit Program
Page 6: Vinit Program
Page 7: Vinit Program