Hello Guyz coiudl anyone help me? the output should be like this
Enter Number : 10
The even number is : 2 4 6 8 10
The Odd number is 3 5 7 9
here is my code:
int x;
Console.Write("Input Number:\t");
int num = Convert.ToInt32(Console.ReadLine());
for (x = 0; x < num; x++)
{
if (x % 2 == 0)
{
Console.Write(" ");
}
else
{
//Console.Write("\n");
Console.Write("{0}", x);
}
}
Rijwan AnsariPosted Oct 16, 2021, 1:54 PM
hustino siatPosted Oct 15, 2021, 10:02 AM
Sachin SinghPosted Oct 15, 2021, 9:58 AM