Welcome to Westonci.ca, the place where your questions are answered by a community of knowledgeable contributors. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform. Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our platform.

5.What is returned by the call go(30)?
public static String go ( int x)
{
String s = "";
for (int n = x; n > 0; n = n - 5)
S = S + x +
return s;}


Sagot :

Answer:

The string returned is: 303030303030

Explanation:

Given

The above method

Required

The returned string

The method returns a string that is repeated x/5 times.

Take for instance;

x = 30

The method will return a string that contains x in 30/5 (i.e. 6) times

Hence, the result of go(30) is 303030303030