Skip to content

Commit 0b929bc

Browse files
committed
Some correction + gitignore file
1 parent 8728c15 commit 0b929bc

3 files changed

Lines changed: 32 additions & 12 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/node_modules
2+
*.json

introduction to js/Calculator-JS/calc.html

Lines changed: 0 additions & 12 deletions
This file was deleted.

projects/1.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// operator , 2 numbers , result
2+
// input , result output
3+
// if else
4+
// result display console.log
5+
6+
const operator = prompt('Enter Operator (either +,-,*,/):');
7+
8+
const num1 = parseFloat(prompt('enter 1st number:'));
9+
const num2 = parseFloat(prompt('enter 2nd number:'));
10+
11+
let result;
12+
// conditions
13+
//if else
14+
// multiple available choices me se koi 1 choose karna ho
15+
16+
if (operator == '+') {
17+
result = num1+num2;
18+
}
19+
else if (operator == '-') {
20+
result = num1-num2;
21+
}
22+
else if (operator == '*') {
23+
result = num1*num2;
24+
}
25+
else if(operator == '/') {
26+
result = num1/num2;
27+
}
28+
console.log(num1, operator, num2, '=', result);
29+
30+
// Still facing problem in executing JS Files, Fix this Issue

0 commit comments

Comments
 (0)