Will the Following code compile ? double d = 5689.56; int i = d;

 Posted by Chvrsri on 3/24/2011 | Category: C# Interview questions | Views: 6939 | Points: 40
Select from following answers:
  1. Yes, It Will Compile without an error
  2. No, It will not Compile
  3. Data Insufficient
  4. All Above

Show Correct Answer

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Muralik.it on: 6/7/2011 | Points: 10
it will not compile

Error 1 Cannot implicitly convert type 'double' to 'int'. An explicit conversion exists (are you missing a cast?)
Posted by: Chvrsri on: 6/7/2011 | Points: 10
Hi Muralik.it ,

Thanks for your response. Thats what exactly i have mentioned in the justification part also mentioned how succesfully it can be done.


Login to post response