fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. static double resta(double n, double m){
  11. return (n - m); }
  12.  
  13. static double suma(double n, double m){
  14. return (n + m); }
  15.  
  16. static double multiplica(double n, double m){
  17. return (n * m); }
  18.  
  19. static double cuadrado(double n){
  20. return (n * n); }
  21.  
  22.  
  23.  
  24. public static void main (String[] args) throws java.lang.Exception {
  25.  
  26. System.out.println(resta(4, 10));
  27. System.out.println(suma(4, 10));
  28. System.out.println(multiplica(4, 10));
  29. System.out.println(cuadrado(10));
  30.  
  31.  
  32. } // end main
  33. } // end class
Success #stdin #stdout 0.09s 53204KB
stdin
Standard input is empty
stdout
-6.0
14.0
40.0
100.0