C# for loops
In C# you will want to use for looping to make programming easier to do. This is how you will make a for loop to go through a number.
Use the keyword 'for' to start the for loop. Then encapsulate its contents in parentheses like a method. after that you need to initialize an interger value and terminate it by semicolons like done in the example. Then state what the for loop should last for. I have made it to where it will last while i is less than 10. Terminate that with a semicolon and move on. Then you need to increment what you are going through. adding '++' by a number value in C# increments that value by 1. So this value will go up by 1 every time the for loop loops. Then in curly brakets you contain what you actually want to loop. Here i have made the console write out the value of the i variable.
It will have the output of this
If you have any questions ask me.
Thank you for reading.
@Jakman A prime number is a whole number that only has two factors which are itself and one. A composite number has factors in addition to one and itself. The numbers 0 and 1 are neither prime nor composite. All even numbers are divisible by two and so all even numbers greater than two are composite numbers.