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 |
What are oops functions?
c++ provides classes...and classes do what we want but why then strcut are used...if we say data hiding... it is also provided by c++ in structs then why to prefer clasess
difine hierarchical inheritance.
Name a typical usage of polymorphism
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.
What does and I oop mean?
write a program for function overloading?
14 Answers HCL, InfoCity, TATA,
what is pointers
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
What is polymorphism what are the different types of polymorphism?
any one please tell me the purpose of operator overloading