GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Programming  >  C

 Print  |  
Question:  Fix Function

Answer: Write the implementation of Fix function? fix(2.5) = 2 and fix(-2.25) = -3, this is the expected result. Write the code to implement this behaviour?


March 03, 2009 01:09:48 #3
 seemakadavan   Member Since: March 2009    Total Comments: 2 

RE: Fix Function
 
There is one problem with this code. If you give the input as -2.0, it gives the output as -3.0 instead of -2.0
     

 

Back To Question