Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

Which of the following option will solve the problem? - Select option

  Shared By: Shruti Sharma    Date: Dec 15    Category: C++ Programming    Views: 822

Answer:

Consider the following code snippet:
1. class sample
2. {
3. public:
4. explicit sample(float);
5. int a;………………
5. }

6. sample x=10.5;

The code will not compile. Which of the following option will solve the problem?

Options

a) Line 6 should be changed to sample x(10.5);
b) In line 4, explicit keyword should be removed
c) Both a and b
d) Either a or b

Answer : d) Either a or b

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: