The roots of the equation are int or float?
The output should be in float or int?
Hello @ankitdelhi20,
What would be the best way to answer this question?
By trying it yourself.
You can write a code by taking root as float.
Then it would hardly take 15 seconds to change the datatype of roots to int and run it again.
Tadda… Here’s the answer to your question.
My intentions of saying above are not to make you feel bad.
I want you to realize that if you really wants to generate an interest for coding, then the only way is by actually writing codes.
The more you would code, the more you would learn.
So, raise a doubt in extreme situations or if you are unable to find any solution to your problem by yourself or if you do not understand something.
Start trying things.
Hope, you would understand what I am trying to conclude.
BTW, coming back to your doubt, the values of roots can be float also.
So ideally, you should choose float as a datatype for variable root.
But, as per the testcases of this problem, your code will run for int datatype without any failure.
Hope, it will help.
Give a like, if you are satisfied.