Ask Question
10 March, 08:30

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. 10 March, 09:03
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers