TaskI am new to C++ and I have small problem. I want to make program where I scan two numbers and get their sum: e.g. Input: 1 2 Output: 3
Input. 1.1 2.2 Output: 3.3
I struggle with switching between float or int. If I scan for int(%d) I can't get float variable, but if I scanf float then as 1st output I get 3.00 instead of 3. By this I want to achieve that decimal number will be in decimal form and number like 3 in its form without decimal zeros.
Thanks