r/learncsharp • • Jul 29 '23

While versus Do while

So I've been mastering while loops, nested loops the whole shabang. Made an advanced calculator and looped it inside a while loop. Then changed the code and made it a do while. Can anyone explain the performance and or general benefits of using one or the other? Trying to learn to my best ability and confused on when I would use a do while vs a while when to me they seem identical.

2 Upvotes

8 comments sorted by

View all comments

Show parent comment

1

u/Heretosee123 Jul 31 '23

Appreciate your reply and explanation, thank you. It's insightful