I\'m writing a project that we do simple calculator from command line. The users input in this format programname firstNumber operator secondNumber. Here what I
The problem is how you transform the string in numbers: you are using atoi which like its name suggests transforms the input in a integer.
atoi
The solution is to simply replace this by atof which will read correctly floating-point numbers.
atof