Code is returning: "The left-hand side of an assignment must be a variable, property or indexer"
I'm still new to C# (coming from python), but I understand this issue, however I've got no clue how to fix it
I essentially want to have input initially equal x round x each cycle and multiply that rounded number by input y:
Console.WriteLine ("input x:");
int inputx = Convert.ToInt32(Console.ReadLine());
Console.WriteLine ("input y:");
double y = double.Parse(Console.ReadLine());
double input = inputx;
for (int i = 0, i < a, i++)
Math.Round(input) *= y;
Console.WriteLine ("Value output: {0}", input);
The error comes from the line in the loop. What it's trying to do is to multiply
Math.Round(input)andy, and then assign the result toMath.Round(input)which isn't a variable, it's and expression.To get it to work you'll have to separate the multiplication and the assignment, instead using the following line.