Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class sayılarıgoster {
  4.  
  5. //Author ßari$
  6.  
  7. public static void main(String[] args) {
  8.  
  9. int ebob;
  10. int a;
  11. int b;
  12.  
  13. Scanner scanner = new Scanner(System.in);
  14. System.out.println("Ebobunu alnamızı istediğiniz ilk sayıyı giriniz: ");
  15. a = scanner.nextInt();
  16. System.out.println("Ebobunu alnamızı istediğiniz ikinci sayıyı giriniz: ");
  17. b = scanner.nextInt();
  18.  
  19. if (b<a) {
  20. ebob = b;
  21. }
  22. else {
  23. ebob = a;
  24. }
  25. while ((b%ebob!=0) || (a%ebob !=0)){
  26. ebob = ebob -1;
  27.  
  28. }
  29. if (ebob == 1){
  30.  
  31. System.out.println("Sayılar aralarında asaldır...");
  32.  
  33. }
  34. else {
  35.  
  36. System.out.println("EBOB: "+ebob);
  37. }
  38.  
  39.  
  40.  
  41.  
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement