how to run Floor and ceil program with if then?
i have make the program but i cann't result.
someone maybe help me,please
this is my program:
#include <stdio.h>
#include <math.h>
int main(void){
double n;
long int c,f;
scanf("%lf",&n);
if(n==trunc(n)){//pembulatan bilangan real n
n=trunc(n);
printf("%.lf %.lf\n",n,n);
}else if(c>0){//jika c positif maka floornya c itu sendiri dan ceillnya floor +1
c=trunc(n);
f=c+1;
printf("%ld %ld\n",c,f);
}else if(c<0){//jika c negatif maka floornya c-1 dan ceilnya c itu sendiri
c=trunc(n);
f=c-1;
printf("%ld %ld\n",f,c);
}