Answer Posted / 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 |
Post New Answer View All Answers
Who invented oop?
Where You Can Use Interface in your Project
Which is not an object oriented programming language?
What is property in oops?
How many human genes are polymorphic?
What is destructor give example?
write a program to find 2^n+1 ?
Can an interface inherit a class?
What is the difference between abstraction and polymorphism?
What is the point of oop?
What is the real time example of encapsulation?
Explain virtual inheritance?
What is class in oop with example?
What is the difference between a constructor and a destructor?
What is polymorphism used for?