*case 1 :*
#include <stdio.h>
#include <math.h>
#include <conio.h>
int main()
{
    float i = 2.5;
    printf ("%f %f\n", floor(i), ceil(i));
    getch();
    return 0;
}
*ans : 2.000000 3.000000*

*case 2: *
#include <stdio.h>
#include <math.h>
#include <conio.h>
int main()
{
    float i = 2.5;
    printf ("%d %f\n", floor(i), ceil(i));
    getch();
    return 0;
}

*ans: 0 0.000000*
*
case 3 :*

#include <stdio.h>
#include <math.h>
#include <conio.h>
int main()
{
    float i = 2.5;
    printf ("%f %d\n", floor(i), ceil(i));
    getch();
    return 0;
}

*ans: 2.000000 0*

*case 4:*
#include <stdio.h>
#include <math.h>
#include <conio.h>
int main()
{
    float i = 2.5;
    printf ("%d %d\n", floor(i), ceil(i));
    getch();
    return 0;
}

*ans : 0 1073741824*

case 1 : nothing new .
case 2 and case 3 : it seems to me... as ceil and floor returns double
values 64 bit , so when converting into int , LSB of 64 bits is given to 32
bits , so 0 is produced as answer..
case 4: i don have any idea.

may be i am wrong regarding case 2 and 3  but confident about case 1 , lol
;)
help me regarding this.

-- 
Lalit Kishore Sharma,

IIIT Allahabad (Amethi Capmus),
6th Sem.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to