Find Odd or Even Program in C

Find Odd or Even Program in C

Here, you will get an example code to find odd or even program in c programming.  First, we will take a number as input and finds whether that number is even or odd. Here variable n is used to represents the number, which is checked for even or odd.

For checking whether the number is even or odd the value of n is divided by 2 if the result(remainder) is zero then the number is even otherwise number is odd.

Even Number Definition 

Even Numbers :- A Number which is completely divided by 2 and generate 0 remainder is know as Even numbers. For example 2,4,6,8,10,12,14,16,18………. are Even numbers. 

Odd Number Definition

Odd Number :- A Number which is not completely divided by 2 and generate some reminder other then 0 is called Odd Number. For example 1,3,5,7,9,11,13,15,17,19…..are odd numbers

Algorithm

Step 1:  Input any integer number.

Step 2:  Check if number is even(divide by 2).

Step 3:  If number is even print “Number is Even“.

Step 4:  If not print “Number is Odd“.

Data Flow Diagram(DFD)

DFD of Odd or Even Program in C

Program code to Find Odd or Even Program in C

Input

Enter a number : 7

Output

7 Number is odd

 

 

Check out our other C programming Examples

 

 

 

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top