I want to make simple program with X and N type double so if a user enter a number that is 4.4 then do-while loop gets out and prints bla bla.
And if user enters a number that is 5.6 then do-while needs to get back and make user to enter a number that is lesser than n.5
Is it even possible to make condition with type double?
#include <stdio.h>
int main(){
double x=0.0,n=0.0;
do{
printf("Enter n(so it's less than n.5):");
scanf("%lf",&n);
x = n - (int)n;
}while(n<=0.0 && x>=0.5);
printf("Integer part is %d\nDecimal is %.3lf\n",(int)n,x);
return 0;
}