What are the different operators in C++?
Answers were Sorted based on User's Feedback
Addition: +
Subtraction: ?
Addition Assignment: +
Assignment:
Bitwise AND Assignment: &
Bitwise exclusive OR Assignment: ^
Bitwise inclusive OR Assignment: |
Division Assignment: /
Left shift assignment: <<
Modulus Assignment: %
Multiplication Assignment: *
Right shift assignment: >>
Subtraction Assignment: ?
Bitwise AND: &
Bitwise exclusive OR: ^
Bitwise inclusive OR: |
Logical
Logical AND: &&
Logical OR: ||
Miscellaneous
Comma: ,
Conditional: ? :
Pointer-to-member: .* or ?>*
Reference: &
Scope resolution: ::
Multiplicative
Division: /
Modulus: %
Multiplication: *
Postfix
Cast: ()
Function call: ( )
Member access: . and ?>
Postfix decrement: ??
Postfix increment: ++
Subscript: [ ]
Relational and Equality
Equality: ==
Greater than or equal to: >=
Greater than: >
Less than or equal to: <=
Less than: <
Not equal: !=
Shift
Left shift: <<
Right shift: >>
Unary
Address-of: &
delete
Indirection: *
Logical Negation: !
new
One's Complement: ~
Prefix decrement: ??
Prefix increment: ++
sizeof
Unary Plus Operator: +
Unary Negation Operator: -
Is This Answer Correct ? | 16 Yes | 8 No |
Answer / shweta iyer
1)Arithmetic: for general arithmetic operations. They are "+,-, *,/,%".
2)Relational: for performing operations based on relations.They are ">,<,>=,<=,==,!=".
3)Logical: for performing ooperations based on some logics.They are "AND,OR,NOT".
4)Conditional: it works as simple if-else.It is "?:"
5)Assignment: used to assign some values to the variables. It is "="
6)Increment/Decrement: used to increase or secrease the value of any variable. They are : "++" for increment and "--" for decrement.
7)Bitwise: used to perform operations on bits. They are "&,^,<<,>>"
8)insertion : used to display any value or statement on screen. It is "<<"
9)extraction : used for input. It is ">>"
10)scope resolution: to define the scope of a function member. It is "::"
11)field width: used to set wiidth of the field. It is "setw"
12)memory allocation: to allocate new spaces in memory. It is "new".
13)memory release: to free the memory. It is "delete".
14)line feed: It is used to provide a new line. It is "endl".
15)pointer to member: it is used for pointers. It is .* and .->
Is This Answer Correct ? | 6 Yes | 0 No |
Write a program that will count the number of digits in an input integer up to value MAX_VALUE (2147483647). Thus, for an input of 5837 the output should be 4 digits Make sure that your program works for the numbers 0, 1, and 10. For the number 0, the output should be 1 digit
What are maps in c++?
What is a hashmap c++?
What is implicit conversion/coercion in c++?
What is the stack?
Is sorted c++?
Compare compile time polymorphism and Runtime polymorphism
Explain one-definition rule (odr).
Explain the difference between static and dynamic binding of functions?
How to give an alternate name to a namespace?
Declare a class vehicle and make it an abstract data type.
How a new operator differs from the operator new?