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?


February 02, 2009 00:08:54 #1
 elephantpaw   Member Since: February 2009    Total Comments: 1 

RE: Fix Function
 
#include <iostream>
#include <math.h>
using namespace std;

int main()
{
cout<<"test ::"<< floor(2.5) <<" :: "<< floor(-2.25) ;
return 0;
}


     

 

Back To Question