Im trying to loop through a string array named string[] splitWords. The array is in the following format:
// Write your main here
Write("Enter a number between 1 & 10: ");
int input = Convert.ToInt32(ReadLine());
Random ranNumberGenerator = new Random();
int randomNumber;
randomNumber = ranNumberGenerator.Next(1, 11);
if (input == randomNumber)
{
WriteLine("correct");
}
else if (input < randomNumber)
{
WriteLine("too low");
}
else
{
WriteLine("too high");
}
Im currently trying to loop through the array which has each element split up individually and assign it to an object array. For example, need to be in their own object array element and so on (every 3 elements). And so in total, there will be 5 elements in the object array. Currently my code is not working, or giving me any errors.
// Write your main here
Write("Enter a number between 1 & 10: ");
int input = Convert.ToInt32(ReadLine());
Random ranNumberGenerator = new Random();
int randomNumber;
randomNumber = ranNumberGenerator.Next(1, 11);
if (input == randomNumber)
{
WriteLine("correct");
}
else if (input < randomNumber)
{
WriteLine("too low");
}
else
{
WriteLine("too high");
}