what is the difference between constant and variable ? Define.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
The difference between variables and constants is that variables can change their value at any time but constants can never change their value. (The constants value is lockedfor the duration of the program). Constants can be very useful, Pi for instance is a good example to declare as a constant.
Variable : A variable is denoted by a Letter of English alphabet and that can take any value .
Constant : The Values of constant remain same throughout the Situation i.e value of constant doesn't change in a problem