Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Circle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package myprojects;
import java.util.Scanner;
public class Circle
{
public static void main(String[] args)
{
try (Scanner s = new Scanner(System.in)) {
double radius = s.nextDouble();
double area = 0;
double perimeter = 0;
if(radius < 0)
{
System.out.println("Please enter postive number");
}
else
{
area=Math.PI*radius*radius;
perimeter=2*Math.PI*radius;
}
System.out.println("Area of circle is = "+area);
System.out.print("Perimetere of the circle is = "+perimeter);
}

}

}
29 changes: 29 additions & 0 deletions LargestNum.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package myprojects;
import java.util.*;
public class LargestNum
{
private static final int NULL = 0;

public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
System.out.println("Enter 3 numbers: ");
int x = s.nextInt();
int y= s.nextInt();
int z= s.nextInt();
int result=NULL;
if(x>y && x>z)
{
result=x;
}
else if (y>=z)
{
result = y;
}
else
{
result= z;
}
System.out.print(result);
}
}