Guest User

Tugas DasPro M. Rifqi Syahidan 2

a guest
Sep 16th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.18 KB | None | 0 0
  1. import javax.swing.JOptionPane;
  2. public class Logic{
  3. public static void main (String [] args){
  4. int a,b,c;
  5. String str=JOptionPane.showInputDialog("Masukkan bilangan Nilai a = ");
  6. a = Integer.parseInt (str);
  7. String jdr=JOptionPane.showInputDialog("Masukkan bilangan Nilai b = ");
  8. b = Integer.parseInt (jdr);
  9. String rdr=JOptionPane.showInputDialog("Masukkan bilangan Nilai c = ");
  10. c = Integer.parseInt (rdr);
  11.  
  12. System.out.println("a = " +a );
  13. System.out.println("b = " +b );
  14. System.out.println("c = " +c );
  15.  
  16. boolean d= a>b;
  17. boolean e= a<b;
  18. boolean f= a==c;
  19. boolean g= b>c;
  20. boolean h= b<c;
  21. boolean i= a==b;
  22.  
  23. boolean and = d && e;
  24. boolean andd = f && g;
  25. boolean anddd = h && i;
  26.  
  27. boolean or = d || e;
  28. boolean orr = f || g;
  29. boolean orrr = h || i;
  30.  
  31. boolean xor = d ^ e;
  32. boolean xorr  = f ^ g;
  33. boolean xorrr  = h ^ i;
  34.  
  35. boolean not = !d;
  36. boolean nott = !f;
  37. boolean nottt = !h;
  38.  
  39. System.out.println(and);
  40. System.out.println(andd);
  41. System.out.println(anddd);
  42.  
  43. System.out.println(or);
  44. System.out.println(orr);
  45.  
  46. System.out.println(xor);
  47. System.out.println(xorr);
  48. System.out.println(xorrr);
  49.  
  50. System.out.println(not);
  51. System.out.println(nott);
  52. System.out.println(nottt);
  53.  
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment