Lesson 3: iterations, logical values

Iterations

  • cycle do-while
    • comparison with the while cycle
  • cycle for
    • transformation to the while cycle

Logical values

  • bool datatype
    • logical constants true and false
    • logical operator
      • logical product, logical sum, negation
      • shortened evaluation of logical sum and logical product
    • conversion of numerical expression to logical value
      • zero is converted to false, non zero value to true

Examples

  • factorial calculation
    • limited range of numerical data types
    • use of recursion
  • parity test
  • sum of row of numbers entered by user

Attachments

Poslední úprava stránky: 18.10.2022, 12:23
Powered by PmWiki