Expressions_Quiz.md - brainchildservices/curriculum GitHub Wiki

  1. What is Operator?

    • Operators are used to perform operations on variables and values.
  2. What is a C# expressions?

    • An expression in C# is a combination of operands (variables, literals, method calls) and operators that can be evaluated to a single value. c=a+b; a,b,c are the operands.
  3. What are Unary operators?

    • _ the unary operators operates on a single operand. C# unary operators Operator Operator Name Description_
  4. What are Arithmetic operators?

    • _ Arithmetic operators are used to perform arithmetic operations such as addition, subtraction, multiplication, division, Modulo._
  5. What are Logical operators?

    • Logical operators are used to perform logical operation such as and, or. Logical operators operates on boolean expressions (true and false) and returns boolean values. Logical operators are used in decision making and loops.
  6. What is a ternary Operator?

    • C# includes a decision-making operator ?: which is called the conditional operator or ternary operator. It is the short form of the if else conditions
  7. Define Syntax of Ternary operator?

    • datatype variable= comparison_expression ? true_condtion : false_condtion;
  8. What is Boolean expression?

    • A Boolean expression is a C# expression that returns a Boolean value: True or False.
  9. What will be the result if the number =10.

    bool isEven = (number % 2 == 0) ? true : false ;

    • Result=true
  10. Explain primary and constant expression?

    • Primary expressions are the simple expressions which include the expressions composed by using operators.
    • Constant expressions are values determined solely at compile-time, including string concatenation of other constant expressions, arithmetic etc.