Porovnání dvou čísel


/ Published in: Java
Save to your folder(s)

Napište program na porovnání dvou čísel.


Copy this code and paste it in your HTML
  1. import java.util.Scanner;
  2.  
  3. public class Porovnavani{
  4. public static void main(String[] args){
  5. Scanner sc = new Scanner(System.in);
  6. System.out.println("Zadej cislo A");
  7. double a = sc.nextDouble();
  8. System.out.println("Zadej ci­slo B");
  9. double b = sc.nextDouble();
  10. if(a > b){
  11. System.out.println("A je vetsi nez B");
  12. }else{
  13. System.out.println("B je vetsi nez A");
  14. }
  15. }
  16. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.