Research and Discuss variables and data types.
1. What are the various data types you can use in C#, Explain memory sizes of these data types?
2. Discuss string variables. What does a string variable provide? Provide details.
3. Provide examples how you would create a values like "Sarah", 2, 3.50, and store into memory. For example, DataType VariableName = "Sarah".
Answer 1:
Type |
Size |
char |
1 byte |
signed char |
1 byte |
unsigned char |
1 byte |
short |
2 byte |
signed short |
2 byte |
unsigned short |
2 byte |
int |
4 byte |
signed int |
4 byte |
unsigned int |
4 byte |
long |
8 byte |
signed long |
8 byte |
unsigned long |
8 byte |
float |
4 byte |
double |
8 byte |
decimal |
16 byte |
Answer 2:
strings will store the sequence of chars in array internally and
also
it provides methods to operate on the data it holds
like replcae,length,ToUpper() etc
Answer 3:
string name="Sarah";
int a =2;
double d =3.5
NOTE : PLEASE COMMENT BELOW IF YOU HAVE CONCERNS.
I AM HERE TO HELP YOUIF YOU LIKE MY ANSWER PLEASE RATE AND HELP ME
IT IS VERY IMP FOR ME
Get Answers For Free
Most questions answered within 1 hours.