# C# Program to check if a number is Positive, Negative, Odd, Even, Zero

Check for the following conditions −

For odd and even, check for the remainder when the number is divided by 2 −

// checking for odd/ even
if(n % 2 == 0) {
Console.WriteLine("Even");
} else {
Console.WriteLine("Odd");
}

For positive, negative and checking whether a number is 0 or not −

if (n < 0) {
Console.WriteLine("Negative Number!");
} else if(n == 0) {
Console.WriteLine("Zero");
} else {
Console.WriteLine("Positive Number!");
}

The following is the complete code:

## Example

Live Demo

using System;
using System.Collections.Generic;

public class Demo {
public static void Main(string[] args) {
int n = 19;

// checking for odd/ even
if (n % 2 == 0) {
Console.WriteLine("Even");
} else {
Console.WriteLine("Odd");
}

// checking for positive, negative or 0
if (n < 0) {
Console.WriteLine("Negative Number!");
} else if (n == 0) {
Console.WriteLine("Zero");
} else {
Console.WriteLine("Positive Number!");
}
}
}

## Output

Odd
Positive Number!
{"ft_lang_label":"__label__en","ft_lang_prob":0.52643317,"math_prob":0.96329594,"size":2909,"snap":"2023-14-2023-23","text_gpt3_token_len":791,"char_repetition_ratio":0.22099827,"word_repetition_ratio":0.22222222,"special_character_ratio":0.30663458,"punctuation_ratio":0.10344828,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.984354,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-06T20:51:23Z\",\"WARC-Record-ID\":\"<urn:uuid:ba0f500b-0142-4484-9d93-e1b38b7638c8>\",\"Content-Length\":\"39885\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:a367f782-1f38-4410-b590-a71f33cfe7ab>\",\"WARC-Concurrent-To\":\"<urn:uuid:f5d616d6-ea68-496d-a36a-9de9174e3b75>\",\"WARC-IP-Address\":\"192.229.210.176\",\"WARC-Target-URI\":\"https://www.tutorialspoint.com/chash-program-to-check-if-a-number-is-positive-negative-odd-even-zero\",\"WARC-Payload-Digest\":\"sha1:OWFE26ODP36V2TFPFZFGKO4I4QOE5K77\",\"WARC-Block-Digest\":\"sha1:CHNZWP4O5JQBIZT2MBWOB6NIRTBWEETQ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224653071.58_warc_CC-MAIN-20230606182640-20230606212640-00502.warc.gz\"}"}