using System;
using System.ComponentModel.Design;
using System.Threading.Channels;
namespace IfStatements
{
class Program
{
static void Main(string[] args)
{
int counter = 0;
string enteredText = "";
while (enteredText.Equals(""));
{
Console.WriteLine("Please press enter to increase amount by 1," +
" and anything else if you want to finish counting.");
enteredText = Console.ReadLine();
counter++;
Console.WriteLine("Current count of people inside is {0}", counter);
Console.Read()
}
}
}
}
This code worked in the video I was watching but not for me (I'm a beginner and taking a course).
Just Remove ;
from the end of the while loop ...
// while (enteredText.Equals(""));
while (enteredText.Equals(""))
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments