Tip of the week#2: Initialize all the data variables
Whenever you declare a local variable, it is not initialized to any value. It contains a garbage value.
Garbage value is never useful. It is just an uninitialized data. Presence of garbage value might introduce some bugs into your program.
Hence whenever we declare a local variable, the best practice is to initialize it at the same time. Instead of writing “int variable1”, we can write “int variable1 = 0”. This will eliminate the risk of the program code giving unwanted output.