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. *****************************************************************************



Tuesday, 3 June 2014

DAta Types definition and details

Data Types:
A data type in a programming language is a set of data with values having predefined characteristics. Examples of data types are: integer(0-9), floating point unit number(0.0 - 9.0), character(A-Z and a-z), string(combination of alphabets and numbers example address). Usually, a limited number of such data types come built into a language. The language usually specifies the range of values for a given data type, how the values are processed by the computer, and how they are stored.

examples of data types:
integer: your roll number or id card number(123 or 423011234567 etc)
float: population or average count(89.45% or 42,000,11122.34848)
string: flatno123 road abc city country900
character: 'a' or 'z'
 NOTE: character is single alphabet not cluster or combination of alphabets if combination occurs then it will be considered as string.