CSD201_-_SP_2024_-_Block_5_-_FE_1949.webp
Nakime93

CSD201_-_SP_2024_-_Block_5_-_FE_1949.webp

  • Media owner Nakime93
  • Ngày thêm
Multiple Choices
(Choose 1 answer)
Consider the following function:
void fun(int n)
{if (n <= 0)
System.out.println("Hello");
else
{for(int i = 0; i < n; i++)System.out.print("$");
System.out.println();
fun(n - 2);}
}
What is the output when the statement fun(5); is run?
A. Hello
$$$
$
B. $$$$$
$$$
$
Hello
C. $$$$
$$
$
Hello
D. $
$$$
Hello

  • Like
Reactions: trantrungdung45

Thông tin

Category
CSD201
Thêm bởi
Nakime93
Ngày thêm
Lượt xem
3,212
Lượt bình luận
27
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom