i

ASP.Net A Complete Guide

C# Data Types

Data Types:

C# is a strongly typed language. A data type specifies the size to store the variable and type of that variable values. The most used data types are as below:

Sr. No 

Type 

Size 

Description 

int 

4 bytes 

-2,147,483,648 to 2,147,483,647 

Char 

2 bytes 

Assign single character in single quotes. 

string 

2 bytes/ character 

Assign a sequence of characters in double quotes 

long 

8 bytes 

Hold number from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 

float 

4 bytes 

Holds 6 to 7 decimal digits 

double 

8 bytes 

Holds 15 decimal digits 

bool 

1 Bit 

Can assign true or false value