What is a unary operator?

Answers were Sorted based on User's Feedback



What is a unary operator?..

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

What is a unary operator?..

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

What is a unary operator?..

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

What is a unary operator?..

Answer / mahesh

unary operators r much useful in writting less code but much complex programms as they work on only one operator.

Is This Answer Correct ?    0 Yes 0 No

What is a unary operator?..

Answer / vishal sharma

++,--,+,- these are the unary operators.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

Prepare me a program for the animation of train

0 Answers  


What is sub classing in c++?

1 Answers  


We have a scale and 7 balls. 1 ball is heavier than all the rest. How to determine the heaviest ball with only 3 possible weighing attempts?

8 Answers   IBM, Sage, Vertex,


What do we mean by a hidden argument in a function?

1 Answers   TCL,


Why do we use encapsulation in oops?

0 Answers  






What is Inheritance, Multiple Inheritance, Shared and Repeatable Inheritance?

4 Answers   Accenture, L&T,


What is solid in oops?

0 Answers  


What is oop in simple words?

1 Answers  


what is the difference between class and object?

9 Answers  


How does polymorphism work?

0 Answers  


Write a program to get the binary tree.

3 Answers   ABC,


What is abstract class in oops?

0 Answers  


Categories