What is difference between Unary and binary operators and how-02317

Online Quiz This subjective question is related to the book/course vu mth718 Topics in Numerical Methods. It can also be found in vu mth718 Mid Term Solved Past Paper No. 4.

Question 1: What is difference between Unary and binary operators and how they can be overloaded?
Answer:
Unary operator takes one argument. a++ is an example of unary operator
Binary take two operators +,-,* are example of binary operators
Overloaded binary operator may return any type
Here is general syntax of overloading
Return-type operator symbol (parameters);
Operator is keyword
Page. No. 10/15

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background