New course! Every coder should learn Generative AI!
Try a free lesson+ 4
1. You need to be more specific with the question, at least specify the language involved in Relevant Tags.
2. `if` statement is used for evaluating expressions for branching execution flow. It was not meant for variable initialization.
(Edit)
Balaji
If you can, explain what you want to do, perhaps I can help you just a bit. There's no need to mark my answer, I haven't helped you with anything.