1
+ // if(condition){
2
+ // result
3
+ // }
4
+
5
+ // var age = +prompt("write your age")
6
+ // if (age >= 18){
7
+ // console.log("admission hogaya");
8
+ // document.write("admission hogaya")
9
+ // }
10
+ // else{
11
+ // console.log("admission nhi hua")
12
+ // document.write("<h1>admission nhi hogaya</h1>")
13
+ // }
14
+ // if html && css quiz number > 150 so you are eligible else not
15
+
16
+ // var html = +prompt("write your html numbers")
17
+ // var css = +prompt("write your css numbers")
18
+ // var result = html + css
19
+ // console.log(result);
20
+ // if(result >=150){
21
+ // console.log("pass");
22
+ // }
23
+ // else{
24
+ // console.log("fail");
25
+ // }
26
+
27
+ // Write a JavaScript program that accept two integers and
28
+ // display the larger. Also show if the two integers are equal.
29
+
30
+
31
+ // var num1 = +prompt("enter your 1st integer");
32
+ // var num2 = +prompt("enter your 2nd integer");
33
+
34
+ // if(num1 > num2){
35
+ // console.log(num1 + " is greater then " + num2);
36
+ // }
37
+
38
+ // else{
39
+ // console.log(num2 + " is greater then " + num1);
40
+ // }
41
+
42
+ // Write a program that takes input a number from user &
43
+ // state whether the number is positive, negative or zero.
44
+
45
+ // var num = +prompt("Enter Your Number")
46
+
47
+ // if (num > 0){
48
+ // console.log("positive");
49
+ // }
50
+ // else if (num === 0){
51
+ // console.log("neutral");
52
+ // }
53
+ // else{
54
+ // console.log("negative");
55
+ // }
56
+ // var num1 = +prompt("enter 1st number")
57
+ // var num2 = +prompt("enter 2nd number")
58
+ // var operator = prompt("enter your operator", '+ - * /')
59
+ // var result;
60
+ // if(operator == "+"){
61
+ // result = num1 + num2
62
+ // console.log(result);
63
+ // }else if (operator == "-"){
64
+ // result = num1 - num2
65
+ // console.log(result);
66
+ // }else if (operator == "*"){
67
+ // result = num1 * num2
68
+ // console.log(result);
69
+ // }else if (operator == "/"){
70
+ // result = num1 / num2
71
+ // console.log(result);
72
+ // }else{
73
+ // alert("your operator does not exist")
74
+ // }
75
+
76
+ // Comparison operators
77
+ //==
78
+ //===
79
+ //!=
80
+ //!==
81
+ //>
82
+ //<
83
+ // &&
84
+ // ||
85
+
86
+ var number = 20
87
+ // if (number == '20'){
88
+ // console.log("equal");
89
+ // }
90
+ // else{
91
+ // console.log("not equal");
92
+ // }
93
+ if ( number != 30 ) {
94
+ console . log ( " equal" )
95
+ }
96
+ else {
97
+ console . log ( "notequal" ) ;
98
+ }
99
+
100
+ // if & else if
101
+ // var age = +prompt("enter age")
102
+ // var clas = +prompt("enter time")
103
+ // if (age > 8 && clas < 3 ) {
104
+ // alert("Come to our school!");
105
+ // }
106
+ // else {
107
+ // alert("dont Come to our school!");
108
+ // }
109
+ // var weight = +prompt("enter weight")
110
+ // var time = +prompt("enter time")
111
+ // if (weight > 300 || time < 6) {
112
+ // alert("Come to our tryout!");
113
+ // }
114
+ // else {
115
+ // alert("Come to our cookout!");
116
+ // }
117
+
118
+
119
+ // var password = "smit";
120
+ // var userinput = prompt("type yor input")
121
+ // console.log(userinput);
122
+ // if (password == userinput){
123
+ // console.log("password is correct");
124
+ // }
125
+ // else{
126
+ // console.log("password is not correct");
127
+ // }
128
+
129
+ // nested if else
130
+
131
+ // var dinner = prompt("what do you want in dinner")
132
+ // console.log(dinner);
133
+ if ( dinner == 'biryani' || dinner == 'tikka' || dinner == 'pizza' ) {
134
+ console . log ( "it is Available" )
135
+
136
+ // nested
137
+ if ( dinner == "biryani" ) {
138
+ alert ( "biryani price : 300" )
139
+ }
140
+ else if ( dinner == "tikka" ) {
141
+ alert ( "tikka price : 500" )
142
+ }
143
+ else {
144
+ alert ( "pizza price : 1000" )
145
+ }
146
+ }
147
+ else {
148
+ console . log ( "it is not availabe" )
149
+ }
0 commit comments