Wednesday 4 June 2014

what do you mean by variable and constants in term of assigning values

1)what is the meaning of variable in urdu?
ans.  badalti huwi   غیرمستقل     

2)what is the meaning of constant in urdu?
ans. مسلسل جاری and unchangeable, na badalnay wali

3)what is variable and constant in terms of programming? 

ans) *******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 is a quantity that can change while constant is a quantity that cannot change during program execution.
variable is a name given to the memory space in which a a constant is stored

eg. int x =10;
here, x is a variable because later in the program you can write
x= 15;

whereas, 10 is constant because you can never write later in a program that
10=20;  *********************************************************************

***********************************************************************************
Example
Which of the following are variables and which are constants?
  1. The temperature outside your house. This is a variable. The temperature outside your home will change depending on the weather.
  2. The number of square feet in a room that is 12 ft by 12 ft.< This is a constant. The square feet in a room 12 ft by 12 ft is always 144 square feet. It does not change.
  3. The noise level at a concert. This is a variable. The noise level changes depending on the number of people talking and yelling at any given time. *****************************************************************************