What do you want to save?
Add Code snippet
New code examples
-
Java 2021-11-07 07:30:21
Java Program to find the perimeter of the circle
@Test public void findPerimeterOfTheCircleProgram12() { Scanner scanner = new Scanner(System.in); System.out.println("Enter the RADIUS of the Circle: "); double radius = scanner.nextDouble(); scanner.close(); // Logic for printing the... Add solution -
Java 2021-10-25 07:12:14
a recursive function that calculates the greatest common divisor from user's input in java
/** * Java program to demonstrate How to find Greatest Common Divisor or GCD of * two numbers using Euclid’s method. There are other methods as well to * find GCD of two number in Java but this example of finding GCD of two number * is most si... Add solution -
Java 2021-10-16 20:37:05
addition of two binary numbers in java
import java.util.Scanner; public class JavaExample { public static void main(String[] args) { long b1, b2; int i = 0, carry = 0; int[] sum = new int[10]; Scanner scanner = new Scanner(System.in); System.out.print("Enter first binary numb... Add solution -
Java 2021-10-09 17:10:08
minimum swaps to sort an array
import java.io.*; import java.math.*; import java.util.*; public class Swap { static int minimumSwaps(int[] arr) { int swap=0; boolean visited[]=new boolean[arr.length]; for(int i=0;i<arr.length;i++){ int j=i,cycle=0; while(!visited[j])... Add solution