Consider the below code snippet:

<span v-for="num in 10">
	<span v-if="num%2==0">{{num}}</span>&nbsp;
</span>
<span v-else>0</span>      

What will be the output for this?

0 2 0 4 0 6 0 8 0 10
No output and error in the console as v-else is not immediately placed after a v-if
2 4 6 8 10 0 and error in console as v-else is not immediately placed after a v-if
1 2 3 4 5 6 7 8 9 10
Verified Answer
Correct Option - c

To get all Infosys Certified VueJS Professional Exam questions Join Telegram Group https://bit.ly/infy_premium_group

Telegram

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in

Updated on Sun, 6 Jul 2025