What is the outcome of the line of code "cout<<abs(-
16.5);"?
1) 16
2) 17
3) 16.5
Answer Posted / 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 |
Post New Answer View All Answers
What are the 3 principles of oop?
What is abstraction with example?
Why multiple inheritance is not allowed?
Which is better struts or spring?
Why do we use polymorphism?
What is encapsulation c#?
What is multilevel inheritance explain with example?
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.
Why is static class not inherited?
What is encapsulation in oop?
Can static class have constructor?
How do you use inheritance in unity?
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
What is cohesion in oop?
What is the real time example of encapsulation?