Skip to content

Instantly share code, notes, and snippets.

@edinak1
Created October 20, 2015 11:13
Show Gist options
  • Select an option

  • Save edinak1/bcae239b27ebdb2f4bbe to your computer and use it in GitHub Desktop.

Select an option

Save edinak1/bcae239b27ebdb2f4bbe to your computer and use it in GitHub Desktop.
package metod;
public class MetodSquare {
public static void main(String[] args) {
double number=2.0;
System.out.println(number+"^2"+"="+square(number));
System.out.println(number+"^4"+"="+square(square(number)));
System.out.println(number+"^8"+"="+square(square(square(number))));
}
static double square(double number)
{
return number*number;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment