Even and Odd numbers in given list Shell Script

Even and Odd numbers in given list

Problem Statement : Write a Program to find the number of even and odd numbers in given list using Shell Script Program.

User need to enter the number of elements in the list as well as each element of list. Then program will calculate the even and odd numbers in the list by printing output to the screen.

ne – Number of Even Numbers in List

no- Number of Odd Numbers in List

Even and Odd numbers in given list Code

Even and Odd numbers in given list Output

Sample Output 1

nulls@ubuntu:~$ ./script.sh
enter the no.of elements
4
enter  the elements
4
2
3
1
the no.of even no.s is 2
the no.of odd no.s is 2

Sample Output 2

nulls@ubuntu:~$ ./script.sh

enter the no.of elements
5
enter  the elements
3
2
6
7
1
the no.of even no.s is 2
the no.of odd no.s is 3

Sample Output 3

nulls@ubuntu:~$ ./script.sh

enter the no.of elements
2
enter  the elements
6
7
the no.of even no.s is 1
the no.of odd no.s is 1

Sample Output 4

nulls@ubuntu:~$ ./script.sh

enter the no.of elements
3
enter  the elements
2
4
6
the no.of even no.s is 3
the no.of odd no.s is

[button style=”large green  embossed” link=”https://sites.google.com/site/projectsgeek2/projectsgeek_1/bol.sh” target=”_blank” ]Shell Script Code Download[/button]