- 1
what is the constant? what is the variable? and then what is the variable constant?
i didnt undrrstand
6 Answers
+ 1
variables: are pice program in which you can store a values that you can use in program to calculation.In C#: int a =0; a is variable to store any value.The zero is only initial number and in a next piece of program you can store into another value.Constant is a special variable to store only initial value and you cannot change it in a next piece of program. Like const float a=3.14159;Tjis value you can use but you cannot change it.
+ 1
fine,is it more clear now?:)
0
A constant is something that doesn't change. You set it and it stays the same and can not be changed at a later point.
For instance the value of PI is a constant value it should never change throughout your program so you create it as a constant to ensure that it is not accidentally modified later in your code potentially breaking a calculation and creating hard to find bugs or crashing your program.
0
the next answer?
0
exactly i was confused
0
thank you (y)