Even and odd number in c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Programone
{
class Program
{
static void Main(string[] args)
{
int i;
Console.WriteLine("Enter number");
i = int.Parse(Console.ReadLine());
if (i % 2 == 0)
{
Console.WriteLine("Evennumber");
Console.ReadLine();
}
else
{
Console.WriteLine("oddnumber");
Console.ReadLine();
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Programone
{
class Program
{
static int i;
public static void number()
{
i = int.Parse(Console.ReadLine());
if (i % 2 == 0)
{
Console.WriteLine("Evennumber");
Console.ReadLine();
}
else
{
Console.WriteLine("oddnumber");
Console.ReadLine();
}
}
static void Main(string[] args)
{
Console.WriteLine("Enter number");
number();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Programone
{
class Program
{
static void Main(string[] args)
{
int i;
Console.WriteLine("Enter number");
i = int.Parse(Console.ReadLine());
if (i % 2 == 0)
{
Console.WriteLine("Evennumber");
Console.ReadLine();
}
else
{
Console.WriteLine("oddnumber");
Console.ReadLine();
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Programone
{
class Program
{
static int i;
public static void number()
{
i = int.Parse(Console.ReadLine());
if (i % 2 == 0)
{
Console.WriteLine("Evennumber");
Console.ReadLine();
}
else
{
Console.WriteLine("oddnumber");
Console.ReadLine();
}
}
static void Main(string[] args)
{
Console.WriteLine("Enter number");
number();
}
}
}
Comments