Ask Question
11 February, 03:38

What is the output of the following program when the method is called with 4?

void unknown (int n)

{

if (n>0)

{

System. out. print ("?");

unkown (n-1);

}

}

A. None of the other answers

B.?

C.?

D.?

+5
Answers (1)
  1. 11 February, 04:05
    0
    A.

    Explanation:

    void unknown (int n) defines a methodes that doesn't return a value, hence unknow (int n) is a function ... it is function that prints the value? as many times as you tell it, hence for n=4 it would print?. However, it doesn't return a value an interger, string etc ..., so it doesn't give an output.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What is the output of the following program when the method is called with 4? void unknown (int n) { if (n>0) { System. out. print ("?"); ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers