-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboolean.html
More file actions
182 lines (181 loc) · 12.1 KB
/
Copy pathboolean.html
File metadata and controls
182 lines (181 loc) · 12.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<html>
<head>
<script type="text/javascript" src="scripts/article.js"></script>
<link rel="stylesheet" href="style/article.css" />
</head>
<body onload="load();alert('This is an under development topic \n and is suppposd to change soon. ') " prev="operators.html" next="string.html">
<h1>Boolean | <c>दोहरा</c> डेटा प्रकार
<select name="H/E" onchange="set(this.value)">
<option value="english">English</option>
<option value="hindi">हिन्दी(Hindi)</option>
</select><br>
<input type="button" value="pervious" onclick="pchapter()">
<a class="btn" onclick="nchapter()" href="#"><span> →</span>NEXT</a>
</h1>
<chapter>
<h2></h2>
<e>
Very often, in programming, we will need a data type that can only have one of two values, like:<ul><li>YES / NO</li><li>ON / OFF</li><li>TRUE / FALSE</li></ul>For this, we have a <c>दोहरा</c>(boolean) data type, which can store <c>सच</c>true or <c>झूठ</c>false values.
</e>
<h>
कई बार, प्रोग्रामिंग में, हमें एक डेटा प्रकार की आवश्यकता होगी जिसमें केवल दो में से एक मान हो, जैसे:<ul><li>हा / ना</li><li>शुरू / बंद</li><li>सच / झूठ</li></ul>इसके लिए हमारे पास एक <c>दोहरा</c> डेटा प्रकार है, जो <c>सच</c>/सही या <c>झूठ</c>/गलत मान संग्रहीत कर सकता है।
</h><br>
<br><hr>
<h2> Boolean Values|<c>दोहरा</c> के मान</h2>
<p>
<e>
A <c>दोहरा</c>(boolean) type is declared with the <c>दोहरा</c>(boolean) keyword and can only take the values <c>सच</c>(true) or <c>झूठ</c>(false):
</e>
<h>
एक <c>दोहरा</c>(boolean) प्रकार <c>दोहरा</c>(boolean) शब्द(कीवर्ड) के साथ घोषित किया जाता है और केवल <c>सच</c>(true) या <c>झूठा</c>(false) मान ले सकता है :
</h><br>
</p>
<p>
<div class="example">
<e><h3 class="h-note">Example:</h3> </e>
<h> <h3 class="h-note">उदाहरण:</h3></h>
<div class="code-container"><div class="code TOE" id="editor">
दोहरा प्रोग्रामिंग_आसान_है = सच ;
दोहरा बिल्ली_भोंक_सकती_है = झूठ;
तंत्र.बाहर.प्रिंट(प्रोग्रामिंग_आसान_है);//sach
तंत्र.बाहर.प्रिंट(बिल्ली_भोंक_सकती_है);//झूठ </div></div></div>
</p>
<p><br>
<e>
But, it is more common to return <c>दोहरा</c> boolean values from boolean expressions, for conditional testing (see below).
</e>
<h>
लेकिन, अधिक सामान्य है दोहरी अभिव्यक्तियो(boolean expressions ) से <c>दोहरा</c>(boolean) मान लौटाना ।(नीचे देखे )
</h>
</p><br><hr>
<h2> Boolean Expression| दोहरी अभिव्यक्ति | बूलियन अभिव्यक्तियाँ</h2>
<p>
<e>
A दोहरी अभिव्यक्ति(Boolean expression) returns a <c>दोहरा</c>(boolean) value: <c>सच</c>(true) or <c>झूठ</c>(false) .<br><br>This is useful to build logic, and find answers.<br><br>For example, you can use a comparison operator, such as the greater than <c>></c> (>)operator, to find out if an expression (or a variable) is <c>सच</c>(true) or <c>झूठ</c>(false):
</e>
<h>
एक दोहरी अभिव्यक्ति(Boolean expression) एक <c>दोहरा</c>(boolean) मान देता है: <c>सच</c>(true) या <c>झूठ</c>(false) ।<br><br>यह तर्क बनाने और उत्तर खोजने के लिए उपयोगी है।<br><br>उदाहरण के लिए, आप एक तुलना संचालक(operator) का उपयोग कर सकते हैं, जैसे <c>></c> (>)संचालक(operator) से अधिक, खोजने के लिए यदि कोई व्यंजक (या एक चर(variable)) <c>सच</c>(true) या <c>झूठ</c>/गलत(false) है:
</h><br>
</p>
<p>
<div class="example">
<e><h3 class="h-note">Example:</h3></e>
<h> <h3 class="h-note">उदाहरण:</h3></h>
<div class="code-container"><div class="code TOE" id="editor">
अंक अ = 100;
अंक ब = 90;
तंत्र.बाहर.प्रिंट( अ > ब );//सच है क्योंकि 100 , 90 से ज्यादा है
</div></div></div>
</p><br><br>
<p>
<div class="example" >
<e>
<h3 class="h-note">Example:</h3>
Or even easier:
</e>
<h> <h3 class="h-note">उदाहरण:</h3>
या इससे भी आसान:
</h><br >
<div class="code-container" style="height:5%">
<div class="code TOE" id="editor">
तंत्र.बाहर.प्रिंट( 100 > 90 );//सच है क्योंकि 100 , 90 से ज्यादा है
</div></div></div>
</p>
<p>
<e>
In the below example, we use the equal to <c>==</c> संचालक(operator) to evaluate an expression:
</e>
<h>
नीचे दिए गए उदाहरण में, हम एक व्यंजक(expression) का मूल्यांकन(evaluation) करने के लिए के बराबर संचालक(operator)<c>==</c>का उपयोग करते हैं:
</h><br>
</p>
<p>
<div class="example" >
<e>
<h3 class="h-note">Example:</h3>
Or even easier:
</e>
<h> <h3 class="h-note">उदाहरण:</h3>
या इससे भी आसान:
</h><br >
<div class="code-container" style="height:15%">
<div class="code TOE" id="editor">
अंक अ= 100 ;
तंत्र.बाहर.प्रिंट( अ == 100 );//सच है क्योंकि अ का मूल्य 100
</div></div></div>
</p>
<p>
<div class="example" >
<e><h3 class="h-note">Example:</h3></e>
<h> <h3 class="h-note">उदाहरण:</h3></h>
<div class="code-container" style="height:5%">
<div class="code TOE" id="editor">
तंत्र.बाहर.प्रिंट( 100 == 90 );//झूठ है क्योंकि 100 , 90 के बराबर नहीं है
</div></div></div>
</p>
<br><hr><br>
<h2> Real Life Example|वास्तविक जीवन उदाहरण</h2>
<p>
<e>
Let's think of a "real life example" where we need to find if a person is old enough to vote.<br><br>In the example given below, we use the <c>>=</c>तुलना संचालक ( comparison operator) to find out if the "उम्र"(25) is ज्यादा या अरबर है (greater than OR equal) to the voting age limit, which is set to 18:
</e>
<h>
आइए एक "वास्तविक जीवन उदाहरण" के बारे में सोचें जहां हमें यह पता लगाने की आवश्यकता है की क्या कोई व्यक्ति मतदान करने के लिए पर्याप्त आयु का है या नहीं । <br><br>नीचे दिए गए उदाहरण में, हम <c>>=</c> तुलना संचालक (comparison operator) का उपयोग करते हैं पता करने के लिए की क्या "उम्र"(25) अधिक या बराबर है(greater than OR equal) मतदान की आयु सीमा के लिए, जो कि 18 पर स्थापित है, या नहीं |
</h><br>
</p>
<p>
<div class="example">
<e><h3 class="h-note">Example:</h3></e>
<h> <h3 class="h-note">उदाहरण:</h3></h>
<div class="code-container"><div class="code TOE" id="editor">
अंक मेरीउम्र = 25 ;
अंक मतदानआयु = 18 ;
तंत्र.बाहर.प्रिंट( मेरीउम्र >= मतदानआयु );
</div></div></div>
</p>
<p>
<e>
An even better approach (as we are on a roll now), would be to wrap the code above in an <c>अगर....या</c>(if...else) statement, so we can perform different actions depending on the result:
</e>
<h>
एक और भी बेहतर तरीका उपरोक्त संहिता/कोड को <c>अगर....या</c>(if...else) कथन में लिखना होगा, ताकि हम अलग-अलग परिणाम के आधार पर कार्रवाई/प्रदर्शन कर सकें :
</h><br>
</p>
<p>
<div class="example">
<e><h3 class="h-note">Example:</h3>
Output "आप मतदान कर सकते है!" if "मेरीउम्र" is greater than or equal to 18. Otherwise output "आप मतदान नहीं कर सकते है":
</e>
<h> <h3 class="h-note">उदाहरण:</h3></h>
<div class="code-container"><div class="code TOE" id="editor">
अंक मेरीउम्र = 25 ;
अंक मतदानआयु = 18 ;
अगर (मेरीउम्र >= मतदानआयु){
तंत्र.बाहर.प्रिंट("आप मतदान कर सकते है!");
तंत्र.बाहर.प्रिंट(" आपकी उम्र पर्याप्त है !");
}
या {
तंत्र.बाहर.प्रिंट(" आप मतदान नहीं कर सकते है,");
तंत्र.बाहर.प्रिंट(" आपकी उम्र पर्याप्त नहीं है !");
}</div></div></div>
</p>
<p>
<div class="note">
<e>
<h3 class="h-note">Note :</h3>
These are the basis for all comparisons and conditions (in programming, in here).<br><br>We will learn more about conditions in the next topic .
</e>
<h>
<h3 class="h-note">ध्यान दे:</h3>
ये सभी तुलनाओं और स्थितियों के आधार हैं।(प्रोग्रामिंग मे, यहाँ)<br><br>हम अगले विषय में शर्तों के बारे में अधिक जानेंगे।
</h>
</div>
</p>
</chapter>
<script src="scripts/article.js"></script>
<script src="scripts/ace.js"></script>
<script src="scripts/cobalt.js"></script>
<script src="scripts/mode-javaa.js"></script>
<script>codeload();</script>
</body>
</html>