# Output of the code

**URL:** <https://verificationacademy.com/forums/t/output-of-the-code/42820>\
**Category:** SystemVerilog\
**Tags:** Dave-Rich, SystemVerilog, System-Verilog, for-loop\
**Created:** [December 12, 2023, 5:01am UTC](https://verificationacademy.com/forums/t/output-of-the-code/42820 "2023-12-12T05:01:27Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Nandakumari](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/n/b9e5f3/32.png) [@Nandakumari](https://verificationacademy.com/forums/u/Nandakumari)\
**Post date:** [December 12, 2023, 6:48am UTC](https://verificationacademy.com/forums/t/output-of-the-code/42820/4 "2023-12-12T06:48:27Z")

</div>

_In reply to [m\_v](https://verificationacademy.com/forums/t/output-of-the-code/42820/3):_

because always value of a is 0 here.  
first loop: a = 0; then value of a is incremented but not assigned; =\>still value of a is zero this repeats.  
if assign a = ++a ; this assigns incremented value and works as you expected.  
hope you understood.

---

_[View the full topic](https://verificationacademy.com/forums/t/output-of-the-code/42820)._
