Question: Why is my upper digit 3.6? I wanted the Upper Digit value to be casted to an int, in this case, the Upper digit value

Why is my upper digit 3.6? I wanted the Upper Digit value to be casted to an int, in this case, the Upper digit value should be 3. For example, if float voltage is 4.5 => upper digit value is 4 and lower digit value is 5. How do I do this? The end result should show Upper digit = 4 and lower digit = 5 , not 0.5
TEST CASE:
4.5 = > Upper digit = 4 , Lower digit =5
3.6 => Upper digit = 3 , Lower digit = 6
1' /**** 2 3 Welcome to GDB Online. 4 GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, 5 C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS 6 Code, compile, Run and Debug online from anywhere in world. 7 8 ********* 9 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
