data types Flashcards
(9 cards)
1
Q
how do you store data like names and age
A
using a string line
string phrase = “aaddfff”;
2
Q
how do you store single characters
A
char ANS = ‘a’;
needs single quotation marks
3
Q
how to store numbers
A
int ANS = 20;
4
Q
how do you store exact numbers
A
decimal ANS = 20.1;
5
Q
how to store decimal numbers but not accurately
A
double ANS = 3.3;
6
Q
how do you make true or false statements
A
using a bool function
bool ANS = true/false;
7
Q
when working with strings how do you make the program put the text on a new line
A
\n after the last word of a sentence
8
Q
how do you add a string onto another string
A
cancatination + string +
9
Q
how to find how many characters are inside of a string
A
by using the method Length
console.WriteLine (ANS.Length );