C# for loops 🔁

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

#C# #for #loop
Рекомендации по теме
Комментарии
Автор

using System;

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

// for loop = repeats some code a FINITE amount of times

// Count up to 10
for (int i = 1; i <= 10; i++)
{
Console.WriteLine(i);
}

// Count down from 10
for (int i = 10; i > 0; i--)
{
Console.WriteLine(i);
}
Console.WriteLine("HAPPY NEW YEAR!");

Console.ReadKey();
}
}
}

BroCodez
Автор

Finally a tutorial that is easy for me to follow. Thank you so much 😄

Avolali
Автор

i'm currently learning C# using an app and it was working great till they got to loops this helped me so much

ZonbiNed
Автор

Once again great tutorial Bro! One word of caution for my fellow coder friends watching, you can accidentally create an infinite loop with a For loop. If you set your condition to something like x<10, have a start value of x=1 and then reduce instead of increase x each time though (x--) the ending criteria will never be hit and the loop will not stop until you manually terminate it.

tubetimeline
Автор

if you have multiple for loops, can you use "int i" for every one? or do you need a new variable name

mediumwaffle
Автор

I love your video ❤❤❤ 0:24 better than my teacher 0:45 so so love for you bro ❤❤

turkyt
Автор

MAKE A VIDEO ON HOW TO PRINT SHAPE LIKE DIAMOND NUMBERS AND ALPHABETS

MLAZE