What gets printed when the following code snippet is compiled? Select the one correct answer. <% int y = 0; %> <% int z = 0; %>

What gets printed when the following code snippet is compiled? Select the one correct answer.
<% int y = 0; %>
<% int z = 0; %> 


<% for(int x=0;x<3;x++) { %>
<% z++;++y;%>
<% }%>

<% if(z<y) {%>
<%= z%>
<% } else {%>
<%= z - 1%>
<% }%>


a. 0
b. 1
c. 2
d. 3
e. The program generates compilation error.









Answer: C


Learn More :