{"id":277,"date":"2010-07-23T03:08:21","date_gmt":"2010-07-23T07:08:21","guid":{"rendered":"http:\/\/www.searchenginegenie.com\/programming-blog\/?p=277"},"modified":"2017-07-16T23:52:43","modified_gmt":"2017-07-17T03:52:43","slug":"javascript-to-find-greatest-among-3numbers","status":"publish","type":"post","link":"https:\/\/www.searchenginegenie.com\/programming-blog\/javascript-to-find-greatest-among-3numbers\/","title":{"rendered":"JavaScript To Find Greatest Among 3 Numbers"},"content":{"rendered":"<p>\/* The Following Script will display the greatest among three numbers*\/<\/p>\n<p>[html]<br \/>\n&lt;html&gt;<br \/>\n &lt;head&gt;<br \/>\n &lt;h1&gt;Greatest Among Three Numbers&lt;\/h1&gt;<br \/>\n &lt;\/head&gt;<br \/>\n &lt;body&gt;<br \/>\n &lt;script type=&quot;text\/javascript&quot;&gt;<br \/>\n var a=10,b=20,c=7;<\/p>\n<p>\/* checks a&gt;b and a&gt;c\u00a0 if\u00a0 both conditions satisfied, A is greater *\/<\/p>\n<p>if (a&gt;b\u00a0 &amp;&amp; a&gt;c)<br \/>\n {<br \/>\n document.write(&quot;&lt;b&gt;A is greater&lt;\/b&gt;&quot;);<br \/>\n }<\/p>\n<p>\/* checks b&gt;a\u00a0 and b&gt;c\u00a0 if\u00a0 both conditions satisfied, b is greater *\/<\/p>\n<p>if (b&gt;a\u00a0 &amp;&amp; b&gt;c)<br \/>\n {<br \/>\n document.write(&quot;&lt;b&gt;B is greater&lt;\/b&gt;&quot;);<br \/>\n }<\/p>\n<p>\/* if the above two conditions were false c is greater*\/<\/p>\n<p>else<br \/>\n {<br \/>\n document.write(&quot;&lt;b&gt;C is greater&lt;\/b&gt;&quot;);<br \/>\n }<br \/>\n &lt;\/script&gt;<br \/>\n &lt;\/body&gt;<br \/>\n &lt;\/html&gt;<br \/>\n[\/html]<\/p>\n<p>The Output will be:<\/p>\n<p><strong>Greatest Among\u00a0 Three Numbers<\/strong><\/p>\n<p><strong>B is Greater<\/strong><\/p>\n<h1><strong><br \/>\n<\/strong><\/h1>\n","protected":false},"excerpt":{"rendered":"<p>\/* The Following Script will display the greatest among three numbers*\/ [html] &lt;html&gt; &lt;head&gt; &lt;h1&gt;Greatest Among Three Numbers&lt;\/h1&gt; &lt;\/head&gt; &lt;body&gt; &lt;script type=&quot;text\/javascript&quot;&gt; var a=10,b=20,c=7; \/* checks a&gt;b and a&gt;c\u00a0 if\u00a0 both conditions satisfied, A is greater *\/ if (a&gt;b\u00a0 &amp;&amp; a&gt;c) { document.write(&quot;&lt;b&gt;A is greater&lt;\/b&gt;&quot;); } \/* checks b&gt;a\u00a0 and b&gt;c\u00a0 if\u00a0 both conditions satisfied, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-277","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/posts\/277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/comments?post=277"}],"version-history":[{"count":13,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/posts\/277\/revisions"}],"predecessor-version":[{"id":819,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/posts\/277\/revisions\/819"}],"wp:attachment":[{"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/media?parent=277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/categories?post=277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/programming-blog\/wp-json\/wp\/v2\/tags?post=277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}