Hi
I'm a beginer programer and I need your help
I'm using visual studio 2005 writing with c#, Iwant to make a small program at console
this program give the root of a number.
I writ this code
double one = double.Parse(Console.ReadLine());
for (double x = 1; x <= one; x++)
{
double result = one / x;
if (result == x)
{
Console.WriteLine(result);
}
by this way it will give you the root but if it is a real number like (25-it's root 5)
when i make x increase by0.1 the code didn't do any thing the code will be
double one = double.Parse(Console.ReadLine());
for (double x = 1; x <= one; x+=0.1)
{
double result = one / x;
if (result == x)
{
Console.WriteLine(result);
}
I want to know why