1

Is it possible to enter '4./2.' as character input, and then inside the program convert it to real number which the result is 2?

For example, while the program is executing I would write 4./2. at the screen prompt and then the program will write 2. on the screen.

ClickRick
  • 1,553
  • 2
  • 17
  • 37
amin bk
  • 194
  • 1
  • 1
  • 12

1 Answers1

1

The short answer is that you need to parse the input string yourself and evaluate the expression.

There are similar questions (with answers) for:

though none of them has a direct "out of the box" working answer which will work for you without you writing you own equivalent code.

Community
  • 1
  • 1
ClickRick
  • 1,553
  • 2
  • 17
  • 37