int a=Convert.ToInt32(Console.ReadLine());
int b=Convert.ToInt32(Console.ReadLine());
int c = a / b;
int b2 = b;
for(int i=0; i<=c; i )
{
b = (b2 * i);
Console.WriteLine(b-b2);
}
this is basic code that asks for a base number, and a secondary number. only numbers divisible by the second number are added together. I only want to output the final number, but right now it outputs every step it takes and I'm to noob to know an easy solution.
CodePudding user response:
Write the console.WriteLine() Outside the for loop to avoid printing it in every step.