What are the different operators in C++?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is prototype for that c string function?

701


Is c++ a good first language to learn?

584


What is dynamic and static typing?

685


What is the extraction operator and what does it do?

624


List down the guideline that should be followed while using friend function.

656






When do you call copy constructors?

661


What is object file? How can you access object file?

606


Will rust take over c++?

602


what is software cycle? What is a mission critical system ? What is the important aspect of a real-time system ? Explain the difference between microkernel and macro kernel. Give an example of microkernel.Why paging is used ? Which is the best page replacement algo and Why ? What is software life cycle ? How much time is spent usually in each phases and why Which one do U want to work if selected in Honeywell ? Which are the different types of testing ? What is a distributed system ? Some questions about CSP. Which languages do U know ? What are the differences between Pascal and C. questions from Compiler construction and Lisp. Which are the different computer architecture? What is the requirement in MIMD ? What is the difference between RISC and CISC processors ? Difference between loosely coupled and tightly coupled systems ? What is an open system?

1782


How do you define/declare constants in c++?

623


What is c strings syntax?

618


In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?

603


What are references in c++?

672


What is meant by forward referencing and when should it be used?

569


What is cout flush?

578