Odd or even program in c using array for beginners to execute the odd or even number using array method in c programming language.

## Array Definition in C

An array is a collection of data items of the same type stored in contiguous memory locations.

Arrays are a derived data type in the C programming language that can hold primitive data types like int, char, double, float, and so on.

A container object that holds a fixed number of values of a single type is called an array.

The length of an array is determined at the time of its creation.

Its length is fixed after it is created.

Array: a collection of a certain number of components, all of which have the same data type.

The components of a one-dimensional array are organised in a list format.

The term “multi-dimensional array” refers to an array in which the components are organised in a tabular format.

## Odd and Even Number Definition

A number that can be divided into two equal groups is called an even number.

A number that cannot be divided into two equal groups is called an odd number.

Even numbers, regardless of how many digits they have, end in 2, 4, 6, 8, or zero.

```
#include <stdio.h>
void main()
{
int arr[100], i, num;
printf("Enter Size of arr \n");
scanf("%d", &num);
printf("arr Elements \n");
for (i = 0; i < num; i++)
{
scanf("%d", &arr[i]);
}
printf("Even Numbers in arr");
for (i = 0; i < num; i++)
{
if (arr[i] % 2 == 0)
{
printf("%d \t", arr[i]);
}
}
printf("\n Odd Numbers in arr");
for (i = 0; i < num; i++)
{
if (arr[i] % 2 != 0)
{
printf("%d \t", arr[i]);
}
}
}
```

Output:

Enter Size of arr

5

arr Elements

34

56

78

34

45

Even Numbers in arr 34 56 78 34

Odd Numbers in arr 45