0

How to input root in a program

In the input box which appears for cin

15th Dec 2019, 3:23 PM
Ritwik
6 Réponses
+ 1
THANKS
16th Dec 2019, 9:13 AM
Ritwik
0
What exactly do mean with input root?
15th Dec 2019, 4:15 PM
Aaron Eberhardt
Aaron Eberhardt - avatar
0
I mean to enter square root of a number
15th Dec 2019, 4:59 PM
Ritwik
0
Actually I mad a quadratic equations program and when I input coefficients i want enter values like sqrt 2
15th Dec 2019, 5:01 PM
Ritwik
0
In the input box
15th Dec 2019, 5:01 PM
Ritwik
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).
15th Dec 2019, 5:42 PM
Aaron Eberhardt
Aaron Eberhardt - avatar