What do you want to save?
Add Code snippet
New code examples
-
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-24 16:34:08
Java program to calculate area of a circle
import java.util.Scanner; public class CalculateAreaOfCircle { public static void main(String[] args) { double radius; double pi = 3.1415, area; Scanner sc = new Scanner(System.in); System.out.println("Please enter radiu... Add solution -
Java 2021-10-24 09:19:15
how do i scan for n times in java
//Link: https://www.quora.com/How-do-I-can-get-n-lines-of-text-as-input-from-the-user-in-java //using Scanner import java.util.Scanner; public class ScannerDemo { public static void main(String args[]) { Scanner sc = new Scanner(System.in)... Add solution -
Java 2021-10-22 18:48:18
leap year program in java
import java.util.Scanner; public class LeapYear { public static void main(String[] args){ int year; System.out.println("Enter an Year :: "); Scanner sc = new Scanner(Sys... Add solution -
Java 2021-10-21 05:32:03
Java program to print the character or a letter x using star
import java.util.*;class Main{public static void main(String args[]){ int i,j,n;Scanner sc = new Scanner(System.in);System.out.println("Enter the number to print the character");n = sc.nextInt();for(i=n;i>=1;i--){for(j=i;j<n;j++){System.ou... Add solution -
TypeScript 2021-10-21 00:36:06
Write a program in Java for Banking Application in which user deposits the amount Rs 2000/- and then start withdrawing of Rs 1000/-, Rs 500/- and it throws exception "Not Sufficient Fund" when user withdraws Rs. 750/- thereafter.
import java.util.*; class Bank { float fund; void deposit(float amount) { fund=amount; } void withdraw(float money) throws Exception { float newFund=fund-money; if(newFund<500) { throw... Add solution