How to define variables in C#?

CsharpProgrammingServer Side Programming

Each variable in C# has a specific type, which determines the size and layout of the variable's memory the range of values that can be stored within that memory and the set of operations that can be applied to the variable.

For variables −

<data_type> <variable_list>;

Let us see an example −

int x, y;

Above the variable is of int type. Let us declare a variable for other types.

Variable of float type −

float z;

Variable of short type −

short p;
raja
Published on 09-Aug-2018 06:20:12
Advertisements