This is the question that I was asked at the interview today:
Take a look at the following code:
int n=20; for (int i =0; i<n; i--) print("*");
You are allowed to change one and only one character so that the loop runs exactly 20 times.
I could not answer the question at all. At first I decided to set it to 40, but then I realized that 40 is at least 20.
My interviewer said that there are 5 different answers to answer this question ...
Please help me find the answers.
source share