I wrote a code in C++ to get an distance as feet and inches from the user where the feet is declared as type int and inches as float data type.
I test it and run fine.
Then an idea came to me to see if it accepts feet in other than int and I gave feet as floating point and here are the crazy result it is giving.
when I give the feet as float then it not even accepts inches and prints the option if i want to give other input or terminate. But when I end it by pressing ‘y’ then i saw something crazy. it separated the integer and fractional part and assigned the fraction part to inches. See the figure below