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.  
  11. public static double suma(double n, double m){
  12. double suma = n + m;
  13. return suma;
  14. }
  15.  
  16. static double resta(double n, double m){
  17. double resta = n - m;
  18. return resta;
  19. }
  20.  
  21. static double multiplica(double n, double m){
  22. double multiplica = n * m;
  23. return multiplica;
  24. }
  25.  
  26. static double cuadrado(double n){
  27. double cuadrado = Math.sqrt(10);
  28. return cuadrado;
  29. }
  30.  
  31. public static void main (String[] args) throws java.lang.Exception {
  32. System.out.println(suma(4, 10));
  33. System.out.println(resta(4, 10));
  34. System.out.println(multiplica(4, 10));
  35. System.out.println(cuadrado(10));
  36.  
  37. }
  38. }
Success #stdin #stdout 0.12s 55344KB
stdin
Standard input is empty
stdout
14.0
-6.0
40.0
3.1622776601683795