// datatype_test.c - a few things that can be done with
// some primitive datatypes and printf in C

unsigned char a_uchar_ = '\0';
unsigned int a_uint_ = 0;
double a_double_ = 0.0;

main()
{
  a_uchar_ = 'x';
  printf("a_uchar_ has the content %c\n",a_uchar_);

  // how do we get the ASCII-Code of a char?
  printf("%c has the ASCII-Code %u\n",a_uchar_,a_uchar_);

  // it is possible to do calculations on chars!
  a_uchar_ = a_uchar_ + 1;
  printf("after adding 1 to a_uchar_, it contains %c\n",
         a_uchar_);

  // what is the 4th letter in the alphabet?
  a_uchar_ = 'a' + 3;
  printf("the fourth letter in the alphabet is %c\n",
          a_uchar_);

  // chars are integral datatypes, so the following 
  // assignment works
  a_uint_ = a_uchar_;
  printf("a_uint_ has the content %c\n",a_uint_);

  // output for double datatypes:
  a_double_ = 17.25;
  printf("a_double_ has the content %f\n",a_double_);  
}
