Computer Science, asked by 404PageNotFound, 6 months ago

explain data types in c language!​

Answers

Answered by sharmaa8466
9

Answer:

Each variable in C has an associated data type. Each data type requires different amounts of memory and has some specific operations which can be performed over it. Let us briefly describe them one by one:

Following are the examples of some very common data types used in C:

char: The most basic data type in C. It stores a single character and requires a single byte of memory in almost all compilers.

int: As the name suggests, an int variable is used to store an integer.

float: It is used to store decimal numbers (numbers with floating point value) with single precision.

double: It is used to store decimal numbers (numbers with floating point value) with double precision.

Different data types also have different ranges upto which they can store numbers. These ranges may vary from compiler to compiler. Below is list of ranges along with the memory requirement and format specifiers on 32 bit gcc compiler.

Explanation:

plz mark me as brainlist

Answered by Anonymous
90

Answer:

 \sf\green{ Data \: Types \: in \: C :- }

Following are the examples of some very common data types used in C:

1.  \sf\blue{ integer \: (int) \: types :- }

Integers are whole numbers with a range of values which is machine dependent. Generally an integer occupies 4 bytes memory space and its value range limited to -32768 to +32767 (that is,  \tt - 2 ^{15} to  \tt +2 ^{15}-1 .)

 \sf\red{ Syntax :- } int <variable name>;

int a;

int num1;

2.  \sf\blue{ Floating \: Point \: types \: (float) :- }

The float data type is used to store fractional numbers (real numbers) with 6 digits of precision. Floating

point numbers are denoted by the keyword float.

 \sf\red{ Syntax :- } float <variable name>;

float a;

float num1;

3.  \sf\blue{ Character \: type :- }

Cha racter type variable can hold a single character.

 \sf\red{ Syntax :- } char <variable name>;

char ch = ‘a’;

Similar questions