CONTROL FLOW

Cards (14)

  • %d - is for int
    %f - is for float
    %lf - is for double
    %c - is for char
    %s - is for strings
    %e - is for float represented in scientific notation
  • field width these specifications specify the allocation of space for the data being substituted.
  • Flags optional flags that control various aspects of formatting
  • Width Specifies the minimum width of the field.
  • .precision - For floating-point numbers, it specifies the number of digits after the decimal point.
  • Control flow Is one of the features of C programming that makes it a
    structured programming language.
  • Compound statements - These let you group statements into an executable unit or blocks. These are the control flow constructs that allow you to group multiple code functions and processes within a single control flow statement. These statements are enclosed in curly braces({}).
  • Nested statements These are the statements or constructs that are included inside or ‘nested’ in another control flow statement. This lets you add more branching paths to your control flow.
  • if statement This is the statement in C that lets you create branching paths. If statement works by evaluating a boolean expression and does the following code in its statement. It's generally understood as “if this condition is true then execute the following code.”
  • else statement This statement then works by catching the cases where the condition/s is false and executes the associated code in its statement.
  • else if statement This statement then combines the functionality of else and if statements. It works by catching the case where the preceding if statement is false and then evaluates it to its own condition to determine whether it should execute its associate code block.
  • Switch case This is a control flow statement that lets you match or ‘switch’ a particular value to multiple cases and execute the certain blocks of code. It is similar to a generalized version of the if else statement where one value or variable is compared to multiple literal constants or expressions.
  • break this statement disrupts or ‘breaks’ its parent or the control flow that it is included in. It is used to break out of the switch case statement which has the functionality of ‘falling through’ the cases if it has matched even one. And it is also used to break out of loops.
  • continue statement - This causes the current iteration of a loop to stop and then begin the next one immediately. It is used to skip over codes in a loop.