Programming: what’s wrong with my C# code?

Programming: what’s wrong with my C# code?

I need to write a while loop that print all odd numbers 1-21 separated by spaces, with no new lines. My output is coming up blank. What’s wrong with my code?

class Program

{

static void Main(string[] args)

{

{

int i = 0;

while (i <= 21)

if

(i % 2 == 1);

{

Console.WriteLine(i);

                    i ++;//add increment control variable

}

}

}

}

}

"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.


Discount Code: CIPD30



Click ORDER NOW..

order custom paper