Programming is a core activity of computer science. It is a
skill for creation. Once you can do it, make computer to touch the sky with
your own concepts and thinking power. A program is just a plan or instruction
for a machine to follow.
Example: Program are like recipes
The chef writes the instructions clearly enough that anyone
can follow them. They tell you the actions that you would be performed during
baking cake, there is no point to baking cake then stirring vigorously.
So like baking cake we have to give clear instruction to
machine to follow otherwise our cake may be baked but burnt or soggy.
Variables:
- Data storage is the main purpose of using variables.
- This information data stores temporary in RAM.
- This data have value, name and memory address.
- Signed variables was available earlier.
What are signed variables discuss later in this article.
Ex: This example shows proper behavior of variables
functionality storage.
Declaring or
initializing a variable:
DataType VariableName =
Value;
string StudentName= “Student” ;
char decision= “Y”;
int x = 12;
double x= 23;
decimal x= 23.4454;
float x=34322.343;
bool gender= true;
Note: Data type that define which type
value is stored in a variable. There are many more data types in C# which are:
Concept of Signed and Unsigned
Variables:
Signed variables are those have a sign
Ex: int a = -1;
Ex: int a = -1;
Unsigned variables are those don’t have any sign
Ex: int a = 1;
Previous concept of sign and unsigned variable was
both sign(-) and unsign(+) mark have separate 64 bit slot allocation in memory
and 64 bit slot allocation in memory for their value(1).
New Concept is if they have sign(-) mark then it
uses same behavior as previous but if they don’t have sign then their would be
only 64bit memory allocation for value(1).