Junior — Middle
Can you name the main data types used in C#?
sobes.tech AI
Answer from AI
In C#, the main data types are divided into several categories:
- Integer types:
int,long,short,byte,uint,ulong,ushort,sbyte - Floating-point numbers:
float,double,decimal - Boolean type:
bool(valuestrueorfalse) - Character type:
char(a single Unicode character) - Strings:
string(a sequence of characters) - Objects:
object— the base type for all types in C# Example usage:
int age = 30;
bool isActive = true;
char grade = 'A';
string name = "Ivan";
double price = 99.99;