Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import java.lang.String;
  2. public class Main {
  3.  
  4.    //Sa se creze o functie care verifica care nr este mai mare. Si sa afiseze nr cel mai mare
  5.     //
  6.     //ex: nr1 = 2, nr2 = 3
  7.  
  8.     static void myMethod(int x, int y) {
  9.        
  10.        
  11.         if( x > y )
  12.         {
  13.             System.out.println("x este mai mare");
  14.         }
  15.         else
  16.         {
  17.             System.out.println("y este mai mare");
  18.         }
  19.        
  20.        
  21.     }
  22.  
  23.         public static void main(String[] args) {
  24.            
  25.             int nr1  = 2, nr2 = 1;
  26.            
  27.         System.out.println(myMethod(nr1,nr2));
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement