Preview

C++ Reviewer

Satisfactory Essays
Open Document
Open Document
450 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
C++ Reviewer
Components of C++
An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. C++ is rich in built‐in operators and provides following type of operators:
     

Arithmetic Operators Relational Operators Logical Operators Bitwise Operators Assignment Operators Misc Operators

This chapter will examine the arithmetic, relational, and logical, bitwise, assignment and other operators one by one.

Arithmetic Operators:
There are following arithmetic operators supported by C++ language: Assume variable A holds 10 and variable B holds 20 then: Operator + ‐ * / % ++ ‐‐ Adds two operands Subtracts second operand from the first Multiply both operands Divide numerator by de‐numerator Modulus Operator and remainder of after an integer division Increment operator, increases integer value by one Decrement operator, decreases integer value by one Description Example A + B will give 30 A ‐ B will give ‐10 A * B will give 200 B / A will give 2 B % A will give 0 A++ will give 11 A‐‐ will give 9

Relational Operators:
There are following relational operators supported by C++ language Assume variable A holds 10 and variable B holds 20 then: Operator == != > = B) is not true. (A = B) is not true. (A (arrow) Cast & * Description sizeof operator returns the size of a variable. For example sizeof(a), where a is integer, will return 4. Conditional operator. If Condition is true ? then it returns value X : otherwise value Y Comma operator causes a sequence of operations to be performed. The value of the entire comma expression is the value of the last expression of the comma‐separated list. Member operators are used to reference individual members of classes, structures, and unions. Casting operators convert one data type to another. For example, int(2.2000) would return 2. Pointer operator & returns the address of an variable. For

You May Also Find These Documents Helpful

  • Satisfactory Essays

    cout << "Select the operator you want to work (+ for addition, - for subtraction , * for multiplication , / for division):- ";…

    • 426 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    There is nothing wrong with this discussion question response. Accordingly, I awarded the author a score of 10. Each paragraph is written to explain each operator. Clearly, this is good writing. Each paragraph uses vocabulary from the reading material, and gives insight into the operation of each operator. This response explains the unary operator “++” is used for adding one to a variable, the conditional-and-operator “&&” is used between testing expressions, the inequality operator ”!=” is used to rule out a possible value, and the “%=” operator is used to return the remainder of a division operation( to the variable to the left of this assignment operator ). Thank…

    • 110 Words
    • 1 Page
    Satisfactory Essays
  • Powerful Essays

    ● Converts the value of i to double and stores it in d. This conversion is done automatically by the compiler, because double data type is normally wider than int, there is absolutely no risk storing int in double.…

    • 2338 Words
    • 10 Pages
    Powerful Essays
  • Good Essays

    operator → + | * | - | / | > | < | = etc.…

    • 703 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Pt1420 Unit 1 Assignment 2

    • 1305 Words
    • 6 Pages

    Das, D., Gregersen, E., Hosch, L., Lotha, G., Sampaolo, M., Sinha, S. (2014). C++. In Encyclopedia Britannica.…

    • 1305 Words
    • 6 Pages
    Powerful Essays
  • Satisfactory Essays

    Intro to Unix Project 2

    • 636 Words
    • 3 Pages

    Redirection operators are formed mainly from three characters: the leftward pointing angle bracket ( < ), the rightward pointing angle bracket ( > ) and the vertical bar ( | ). In some cases the ampersand ( & ) and the numeral 2 are also used.…

    • 636 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    EAS230Syllabus

    • 1748 Words
    • 8 Pages

    C++ programming: editing, compiling, user I/O, variables (ints, doubles, char, strings, booleans), loops, decisions, functions, pointers, arrays, tables, databases, sorting.…

    • 1748 Words
    • 8 Pages
    Powerful Essays
  • Satisfactory Essays

    Maths Order of Operation

    • 291 Words
    • 2 Pages

    If I was to invent a new notation where the order of operation was made clear, I would have used colours. I would have assigned each operator a…

    • 291 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    NT1110

    • 315 Words
    • 2 Pages

    Chapter two discusses the understanding of computer, math, and measurements. Also, it shows you how we use computer math with computer hardware and systems. Some of these concepts are bits versus bytes, binary versus decimal, Boolean operators, hertz, and data transfer. The chapter two also shows numbering systems used in computers. These are some importance skills that will help you in the computer field.…

    • 315 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    science 23 answers

    • 12424 Words
    • 61 Pages

     Whenever a boolean type result is required in C (e.g., in an "if" statement),…

    • 12424 Words
    • 61 Pages
    Satisfactory Essays
  • Good Essays

    EFT4 Task7 lesson plan

    • 1113 Words
    • 5 Pages

    1.3.8: Students will generate and solve two-step addition and subtraction problems and one-step multiplication problems based on practical situations. Model addition, subtraction, multiplication, and division in a variety of ways. Use mathematical vocabulary and symbols to describe multiplication and division.…

    • 1113 Words
    • 5 Pages
    Good Essays
  • Good Essays

    Simplifying Expressions

    • 656 Words
    • 3 Pages

    In arithmetic we use only positive numbers and zero, but with algebra, we use both positive and negative numbers. The numbers we use in algebra are called the “real numbers” or integers {… , -3, -2, -1, 0, 1, 2, 3…}. In this paper I am going to explain the properties of real numbers using three examples. I will also be explaining how to solve these examples step by step, all while discussing why these properties are so important to begin with. The properties of real numbers are the commutative, associative, identity, and additive inverse properties of addition, distributive law, and the commutative, associative, identity, and the multiplicative inverse (reciprocal) of multiplication.…

    • 656 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Order of Operations

    • 328 Words
    • 2 Pages

    The Operation Symbols that are needed for a person to be familiar with are Muliplication, Division, Addition, and Subtraction.…

    • 328 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    mr angola

    • 329 Words
    • 2 Pages

    Write a Java program to perform basic arithmetic operations which are multiplication and division of two numbers. Numbers are assumed to be integers and will be entered by the user…

    • 329 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    1.2 Write a Java program to display default value of all primitive data types of…

    • 2916 Words
    • 12 Pages
    Good Essays

Related Topics