Every time i print height or length, the value is 0. It's like C doesn't save the value of xHeight, yHeight, xLength or yLength. I checked, and i don't think is a syntax problem.
#include <stdio.h>
#include <stdlib.h>
int main()
{
float xHeight,yHeight,xLength,yLength, height = 0.0, length = 0.0;
printf("Tell me the x and y: \n");
scanf(" %.2lf", &xHeight);
fflush(stdin);
scanf("%.2lf",&yHeight);
fflush(stdin);
height = xHeight - yHeight;;
printf("\n%.2lf",height);
printf("Now tell me another x and y: \n");
scanf(" %.2lf", &xLength);
fflush(stdin);
scanf("%.2lf",&yLength);
fflush(stdin);
length = xLength - yLength;
printf("\n%.2lf", length);
printf("\n==========================================\n");
printf("The perimeter of this rectangle is %.2lf", 2*(length+height));
return 0;
}