We have a new lab in programming class where we are supposed to use a while loop to generate random numbers until they reach a final sum of 100. I'm not asking for the answers, I was just wondering if anyone could point me in the right direction. Here's the code I have so far. Bare with me here.
namespace Lab16RandomNums
{
class Program
{
static void Main(string[] args)
{
// Variables for lab
Random rand = new Random();
int sum = 0;
int num = 0;
// Code for lab
while (sum < 100)
{
num = rand.Next(10);
Console.WriteLine("number = " + num);
}
}
}
}