# Building a C# Chat Client and Server

A step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.

in C# Programming Tutorials

# Getting Hard Drive Information

A C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.

in C# Programming Tutorials

# UPS Shipping Calculator

This tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.

in PHP Programming Tutorials

# Create Your Own Rich Text Editor

Creating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.

in JavaScript Programming Tutorials
Search
Tutorials
Programming Tutorials
IT Jobs
From CareerBuilder

# How to check if a number is odd or even?

On Sunday, April 24th 2005 at 12:00 AM
By Andrew Pociu (View Profile)
More C# Resources
The best way to see if a given number is odd or even is to use the modulus operator (%). The modulus operator returns the remainder when dividing two numbers. So if you do a modulus of 6 % 2 you get 0 because 6 divided by 2 doesn't have a remainder, therefore it's even. If you do 3 % 2 the remainder will be 1, therefore the number is odd.

 int Num = 5; if(Num % 2 == 0) { // It's even } else { // It's odd }
Digg It!     Del.icio.us     Reddit     StumbleIt     Newsvine     Furl     BlinkList

##### Rate this Knowledge Base article
 Excellent Good Fair Mediocre Poor
by Bossman on Tuesday, November 8th 2005 at 07:58 AM

Nice

by Tach on Thursday, November 17th 2005 at 11:24 PM

VERY nice. You wouldn't believe how I have been doing it in the past. Thanx!

by Alain Ramirez on Tuesday, March 7th 2006 at 02:11 PM

more efficient
int Num = 5;

if ((Num & 1) == 0)
{
// It's even
}
else
{
// It's odd
}

only work with bits not division...

by sai on Sunday, April 23rd 2006 at 05:24 PM

Thanx a bunch buddy... that really helped..

by Masood Mehmood on Tuesday, January 16th 2007 at 05:51 AM

more more efficient (save one more CPU cycle)

int Num = 5;

if (Num & 1)
{
// It's odd
}
else
{
// It's even
}

by gaurav on Friday, April 20th 2007 at 03:20 AM

How to find whether a number is even or odd without using conditional operator using C language??

by solidstatestorage on Wednesday, May 16th 2007 at 04:59 PM

int nNum = 5;

bool bOdd = (bool)(nNum & 0x1);

by Tom on Tuesday, May 22nd 2007 at 09:20 AM

\"bool bOdd = (bool)(nNum & 0x1);\"

Casting is not efficient.

by sreenadh on Saturday, August 4th 2007 at 10:08 AM

How to find whether a number is even or odd using bit fields using C language?

by Fero on Tuesday, October 9th 2007 at 02:54 AM

/// <summary>
/// Checks if the number if odd or even.
/// </summary>
/// <param name=\"number\">Number to check</param>
/// <returns>Returns true if Odd</returns>
public static bool OddOrEven(int number)
{
return ((Num & 1) != 0) ? true : false;
}

by solidstatestorage on Wednesday, October 31st 2007 at 01:10 AM

bool bOdd = (bool)(nNum & 0x1);

Casting is highly efficient - the compiler performs the cast not the CPU. The \'anding\' operation above takes exactly one clock cycle.

by Me on Wednesday, February 13th 2008 at 01:05 PM

Casting is not efficient. At runtime the CLR checks casting operations to ensure that casts are always to the object's actual type or any of its base type - if the CLR simply allowed the casting, there would be no type-safety (google 'type spoofing'). It's very easy to write code that will compile yet fail at runtime with an InvalidCastException.

by solidstatestorage on Wednesday, March 5th 2008 at 05:04 PM

The question was is reference to the C language, which has a native compiler; i.e. there is no runtime manager.

A managed system such a .Net won\'t even compile this:
bool bOdd = (bool)(nNum & 0x1);

It will complain about an invalid cast right from the get go. A native compiler such as C or C++ will allow this cast all day long without any complaints. In fact, older compilers didn\'t even require the cast. They figured you knew what you were doing. The cast just tells the compiler that \'yes, I know I\'m about to change the variable type\'.

The following is the compiled code for the above test (including the disassembly):

int _tmain(int argc, _TCHAR* argv[])
{
bool bOdd = (bool)(argc & 0x1);

return bOdd;
00401000 movzx eax,byte ptr [esp+4]
00401005 and eax,1
}
00401008 ret

In terms of execution, it\'s not going to get any faster than this.

by Me on Thursday, April 24th 2008 at 11:19 AM

You're discussing C/C++ in a C# FAQ.

by Arnab on Friday, March 6th 2009 at 05:21 AM

int num = 000;
cout<<"Enter the number:";
cin>>num;
if(num%2==0)
{
cout<<"This number is a Even Number.";
}
else
{
cout<<"This number is a Odd Number";
}
getch();
}

