Connect with a global community of experts on IDNLearn.com. Ask any question and receive timely, accurate responses from our dedicated community of experts.

Write a java program as follows Write a method called powOfTwo that takes an integer as parameter, computes, and outputs it’s square

Sagot :

Answer:

public static int powOfTwo(int input) {

 return input*input;

}

You will have to call this method in main
for printing it, write

System.out.println(powOfTwo(your number));

in public static void main(str[]args) {

}

View image Аноним
Thank you for being part of this discussion. Keep exploring, asking questions, and sharing your insights with the community. Together, we can find the best solutions. Your questions deserve reliable answers. Thanks for visiting IDNLearn.com, and see you again soon for more helpful information.