Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 ..

Answer / shailaja

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 ..

Answer / prabakaran

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 ..

Answer / rajavel

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 ..

Answer / d n gavade

abs() function returns absolute value of given arguments in
integer form because its return type is integer.
so answer will be 16.

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 ..

Answer / neeraj

16

Is This Answer Correct ?    5 Yes 2 No

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

Answer / pds

16

Is This Answer Correct ?    3 Yes 1 No

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

Answer / ankit

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 ..

Answer / arash s

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 ..

Answer / nathusingh rathod

Right answer for this question is 16. Had there been fabs
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 ..

Answer / deep

16.5

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

how to write a java program for an output ****0 ***01 **012 *0123 01234

1 Answers  


Explain the advantages of inheritance.

0 Answers   TCS,


This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.

0 Answers  


what is polymorphism?

4 Answers  


DIFFRENCE BETWEEN STRUCTURED PROGRAMING AND OBJCET ORIENTED PROGRAMING.

5 Answers  


What is constructor overloading in oop?

0 Answers  


What is the difference between class and structure?

7 Answers  


can we create and enter the data & hide files using programmes ?

2 Answers   Wipro,


What is the full form of oops?

0 Answers  


In c++ there is only virtual destructors, no constructors. Why?

4 Answers   IBM, Polaris,


What is difference between function overloading and overriding?

1 Answers   emc2,


What is encapsulation process?

0 Answers  


Categories