What is a unary operator?
Answers were Sorted based on User's Feedback
Answer / ajay yadav
Unary operators are those...which operate on only one
operand.
For eg. a++(only one operand is present) as we are
incrementing the value for a.
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / ayesha
!
Logical NOT
&
Address-of
~
One's complement
*
Pointer dereference
+
Unary plus
++
Increment
–
Unary negation
––
Decrement
conversion operators
conversion operators
Of the operators shown in preceding table, the postfix
increment and decrement operators (++ and ––) are treated
separately in Increment and Decrement.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / sujatha
unary operator is an type of operator which have only one
operand.
ex : 1)unary plus or minus (to change the sign of variable)
2)increment or decrement ( increase or decrease the
value of variable)
unary plus or minus :
ex :
#inclucde<iostream.h>
void main()
{
int a=-10;
cout<<"a="<<(-a);
int b=20;
cout<<"b="<<++b;
}
out put :
a=10
b=21
| Is This Answer Correct ? | 2 Yes | 0 No |
Can we have inheritance without polymorphism?
Describe the difference between a Thread and a Process?
What is design patterns in C++?
write a program to find 2 power of a 5digit number with out using big int and exponent ?
What are the two different types of polymorphism?
In which cases you use override and new base?
how do you handle yourself when you feel the wald is aganist you
What is polymorphism oop?
create a class complex having real and imaginary part of a complex no. as a data member. overload the binary operators(+,- and *) to perform the operations on complex no. objects. overload binary operator using friend function.
2 Answers CTS, Delhi University,
What is multilevel inheritance in oop?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
Can we have a private virtual method ?