OPERATORS

Cards (20)

  • Logical -These are the operators that are used to connect two or more boolean/conditional expressions producing a boolean result. These are used to make complex and compound conditions.
  • || Logical OR - returns true if atleast one of the expressions is true, and false if otherwise.
  • && Logical AND - only returns true if both expressions are true, and false if otherwise
  • Unary - These are operators that work with a single operand or variable to produce a new value. These are usually placed just before the value or variable
  • - This is called the unary minus. It changes the sign of the value
  • ++ This is the arithmetic increment operator. It means increasing the value by one.
  • -- This is the arithmetic decrement operator.
  • ! This is the Logical NOT operator. It reverses the truth value of a boolean expression.
  • * This asterisk is also used for pointer dereferencing and declaring pointer variables.
  • & This ampersand is the address-of operator. This is used to get the memory address of variables
  • Ternary - This is also known as the conditional operator. This is similar in functionality to the if-else statement but is much more simple and concise
  • ? : It evaluates a condition placed before the question mark and returns either of the two values separated by the semicolon.
  • Combined - This is the operator that combines two operators for conciseness or brevity of code
  • This arithmetic operator combines the assignment operator with an arithmetic operator
  • Header This includes any #include statement for libraries and #define for macro definitions. In other words, all the preprocessing required to run your program.
  • main() this is otherwise known as the ‘entry point’ of the program as this is the main function that starts the program. And just like other functions, it has an optional data type for return values and a parameter list
  • Declaration of local variables the creation of local variables for later use within the function.
  • Prompt Is an optional part of programming that lets the user know what input is expected of them.
  • Input Is the processing of input from the user. In this case, the function scanf() was used as the input function..
  • Initialization and operation of local variables the assignment and operation of the variables