Skip to content

Commit 4bab844

Browse files
Changing the structure
1 parent 6c8fc1b commit 4bab844

File tree

6 files changed

+43
-0
lines changed

6 files changed

+43
-0
lines changed

Functions/Functions1.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
function nameOfFunc(){
2+
console.log('Body of the functions')
3+
}
4+
5+
nameOfFunc()
6+
7+
let name = 'chitta'
8+
function greet(name){
9+
console.log('Hello '+name+', How are you ?')
10+
}
11+
12+
greet(name)
13+
14+
function add(a,b){
15+
console.log(a+b)
16+
}
17+
add(4,5), add(4,55), add(4,555)

Intro&ControlFlow/Loop3.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// let i = 0
2+
// do
3+
// {
4+
// console.log(i)
5+
// i++
6+
// }while(i<10)
7+
8+
// Find out all the prime numbers between 1-100
9+
var arr = []
10+
11+
for(let i=1;i<=100;i++)
12+
{
13+
if(i == 1 || i == 2)
14+
arr.push(i)
15+
else{
16+
let count=0
17+
for(let j=i;j>1;j--)
18+
{
19+
if(i%j==0)
20+
count++
21+
}
22+
if(count<2)
23+
arr.push(i)
24+
}
25+
}
26+
console.log(arr)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)