steamnp / bfs45

0 stars 0 forks source link

[Dhawa and Aakash] Function in JavaScript #26

Open Sabita9818 opened 6 months ago

Sabita9818 commented 6 months ago
  1. Write a function in javascript which will add all the odd numbers and give sum of odd numbers.

For example

input: [1,2,3,4,5,6,7,8]

output: 16

  1. Write a function in javascript to check weather provided number is prime or not. Return true if it is prime else return false.

For example

input: 1

output: false

input: 2

output: true

input: 49

output: false

dhawasangbolama2 commented 6 months ago

odd and prime odd and prime screenshot