by zeonardo on Tuesday, July 21st 2009 at 02:26 PM

Dude! Get a room!
You guys are Geek indeed!
It\'s just Even or Odd... Like child play!
If I ever need a \"clock\" it\'d hang one on my kitchen wall.

There\'s a world out there. Full of girls.
Go get it tiger!
^^

by thippu on Saturday, August 22nd 2009 at 09:19 AM

int num;
cout<<"Enter the number:";
cin>>num;
clscr()
if(num%2==0)
{
cout<<"This number is a Even Number:/n";
}
else
{
cout<<"This number is a Odd Number:"/n;
}
getch();
}

by thippu on Saturday, August 22nd 2009 at 09:19 AM

int num;
cout<<"Enter the number:";
cin>>num;
clscr()
if(num%2==0)
{
cout<<"This number is a Even Number:/n";
}
else
{
cout<<"This number is a Odd Number:"/n;
}
getch();
}

by thippu on Saturday, August 22nd 2009 at 09:19 AM

int num;
cout<<"Enter the number:";
cin>>num;
clscr()
if(num%2==0)
{
cout<<"This number is a Even Number:/n";
}
else
{
cout<<"This number is a Odd Number:"/n;
}
getch();
}

by thippu on Saturday, August 22nd 2009 at 09:19 AM

int num;
cout<<"Enter the number:";
cin>>num;
clscr()
if(num%2==0)
{
cout<<"This number is a Even Number:/n";
}
else
{
cout<<"This number is a Odd Number:"/n;
}
getch();
}

by LOLCOW on Wednesday, September 2nd 2009 at 11:27 PM

how about if you're also writing the code for not just odd or even, but if the number is zero as well?

by Duh on Monday, October 19th 2009 at 09:52 AM

if(num ==0)

by eye on Thursday, November 12th 2009 at 11:46 AM

dsgdthfth6r

by Some Dude on Wednesday, December 2nd 2009 at 01:48 PM

Now do it with an array!

by hii on Friday, January 8th 2010 at 02:43 AM

int m;
if(m/2*2==0)
cout<<"no. is even";
else
cout<<"no. is odd";

by tahir on Monday, March 8th 2010 at 06:59 AM

i need similar program but using only IF STATEMENT.

by nituko on Saturday, March 13th 2010 at 10:49 PM

how to determine a number is even or not without dividing or without taking modulus operator?

one way is to store all the even numbers in array and proceed by comparison is number with the number given by the user. But it cannot be efficient method to store all the even numbers in the array.

So what is the more efficient method to determine the number as an even or odd without using modulus operator?

by nituko on Saturday, March 13th 2010 at 10:49 PM

how to determine a number is even or not without dividing or without taking modulus operator?

one way is to store all the even numbers in array and proceed by comparison is number with the number given by the user. But it cannot be efficient method to store all the even numbers in the array.

So what is the more efficient method to determine the number as an even or odd without using modulus operator?

by yash on Saturday, March 20th 2010 at 06:17 AM

u fuck

by ke on Friday, April 9th 2010 at 11:46 PM

how do you do this is visual basic?

by shani on Monday, May 24th 2010 at 03:13 AM

by Anandh on Friday, July 23rd 2010 at 05:29 AM

find odd or even using simple if in c?

#include "stdafx.h"

