[fpc-pascal] Quiz

Adriaan van Os adriaan at adriaan.biz
Sun Jan 7 20:32:40 CET 2024


Quiz.

Which of below constant declarations are accepted by the compiler and what is their value ?

   const
     ki1                               = + 2;
     ki2                               = +2;
     ki3                               = 2+;
     kr1                               = 1.;
     kr2                               = 1e-2;
     kr3                               = 1e+2;
     kr4                               = 1.e+2;
     kr5                               = 1 . e + 2;
     kr6                               = 1 . 0 e + 2;
     kr7                               = 1.0e+2;
     kr8                               = 1.0 e + 2;

The more difficult question is, why ?

Regards,

Adriaan van Os


More information about the fpc-pascal mailing list