0
How to input root in a program
In the input box which appears for cin
6 Réponses
+ 1
THANKS
0
What exactly do mean with input root?
0
I mean to enter square root of a number
0
Actually I mad a quadratic equations program and when I input coefficients i want enter values like sqrt 2
0
In the input box
0
2 squared is usually written as 2^2 so you could write 2^0.5 for sqrt 2. You could use the sqrt sign √, too but I doubt that every keyboard has this letter.
Since it's text input you can decide how to handle it. You could even allow the user to simply type sqrt(2).