C# while loops ♾️

preview_player
Показать описание
C# while loops tutorial example explained

#C# #while #loop

using System;

namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{

// while loop = repeats some code while some condition remains true

String name = "";

while (name == "")
{
Console.Write("Enter your name: ");
name = Console.ReadLine();
}

Console.WriteLine("Hello " + name);

Console.ReadKey();
}
}
}
Рекомендации по теме
Комментарии
Автор

using System;

namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{

// while loop = repeats some code while some condition remains true

String name = "";

while (name == "")
{
Console.Write("Enter your name: ");
name = Console.ReadLine();
}

Console.WriteLine("Hello " + name);

Console.ReadKey();
}
}
}

BroCodez
Автор

HELP! I'M STUCK IN AN INFINITE LOOP!!!

juicedelemon
Автор

ok, this is my lesson #15. thank you broooo. i am excited to post the comment under last published video for c# and then move on to next language

anatolii
Автор

what if i wanted to user input to be an int and they place an empty int?

RyanRajesh-pr
Автор

Ваши уроки более яснее чем рассказывают об этом русские🤦🏻
Спасибо большое 🙏

leoaliev
Автор

Not going to lie, content like these should be often used by YouTubers instead of the other useless entertainment.

justsomepleb
Автор

do while loops restart if the condition is true again?

hggpi
Автор

Random rnd = new Random();
int num = rnd.Next();

vincdraws
Автор

My program start from Module Module1 then sub main () and end sub ()
Why mine and your syntax is different

muzamilzaman