0

What data type should i choose?

so that i ask the user to enter their name and then the program says hi,[name]

6th Jun 2018, 6:57 AM
Sakaar Sen
Sakaar Sen - avatar
2 odpowiedzi
+ 4
The general data types in all languages are: char --> a single character string --> a string of characters int --> integers float --> numbers with decimals e.g. 5,3 double --> also numbers with decimals but has more digits e.g. 3,1415926... boolean --> true/false Most languages support long type. Add long before int or float/double so that you allocate more memory to your variable e.g. a long int has much more digits than a simple int
6th Jun 2018, 7:09 AM
Haris
Haris - avatar
+ 2
For a "string" of characters (more than one char), use a string type variable.
6th Jun 2018, 7:03 AM
Xpl0it
Xpl0it - avatar