Professional Documents
Culture Documents
Conditional Statements
Conditional Statements
if(int a == int b)
{
Console.WriteLine(“a is equal b”);
}
else
{
Console.WriteLine(“a is not equal to b”);
}
Think of if statements functioning like, if this is the
case then do this; else statements meanwhile catch
overlooked problems like “otherwise”. When both are used
like the one below we can translate it to: If a is equal
to b then say a is equal to b, otherwise (else) say a is
not equal to b.
if(int a == int b)
{
Console.WriteLine(“a is equal to b”);
}
else
{
Console.WriteLine(“a is not equal to b”);
}
While and for loops pt.1
When we want to keep doing something again and again
and again without having to write if(if(if(if())))
multiple times. Loops help us make loops (crazy).
int count = 1;
var condition;
while(condition is not true)
{
do this; I dont know
} what to put
while-loop here lol.