int main(int argc, char* argv[])
{
printf("Hello World!\n");
int a,b;
scanf("%d",

by Anandh on Friday, July 23rd 2010 at 05:29 AM

find odd or even using simple if in c?

#include "stdafx.h"

int main(int argc, char* argv[])
{
printf("Hello World!\n");
int a,b;
scanf("%d",

by Anandh on Friday, July 23rd 2010 at 05:29 AM

find odd or even using simple if in c?

#include "stdafx.h"

int main(int argc, char* argv[])
{
printf("Hello World!\n");
int a,b;
scanf("%d",

by Anandh on Friday, July 23rd 2010 at 05:29 AM

find odd or even using simple if in c?

#include "stdafx.h"

int main(int argc, char* argv[])
{
printf("Hello World!\n");
int a,b;
scanf("%d",

by rathna on Friday, July 30th 2010 at 12:10 AM

how to use the for loop and while loop in simple programs of C language?

by jek on Wednesday, August 11th 2010 at 11:18 AM

using system;

namespace Even_Odd
{
class Program
{
int x;
Console.Write("Enter number");
if(x%2==0)
{
Console.WriteLine("Even");
}
else
{
Console.WriteLine("Odd");
}
}
}

by Nans on Friday, August 27th 2010 at 10:08 AM

i want to find even and odd nos. in vb pl help i am new to programing language...

by jayshree bhujbal on Sunday, September 12th 2010 at 06:19 AM

wap for accept ten int into an array find totalof all even

by Bani on Monday, September 27th 2010 at 11:58 PM

#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
int x;
clrscr();
printf("Enter the number which you want to know even or odd");
scanf("%d",

by Bani on Monday, September 27th 2010 at 11:59 PM

#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
int x;
clrscr();
printf("Enter the number which you want to know even or odd");
scanf("%d",

by Muhammad Kazim on Thursday, October 14th 2010 at 04:42 AM

quit simple in conditional operator

int Num = 6;
Console.WriteLine(Num % 2 == 0 ? "even":"odd");

conditional operator use full links :
http://msdn.microsoft.com/en-us/library/ty67wk28(VS.80).aspx

http://msdn.microsoft.com/en-us/library/ms173224(VS.80).aspx

by Ehsan "zia" on Sunday, October 24th 2010 at 08:01 AM

thanks its so useful

by WITNESS on Sunday, November 28th 2010 at 08:30 AM

#include<iostream>
usinng namespace std odd or even;

by Bhushan Gupta on Thursday, December 16th 2010 at 10:41 PM

using system;

namespace Even_Odd
{
class NumEO
{
int x;
Console.Write("Enter number");
if(x%2==0)
{
Console.WriteLine("That's Even");
}
else
{
Console.WriteLine("That's Odd");
}
}
}

by Bhushan Gupta on Thursday, December 16th 2010 at 10:58 PM

using system;

namespace Even_Odd
{
class NumEO
{

Console.Write("Enter number");
if(x%2==0)
{
Console.WriteLine("That's Even");
}
else
{
Console.WriteLine("That's Odd");
}
}
}

by Shaikh Sohail pakistan on Friday, December 24th 2010 at 06:37 AM

#include<stdio.h>
#include<conio.h>
void main()
{ clrscr() ;
int subject,topic;
printf("enter the number to find odd or even\n");
scanf("%d",

by Shaikh Sohail pakistan on Friday, December 24th 2010 at 06:37 AM

#include<stdio.h>
#include<conio.h>
void main()
{ clrscr() ;
int subject,topic;
printf("enter the number to find odd or even\n");
scanf("%d",

by sohail pakistan on Friday, December 24th 2010 at 06:39 AM

#include<stdio.h>
#include<conio.h>
void main()
{ clrscr() ;
int subject,topic;
printf("enter the number to find odd or even\n");
scanf("%d",

by jibrohni on Thursday, December 30th 2010 at 04:25 PM

you're all on crack

by mehnoosh on Thursday, March 3rd 2011 at 02:33 AM

why do num

by mehnoosh on Thursday, March 3rd 2011 at 02:33 AM

why do num

by mehnoosh on Thursday, March 3rd 2011 at 02:34 AM

why do num

by Jack on Saturday, May 14th 2011 at 12:30 PM

I have an 8 digit sequence of numbers, how can I get the numbers in the odd and even position?
ex:

int Number = 19345678;
while (Sin > 0)
{
int t = Number % 10;
Console.WriteLine(t);
}

I want to get the number in the first, third, fifth and seventh position.

by Jack on Saturday, May 14th 2011 at 12:31 PM

I have an 8 digit sequence of numbers, how can I get the numbers in the odd and even position?
ex:

int Number = 19345678;
while (Number > 0)
{
int t = Number % 10;
Console.WriteLine(t);
}

I want to get the number in the first, third, fifth and seventh position.

by farwa on Saturday, June 4th 2011 at 05:42 PM

Write a program, with a function called odd() that tells whether a number is odd or not. The function odd() should take an int value as an argument and returns the result as a boolean value. The values should be passed on by the user.
someone know what is the code of this program?

by best on Monday, June 20th 2011 at 02:43 PM

continue

by Paul on Monday, June 20th 2011 at 11:38 PM

@farwa, yes, yes, I know. :-)

It's this:
public static bool IsOdd(this double number)
{
return !number.IsEven();
}

public static bool IsEven(this double number)
{
bool result = false;

if (number > Int64.MaxValue)
{
result = number % 2 == 0;
}
else
{
result = (Convert.ToInt64(number)

by ketaki on Monday, July 11th 2011 at 06:08 AM

) Write a program that reads in an integer that represents the number of iterations. The program then uses a counter-controlled loop to determine all the odd numbers between 1 and the number entered and sums those values.

PLZ any one can help me to get this solution in C

by ketaki on Monday, July 11th 2011 at 06:08 AM

) Write a program that reads in an integer that represents the number of iterations. The program then uses a counter-controlled loop to determine all the odd numbers between 1 and the number entered and sums those values.

PLZ any one can help me to get this solution in C

by Shaikh Sohail on Monday, July 11th 2011 at 08:01 AM

Simple Syntax in C language

int a=5;
if(a%==0)
{printf("the value of a is %d even ",a);
}
else
{printf("Value is Odd : ",a);
}

by Shaikh Sohail on Monday, July 11th 2011 at 08:01 AM

Simple Syntax in C language

int a=5;
if(a%==0)
{printf("the value of a is %d even ",a);
}
else
{printf("Value is Odd : ",a);
}

by Shaikh Sohail (Pakistan) on Monday, July 11th 2011 at 08:07 AM

you can try this dear
int a,i,j=0,G=0;
scanf("%d",

by Gautham on Friday, July 15th 2011 at 05:36 PM

I came across http://rindovincent.blogspot.com/p/javascript.html where there was a simple Javascript program to find whether the number is odd or even. I am pasting the same code with permission here.

<html>
<script type="text/javascript">
var n = prompt("Enter a number to find odd or even", "Type your number here");
n = parseInt(n);
if (isNaN(n))
{
}
else if (n == 0)
{
}
else if (n%2)
{
}
else
{
}
</script>
<body>
</body>
</html>

by mohamed egy. on Saturday, July 16th 2011 at 08:20 AM

loop for numbers then when you press "9" it close the loop and calculate how many odd and even numbers?

can any one help me to get the solution of this task in c# ,Thanks:)

by Shaikh Sohail(Pakistan on Saturday, July 16th 2011 at 11:28 PM

int a=5;
if(a%2==0)
{printf("the value of a is %d even ",a);// for 'C'
Cosole.Write("Value is even " a);// C Sharp
System.out.println("Value is even " a);//Java
}
else
{printf("Value is Odd : ",a);
}

by Shaikh sohail(Pakistan) on Saturday, July 16th 2011 at 11:32 PM

button press is not allow when loop is continue dear mohamed i can do for jst this that when 9 is come then loop was stop and show you how many odd

by jancarl on Friday, July 29th 2011 at 02:36 AM

How to create a program that would determine if the number is either positive or negative integer?

by ellimac on Sunday, August 7th 2011 at 04:13 AM

if it is greater than 0
example:
n>o it is positive else it is negative

by Shaikh Sohail on Monday, August 8th 2011 at 02:05 PM

int a=-3;
if(a>=0)
{
print("The number is Positive");
}
else
{
print("The number is Negative");
}
Simple

by Shaikh Sohail on Monday, August 8th 2011 at 02:06 PM

int a=-3;
if(a>=0)
{
print("The number is Positive");
}
else
{
print("The number is Negative");
}
Simple

by Deejay on Thursday, August 11th 2011 at 09:18 AM

Determine if a number is odd or even and
Determine if a number is
positive even
negative even
positive odd
negative even

by Deejay on Thursday, August 11th 2011 at 09:18 AM

Determine if a number is odd or even and
Determine if a number is
positive even
negative even
positive odd
negative even

by Deejay on Thursday, August 11th 2011 at 09:26 AM

Determine if a number is odd or even and
Determine if a number is
positive even
negative even
positive odd
negative even

by Shaikh Sohail Pakistan on Friday, August 12th 2011 at 12:45 AM

int a=-2;
if(a%2==0)
{ if(a>0) { printf(positve even) }
else {printf(negative even) }
}
else
{ if(a>0)
{ printf(positve Odd) }
else{printf(negative Odd) }
}

by Shaikh Sohail Pakistan on Friday, August 12th 2011 at 12:48 AM

you can also contact me with mail
skygocomputer@yahoo.co.in

if you face some problem send me a mail INSHA ALLHA i will try to solve that

THANX SOHAIL SHAIKH
skygocomputer@yahoo.co.in

by jaden on Monday, November 28th 2011 at 01:57 AM

mod
doesnt work with negative number!

by surender kumar on Monday, December 12th 2011 at 02:19 AM

i want to more c program than you can send to me program to my email id

by surender kumar on Monday, December 12th 2011 at 02:19 AM

i want to more c program than you can send to me program to my email id

by surender kumar on Monday, December 12th 2011 at 02:20 AM

i want to more c program than you can send to me program to my email id

by unsecured credit cards for bad credit on Tuesday, December 20th 2011 at 08:09 PM

It was very useful for me, thank you very much!

by kratika tiwari on Saturday, December 31st 2011 at 04:28 AM

write a program to perform addition of two matrix.

by kratika tiwari on Saturday, December 31st 2011 at 04:28 AM

write a program to perform addition of two matrix.

by greta lagarto on Thursday, February 23rd 2012 at 07:11 PM

how to check if a number is odd or even number?

by greta lagarto on Thursday, February 23rd 2012 at 07:11 PM

how to check if a number is odd or even number?

by greta lagarto on Thursday, February 23rd 2012 at 07:11 PM

how to check if a number is odd or even number?

by greta lagarto on Thursday, February 23rd 2012 at 07:11 PM

how to check if a number is odd or even number?

by Shaikh Sohail Pakistan on Friday, February 24th 2012 at 01:32 AM

int a=5;
if(a%2==0)
{printf("the value of a is %d even ",a);// for 'C'
Cosole.Write("Value is even " a);// C Sharp
System.out.println("Value is even " a);//Java
}
else
{printf("Value is Odd : ",a);
}

by Shaikh Sohail Pakistan on Friday, February 24th 2012 at 01:34 AM

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a[3][3],i,j,sum ;
printf("THIS IS A 3*3 MATRIX PROGRAM\n");
for (i=0;i<3;i )
{ printf("The row no is%d\n",i);
for(j=0;j<3;j )
{
scanf("%d",

by Shaikh Sohail on Friday, February 24th 2012 at 01:35 AM

Part 1 Of Matrix
int a[3][3],i,j,sum ;
printf("THIS IS A 3*3 MATRIX PROGRAM\n");
for (i=0;i<3;i )
{ printf("The row no is%d\n",i);
for(j=0;j<3;j )
{
scanf("%d",

by Shaikh Sohail on Friday, February 24th 2012 at 01:37 AM

send me email if you want matrix add sub or multi program

by ForeclosureHelp on Friday, February 24th 2012 at 04:59 PM

Your blog is very informative. I really appreciate your hardwork. Thanks You for such good information. Keep up good work !!

by raviraj on Wednesday, February 29th 2012 at 10:19 AM

Here is a very way to find odd or even.

using System;
class MainClass
{
public static void Main(string[] args)
{
int i;
Console.WriteLine("Enter the Number:");
if((i%2)==0)
Console.WriteLine( "The Number is Even" );
else
Console.WriteLine( "The Number is Odd" );
}
}

by this website on Sunday, March 4th 2012 at 11:58 PM

It is surely very workable.

Thanks for the blog.

by StartCleaningService.com on Tuesday, March 13th 2012 at 03:18 AM

Thanks for the blog. The blog is very helpful and informative. Keep up the good work.

by StartCleaningService.com on Tuesday, March 13th 2012 at 03:18 AM

Thanks for the blog. The blog is very helpful and informative. Keep up the good work.

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:37 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:37 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:37 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:37 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:37 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:37 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:38 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:38 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:38 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:38 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:38 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:38 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:38 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:38 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:38 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by HelloMyNameIs on Wednesday, March 14th 2012 at 12:38 AM

int Num = 5;

if(Num % 2 == 0)
{
// It's even
}
if(Num % 2 != 0)
{
// It's odd
}

by master of education online on Thursday, May 10th 2012 at 02:11 AM

There are many people who simply prefer to use and read a brief guide books, which certainly will provide accurate and correct information for you.

by Munib on Wednesday, January 23rd 2013 at 07:14 AM

If some one enters a number and requires the answer as if i enter 12340 , compiler should tell me that how many even ,odd and zeroes are present in 12340

by Munib on Wednesday, January 23rd 2013 at 07:14 AM

If some one enters a number and requires the answer as if i enter 12340 , compiler should tell me that how many even ,odd and zeroes are present in 12340

by Munib on Wednesday, January 23rd 2013 at 07:14 AM

If some one enters a number and requires the answer as if i enter 12340 , compiler should tell me that how many even ,odd and zeroes are present in 12340

by Munib on Wednesday, January 23rd 2013 at 07:14 AM

If some one enters a number and requires the answer as if i enter 12340 , compiler should tell me that how many even ,odd and zeroes are present in 12340

by Munib on Wednesday, January 23rd 2013 at 07:14 AM

If some one enters a number and requires the answer as if i enter 12340 , compiler should tell me that how many even ,odd and zeroes are present in 12340

by Munib on Wednesday, January 23rd 2013 at 07:14 AM

If some one enters a number and requires the answer as if i enter 12340 , compiler should tell me that how many even ,odd and zeroes are present in 12340

by Munib on Wednesday, January 23rd 2013 at 07:15 AM

If some one enters a number and requires the answer as if i enter 12340 , compiler should tell me that how many even ,odd and zeroes are present in 12340

by Munib on Wednesday, January 23rd 2013 at 07:15 AM

If some one enters a number and requires the answer as if i enter 12340 , compiler should tell me that how many even ,odd and zeroes are present in 12340

by Matthew Hubbard on Thursday, March 7th 2013 at 12:41 PM

I am having issues with this assignment in VB 2010:

Code the application. Use the InputBox function to get the input. Save the solution and then start the application. Test the application using the following integers: 45,2,34,7,55,90 and 32. The sum of the odd and even integers should be 107 and 158 respectively.

by vignesh on Friday, June 7th 2013 at 05:03 AM

by Johnny Boy on Thursday, January 16th 2014 at 01:26 PM

Here’s a blog article which benchmarks quite a few ways to test if a number is odd or even:
http://blogs.davelozinski.com/curiousconsultant/csharp-net-fastest-way-to-check-if-a-number-is-odd-or-even

There are actually numerous ways to do this other than the two you have listed. Surprisingly, the fastest way appears to be the modulus % operator, even out performing the bitwise ampersand

by Johnny Boy on Saturday, July 5th 2014 at 12:15 PM

The link in my above post is incorrect. It's now:
http://cc.davelozinski.com/c-sharp/fastest-way-to-check-if-a-number-is-odd-or-even

Thank you.

by sara on Monday, September 8th 2014 at 07:55 PM

hi , can you help me ?

write a matrix program ..

Suppose A={1,3,5,7,9} and B = {2,4,6,8,10}, create another array C of size 10 and put the data from A and B into C such that
C = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

by DC on Tuesday, November 25th 2014 at 04:27 AM

How can i create a program that show if the number is even, odd or if the number is zero.

by Coach Outlet on Monday, June 15th 2015 at 08:44 AM

Bag [url=http://www.valentinoshoe.in.net][b]valentino shoes on sale[/b][/url] of the [url=http://www.michael-kors-outletonline.us.com][b]michael kors outlet[/b][/url] Week: [url=http://www.marcsbymarcjacobs.com][b]marc by marc jacobs[/b][/url] Lip Lock [url=http://www.chiflatirons.in.net][b]Chi Flat Iron,Chi Hair Straightener[/b][/url] XBody Bag: [url=http://www.outlet-michaelkors.us.com][b]michael kors outlet[/b][/url] Why It's [url=http://www.marcjacobsoutletstores.com][b]marc jacobs outlet[/b][/url] the [url=http://www.burberryoutletstores.com][b]burberry outlet[/b][/url] Bag [url=http://www.marcbymarc-jacobs.com][b]marc by marc jacobs[/b][/url] of the Week: [url=http://www.louis-vuittonus.com][b]Louis Vuitton Outlet[/b][/url] might not be long for this world, but the brand is still releasing some solid new [url=http://www.outletnorthface.us.com][b]www.outletnorthface.us.com[/b][/url] bags while it's still around. This one is a pretty, tailored [url=http://www.thenorth-face.us.com][b]north face outlet[/b][/url] combo of sleek blues and black.If [url=http://www.oakleysunglasses.com.im][b]cheap oakley sunglasses[/b][/url] you need [url=http://www.coachoutletfactoryonline.us.com][b]coach factory outlet[/b][/url] to add some new [url=http://www.oakleysunglasses.com.cm][b]www.oakleysunglasses.com.cm[/b][/url] items to [url=http://www.coachoutletstore.us.com][b]coach outlet store online[/b][/url] your [url=http://www.michaelkorsoutletco.us.com][b]www.michaelkorsoutletco.us.com[/b][/url] summer [url=http://www.christianlouboutinshoe.in.net][b]www.christianlouboutinshoe.in.net[/b][/url] wardrobe, I highly suggest taking a look [url=http://www.outlet-michaelkors.us.com][b]www.outlet-michaelkors.us.com[/b][/url] at [url=http://www.tomsshoeoutletonline.com][b]toms shoes outlet online[/b][/url] Summer Sale. [url=http://www.louisvuittonoutlet-store.com][b]Louis Vuitton Outlet[/b][/url] They just [url=http://www.tomsshoeoutletonline.com][b]toms shoes[/b][/url] added 400 new markdowns [url=http://www.oakleysunglasses.com.im][b]oakley sunglasses[/b][/url] that [url=http://www.valentinoshoes.us.org][b]valentino shoes[/b][/url] are [url=http://www.shoeschristianlouboutin.us.com][b]christian louboutin[/b][/url] 40% off!

by Vinu on Saturday, June 25th 2016 at 09:29 AM

7 easy ways to find whether a number id odd/even.
http://www.waytosmart.com/tutorials/c-programming/c-program-to-check-odd-or-even-number-easy-ways.php

##### Comment on this Knowledge Base article
 Name: Email: Message: Subscribe me to future replies
##### Related Knowledge Base Articles
There are no related KB articles.

##### Related Source Code
There is no related code.

##### Related Tutorials
There are no related tutorials.

##### C# Job Search
 My skills include: Enter a City: Select a State:  – All United States –  Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware District of Columbia Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming Advanced Search >>