Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/imrahul05/numbersystem


https://github.com/imrahul05/numbersystem

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

This is the NumberSystem Repo

This Repo is included odd and even number and to find a prime number


1. Odd and Even Number

Here to find odd and even inside an array using for loop.

const numbers = [
3, 7, 2, 15, 9, 20, 5, 14, 12, 1, 8, 11, 6, 19, 4, 10, 17, 13, 16, 18,
];

output

Even - 2 20 14 12 8 6 4 10 16 18
Odd - 3 7 15 9 5 1 11 19 17 13





2.FindPrimeNumber

here to find prime inside an array using for loop.

input -
const numbers = [
19, 23, 4, 16, 28, 13, 31, 8, 29, 14, 6, 35, 2, 11, 17, 5, 9, 27, 12, 30,
];

output -
primeNumbers---> 19 23 13 31 29 11 17 5
[
19, 23, 13, 31,
29, 11, 17, 5
]
maximum prime number --> 31
minimum prime number --> 5
Total sum of all prime numbers --> 148