Computer Science, asked by ashutoshkumar09f, 8 months ago

Initialization is the assessment of an initial value to an​

Answers

Answered by kncmehak
0

Answer:

Initialization refers to defining a constant or variable values that are used in the code for executing a computer program.

Initialization plays a key role in programming as the variables that are used for writing the code occupy a certain amount of memory in the CPU. If the memory values are not defined by the user at the start of the code’s execution, the CPU will set the variable value to anything that is acceptable in computer programming language, this is usually termed as garbage value.

If a garbage value is set for a variable, then the whole logic of the program changes and will result in an incorrect value as the output.

Some compilers will not even set a garbage value for the variable and this results to a null value for the variable which can also result in a compile time error.

Thus, initialization is very important.

If variables are not initialized, then atleast the variable values must be overwritten to erase the garbage data and have a valid value for the variable which will ensure that the program gives the desired output.

Similar questions