0
(SOLVED) "Fill in the blanks to print the EVEN values from 0 to 100 using a for loop:"
Im doing the c# courses and I get this. WTF is even? this is "For the loops"
8 Respostas
- 5
Even: Divisible by 2
Odd: Not even
+ 1
Andres Araya The tutorial doesn't teach english.
0
oooh thank you. I don't think that they explained what EVEN and Odd is
0
Even Number: Any integer (never a fraction) that can be divided exactly by 2.
Exp: 8 / 2 = 4 (4 is a even number)
Now come to your question on how to print all even numbers between 0 -100 in C# using FOR loop?
__________________________________________
using System;
public class Program
{
public static void Main()
{
Console.WriteLine("Even Numbers :");
for (int i = 0; i <= 100; i++)
{
if( i%2 == 0 )
{
Console.Write(i + " ");
}
}
}
}
0
Fill in the blanks to output 100.
0
number = ___ # Initialize the variable
while ___ # Complete the while loop condition
print(number, end=" ")
number ___ # Increment the variable
- 1
thank you for the help guys. I got the answer. Is there any way to make this disscuss done so people stop seeing it? I do not want to waste peoples' time when you guys already gave me the answer.
- 1
Andres Araya You can:
-Add [Solved] to the end of the question title.
-Delete the post.
I'd suggest to delete it if you think it's useless.
There could be someone who entered the same question on search bar and get some help from this post, but I think it is very unlikely to happen.