Everything runs perfectly. If a user enters more than one to repeat the first for loop I want the question to say "Please enter number 2" and so forth. Is there way to do this within the same Console.WriteLine?
using System;
namespace Looping
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("How many numbers will you provide?");
int numbersProvide = Convert.ToInt32(Console.ReadLine());
int i;
for (i = 0; i < numbersProvide; i++)
{
Console.WriteLine("Please enter number:");
int enterNum = Convert.ToInt32(Console.ReadLine());
int j;
int sum = 0;
double addDiv;
for (j = 1; j <= 25; j++)
{
if (enterNum % j == 0)
{
addDiv = enterNum / j;
Console.WriteLine(enterNum + " is divisible by " + j + "(" + addDiv + ")");
sum += j;
}
}
Console.WriteLine("The sum of the quotient is: " + sum);
}
Console.ReadKey();
}
}
}
Just use the index variable
iof your loop