[ create a new paste ] login | about

Link: http://codepad.org/VYiW59gf    [ raw code | output | fork ]

C, pasted on Mar 3:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>

main() {
    float x;
    scanf("%f",&x);
    x=3.5;

    if ((x - ((int)x)) >=0.5){
        x=(((int)x)+2);
        printf("%.0f", x);
    }
    if ((x - ((int)x)) <=0.5){
        x = ((int) x );
        printf("%.0f", x);
    }   
}


Output:
1
55


Create a new paste based on this one


Comments: