C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Odd Even Numbers Program using for Loop in C#
WhatsApp
Ujjwal Patel
Jan 14
2015
60.9
k
0
0
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
namespace
ConsoleApplication1
{
class
CalcAvgPerc
{
static
void
Main(
string
[] args)
{
int
num1 = 100;
for
(
int
i = 1; i <= num1; i++)
{
if
(i % 2 == 0)
{
Console.WriteLine(
"Number {0} is Even"
, i);
}
else
{
Console.WriteLine(
"Number {0} is odd"
, i);
}
}
Console.ReadKey();
}
}
}
C#
Odd
Even
Up Next
Odd Even Numbers Program using for Loop in C#