You can't do it portably in C; you have to take what the systems provide.
That said, on all systems I know of, sizeof(float) == 4
and sizeof(double) == 8
, but relying on that absolutely is dangerous.
Different machines can store the same value differently. They might use different floating-point formats, or they might all use IEEE 754. Even if they all use IEEE 754, they might store them in big-endian or little-endian order.
You must decide why you think they must all be the same size. The chances are, you are trying to take some unwarranted short cuts in relaying information between different machines. Don't take the short cuts; they will lead you into problems at some point. If you feel you must, you have to assess what your portability goals really are, and validate whether you can meet them with the design you're proposing. But be very cautious!