0% found this document useful (0 votes)
12 views5 pages

10# FOR Loop BREAK

Uploaded by

Lesunter KLter
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views5 pages

10# FOR Loop BREAK

Uploaded by

Lesunter KLter
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

10# FOR Loop BREAK

using System;
namespace darklter
{
class Program
{
static void Main(string[] args)
{
int j = 0;
while (j < 5)
{
Console.WriteLine(j);
j++;
}
}
}
}

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||

using System;
namespace darklter
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < 5; i++)
{
Console.WriteLine(i);
}
}
}
}

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||

using System;
namespace darklter
{
class Program
{
static void Main(string[] args)
{
string[] names = { "David", "Alenere", "Jasfer", "Ace", "Patrick",
"Jaymar", "Emman", "Ricardo" };

for (int i = 0; i < 5; i++)


{
Console.WriteLine(names[i]);
}
}
}
}
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||

using System;
namespace darklter
{
class Program
{
static void Main(string[] args)
{
string[] names = { "David", "Alenere", "Jasfer", "Ace", "Patrick",
"Jaymar", "Emman", "Ricardo", "Hezel" };

for (int i = 0; i < names.Length; i++)


{
Console.WriteLine(names[i]);
}
}
}
}

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||

using System;
namespace darklter
{
class Program
{
static void Main(string[] args)
{
string[] names = { "David", "Alenere", "Jasfer", "Ace", "Patrick",
"Jaymar", "Emman", "Ricardo", "Hezel" };

for (int i = names.Length - 1; i >= 0; i--)


{
Console.WriteLine(names[i]);
}
}
}
}

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||

using System;
namespace darklter
{
class Program
{
static void Main(string[] args)
{
string[] names = { "David", "Alenere", "Jasfer", "Ace", "Patrick",
"Jaymar", "Emman", "Ricardo", "Hezel" };

for (int i = names.Length - 1; i >= 0; i--)


{
Console.WriteLine(names[i]);
break;
}
}
}
}

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||

using System;
namespace darklter
{
class Program
{
static void Main(string[] args)
{
string[] names = { "David", "Alenere", "Jasfer", "Ace", "Patrick",
"Jaymar", "Emman", "Ricardo", "Hezel" };

for (int i = 0; i < names.Length; i++)


{
Console.WriteLine(names[i]);
break;
}
}
}
}

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||

using System;
namespace darklter
{
class Program
{
static void Main(string[] args)
{
string[] names = { "David", "Alenere", "Jasfer", "Ace", "Patrick",
"Jaymar", "Emman", "Ricardo", "Hezel" };

for (int i = 0; i < names.Length; i++)


{
if (names[i].Equals("Ace"))
{
Console.WriteLine("We Found : " + names[i]);
break;
}
else
{
Console.WriteLine(names[i]);
}
}
}
}
}

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|||||||||||||||||||||||||||||||||||||||||||
using System;
namespace darklter
{
class Program
{
static void Main(string[] args)
{
string[] userName = { "DarkGwapo", "xd King", "Gwapo", "Kursoko",
"BahoUtot", "BahoTaeKo" };
string[] passWord = { "11111111", "22222222", "33333333", "44444444",
"55555555", "66666666" };

Console.Write("User Name : ");


string authusername = Console.ReadLine();
Console.Write("Password : ");
string authpassword = Console.ReadLine();

bool isFound = false;

for (int i = 0; i < userName.Length; i++)


{
if (authusername.Equals(userName[i],
StringComparison.InvariantCultureIgnoreCase) && authpassword.Equals(passWord[i]))
{
isFound = true;
Console.WriteLine("Welcome Back, " + userName[i]);
break;
}
}
if (!isFound)
{
Console.WriteLine("Account Not Found");
}
}
}
}

You might also like