What is the outcome of the line of code "cout<<abs(-
16.5);"?
1) 16
2) 17
3) 16.5
Answers were Sorted based on User's Feedback
Answer / naga
Ans: 16.5
The numerical value of a real number without regard to its
sign. For example, the absolute value of −4 (written |-4|)
is 4. Also called numerical value.
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / pramod
The result is compiler error .....Because abs(int) and
abs(long) are the two overloaded functions. When a call to
abs(-16.5) is made, compiler can not find out which one to call.
| Is This Answer Correct ? | 0 Yes | 1 No |
What are the 4 pillars of oop?
what is the use of classes in c++;
how to find the correct email address format by using the programe?
Why multiple inheritance is not possible?
What is data binding in oops?
Templates mean
State what is encapsulation and friend function?
what is difference between String s=new String("vali"); String s="vali"
suppose A is a base class and B is the derved class. Both have a method foo which is defined as a virtual method in the base class. You have a pointer of classs B and you typecast it to A. Now when you call pointer->foo, which method gets called? The next part of the question is, how does the compiler know which method to call?
Why it is called runtime polymorphism?
what is object slicing
write a program to find the largest of two numbers without using for,while,switch,if else, conditional operator and do while using c++ pgmng language