When I run my while loop, nothing shows up

Ayman khaled
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).

Hossein Sabziani

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.

edited at
0

Comments

0 comments
Login to comment

Related

When I clicked on submit button nothing showed up in my database

While loop, how do I condition for when input equals nothing?

I'm trying to run a simple print script in Visual Studio Code with Python, but nothing shows up in terminal or output

Why is nothing happening when I run my program?

When I run this code only the Splitpane shows up but not the JMenu

I’m getting an IP address conflict but when I check the IP address, nothing shows up?

When I run Windows Virtual PC on Windows 7 it just shows me the folder with my Virtual PC files. What's up?

Why does my for loop only run when inside of a while loop?

My while-loop is not working. When I run it, it always give me infinite output

When I add script code in wordpress' text editor, nothing shows up

How can I run a while loop without holding up the program?

When I run my application In simulator it shows some autolayout errors

My JRadioButton does not shows when I run but when I click on that area it shows

Nothing shows up in RecyclerView

Why does bootstrap not show up when I run my website?

I want to select div tag with specific class. But my spider returns nothing when I run it?

I moved a new program into my bin folder, but nothing happens when I try to run it

When I run my code, nothing is returned, yet there are no errors and I called to the methods

How do I remove the extra brackets that shows up when I console log my code?

When I run my application on my Android Phone from Android Studio, it shows blank screen

Why it ignores my while condition when I input an void string ('nothing here')?

Why is etree returning nothing from my SVG when I run `for glyph in font.iter('glyph')`?

Why is my while loop not terminating when i < 0?

While Loop Doesn't End when i call my function

why does my while loop not stop when I type stop?

Nothing Shows up on scene in SpriteKit

When I click run, nothing happens

While installing hadoop, when I run start-dfs.sh command it shows 'no such file or directory found'

When I Render An Image In Blender My UV Texture Shows Up White