Skip to content

Instantly share code, notes, and snippets.

@ievgiienko
Created July 5, 2022 06:10
Show Gist options
  • Save ievgiienko/e6a29f6892348f7e7d50e5e7bcf149fc to your computer and use it in GitHub Desktop.
Save ievgiienko/e6a29f6892348f7e7d50e5e7bcf149fc to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("What is BTC price today?");
var btc = scanner.nextDouble();
while (true) {
System.out.println("How much $ do you have?");
var usd = scanner.nextDouble();
if (usd == 0)
break;
var result = usd / btc;
System.out.println("You will get " + result + " BTC!");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment