Ask Question
26 July, 20:06

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.?

+2
Answers (1)
  1. 26 July, 22:20
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers