I have created this class for complex number
using System;
using System.Collections.Generic;
using System.Text;
namespace borrar
{
public class Complejos
{
public Complejos()
{
}
private double real;
private double imaginario;
public Complejos(double Real, double Imaginario)
{
real = Real;
imaginario = Imaginario;
}
public double Real { get; set; }
public double Imaginario { get; set; }
}
}
There are no error messages, but if I use the constructor with two elements, it always return 0. For instance, if I write
class Program
{
static void Main(string[] args)
{
Complejos pruebas = new Complejos(1, 1);
Console.WriteLine(pruebaas.Real);
}
}
Visual studio returns 0.
I do not find out the error, could somebody telle me how can I fix it? Thanks ad advance.