Sunday, August 18, 2013

VARIABLES

Variables  -  :  A variable is the quantity / value that can change during the program. The name of a variable can be composed of letters, digits, and the underscore character. It must begin with either a letter or an underscore. Upper and lowercase letters are distinct because C++ is case-sensitive.

                A variable declaration provides assurance to the compiler that there is one variable exist with the given type and name so that compiler proceed for further compilation without needing complete detail about the variable. A variable declaration has its meaning at the time of compilation only, compiler needs actual variable declaration at the time of linking of the program.

Example: 1

<?php

$name ="Alex";
$age=19;

echo $name;

?>



Example: 2

<?php

$name ="Alex";
$age=19;

echo $age;

?>



Example: 3

<?php

$name ="Alex";
$age=19;

echo "concat"."ination";

?>




Example: 4

<?php

$name ="Alex";
$age=19;

echo "My name is $name and my age is $age.";

?>

No comments: