Data Types in C
Data Types
Contd….
 C Primary Data types:
The C language has 5 basic (primary or primitive) data types, they are:
 Character - ASCII character set or generally a single alphabet like 'a', 'B', etc.
 Integer - Used to store whole numbers like 1, 2, 100, 1000, etc.
 Floating-point - Decimal point or real numbers values like 99.9, 10.5, etc.
 Double - Very large numeric values which are not allowed in Integer or Floating point
type.
 Void - This means no value. This data type is mostly used when we define functions.
Keywords
Datatype Keyword
Character char
Integer int
Floating-point float
Double double
Void void
Int
 Integer are whole number
 Zerp,positive or Negative value
 But no decimal value.
 i.e int id;
id=101;
printf(“%d”,id);
 End with semicolon
Char
 Keyword “char “ used
 It accept the alphabets
 i.e char test=‘h’;
Printf(“%c”,test);
Float and Double
 Used to hold the real numbers.
 i.e float salary;
double price;

Data Types and variable of C Programming Language

  • 1.
  • 2.
  • 3.
    Contd….  C PrimaryData types: The C language has 5 basic (primary or primitive) data types, they are:  Character - ASCII character set or generally a single alphabet like 'a', 'B', etc.  Integer - Used to store whole numbers like 1, 2, 100, 1000, etc.  Floating-point - Decimal point or real numbers values like 99.9, 10.5, etc.  Double - Very large numeric values which are not allowed in Integer or Floating point type.  Void - This means no value. This data type is mostly used when we define functions.
  • 4.
    Keywords Datatype Keyword Character char Integerint Floating-point float Double double Void void
  • 5.
    Int  Integer arewhole number  Zerp,positive or Negative value  But no decimal value.  i.e int id; id=101; printf(“%d”,id);  End with semicolon
  • 6.
    Char  Keyword “char“ used  It accept the alphabets  i.e char test=‘h’; Printf(“%c”,test);
  • 7.
    Float and Double Used to hold the real numbers.  i.e float salary; double price;