Sabtu, Mei 31, 2014

Variable and Data Type on C Programming Language

There are 4 groups of standard data type of C programming language, i.e.:
  1. Character/string
    Data type:
    • char
      1 character, printf code: %c
    • char*/string
      >=1 characters (string),printf code: %s
  2. Integer
    Data type:
    • char(8 bit)
      signed: -128 up to 127, printf code: %d/%i
      unsigned: 0 s/d 255, printf code: %u
    • short int(16 bit)
      signed: -32768 up to 32767, printf code: %d/%i
      unsigned: 0 s/d 65545, printf code: %u
    • int (32 bit)
      signed: -2147483648 up to 2147483647, printf code: %d/%i
      unsigned: 0 s/d 4294967295, printf code: %u
    • long int (32 bit)
      signed: -2147483648 up to 2147483647, printf code: %ld/%li
      unsigned: 0 s/d 4294967295, printf code: %lu
  3. Fraction
    Data type:
    • float (32 bit): 3.4E-38 up to 3.4E+38
      ± 7 digit desimal, printf code: %f/%e
    • double (64 bit): 1.7E-308 up to 1.7E+308
      ± 15 digit desimal, printf code: %f/%e
    • long double (64 bit): 3.4E-4932 up to 3.4E+4932
      ± 15 digit desimal, printf code: %Lf/%Le
  4. True or False logic
    Data type: boolean, content True or False value
Sumber:
http://www.pintarcoding.com
http://49012012eko.blogspot.com

0 komentar: