Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

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

What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 ..

the outcome of this code is 16.5
bcz it will return the absolute value of parameter.

 Is This Answer Correct ? 18 Yes 6 No

What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 ..

1)16
because abs() is used to calculate the absalute value of
integer only,so it convert the floating point value -16.5
into -16,and
calculate tha abs() value

 Is This Answer Correct ? 8 Yes 2 No

What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 ..

16.5
this is abs value

 Is This Answer Correct ? 7 Yes 2 No

What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 ..

abs() function returns absolute value of given arguments in
integer form because its return type is integer.

if it is fabs() then only we get answer in float,double.

 Is This Answer Correct ? 5 Yes 1 No

What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 ..

16

 Is This Answer Correct ? 5 Yes 2 No

What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 ..

16

 Is This Answer Correct ? 3 Yes 1 No

What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 ..

I ran it on my PC and got the result as 16

 Is This Answer Correct ? 3 Yes 1 No

What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 ..

16
just read what is "absolute" and u will know why.

 Is This Answer Correct ? 1 Yes 0 No

What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 ..

then result would have been 16.5 but as there is only abs()
so it will return integer value i.e 16.

 Is This Answer Correct ? 1 Yes 0 No

What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 ..

16.5

 Is This Answer Correct ? 0 Yes 0 No

More OOPS Interview Questions

Is html an oop?

what is the application of oops?

What is purpose of inheritance?

How do you explain polymorphism?

what is the definition of incapsulation

how much classes are used in c++

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

How to hide the base class functionality in Inheritance?

what is runtime polymorphism? For the 5 marks.

pointers are support in C#? if yes then how to use it?

In OverLoading concept,Why they are not consider return value and why they are consider only parameters in method? For ex: public int Add(int a,int b){...} public String Add(int a,int b){...}

what is the difference between ERROR and EXCEPTION?

Categories