<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3473077794025186772</id><updated>2024-10-24T20:24:25.719-07:00</updated><category term="C"/><category term="Graphics"/><category term="JAVA"/><category term="Pattern Making"/><category term="Blue J"/><category term="Sorting"/><category term="C++"/><category term="Animation"/><category term="Scheduling Programs"/><category term="Compiler Design"/><category term="MST"/><category term="Memory Segmentation"/><category term="Page Replacement"/><category term="Parsing"/><category term="Protocols"/><category term="Window8Help"/><category term="shortest_path"/><title type='text'>Programming on your Tips</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>harshit0215</name><uri>http://www.blogger.com/profile/14492301040519656714</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>62</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-8107578833943706423</id><published>2013-04-19T04:48:00.001-07:00</published><updated>2013-04-19T06:42:48.797-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><title type='text'>What is Java and why is java needed?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
The question &lt;i&gt;what is Java &lt;/i&gt;is now almost an absurd one
because it has emerged as the top 10 computer discoveries in the year 1995 and
ever since. Java is an object oriented programming language that was developed
by James Gosling at SUN Microsystems. The writing of this language started in June,
1991 by Mike Sheridan, Patrick Naughton and James Gosling and was released in
1995. Java is designed specially to be platform independent widely called WORA
(Write Once Run Anywhere). &lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;History of Java:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
The start and release date has never been the issue but the
naming for JAVA has always been since the name changed from OAK to JAVA.&lt;br /&gt;
SUN couldn’t continue with the name OAK because of the
copyright issues as it was a trademark for OAK Technologies.&lt;br /&gt;
So a team was called upon for brainstorming and many names
did come like DNA, Silk, Java, ruby, WRL.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
But nothing was much appropriate than JAVA. However there
is not any particular justified reason yet but the two reasonable did come:-&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Developers memorable Journey to Local coffee
shop.&lt;/li&gt;
&lt;li&gt;JAVA often referred to as a short form for &lt;u&gt;J&lt;/u&gt;ames
Gosling, &lt;u&gt;A&lt;/u&gt;rthur &lt;u&gt;V&lt;/u&gt;an Hoff, Andy &lt;u&gt;B&lt;/u&gt;echtolsheim.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l0 level1 lfo1; text-indent: -18.0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggrNl9HVVs4ISA_BHAvf10uCNOIfQTK00ucRaCsmXSmZBVq15EhfIFrpC22uosY-xBI5k04Dppis_ohY-yWjVSN6wgHhSlYzUBUWpHj2L5Xkal1k7q8r-vP_grSRKWdxcCFj4owXzpBE4/s1600/what+is+Java.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img alt=&quot;why do we need java what is java&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggrNl9HVVs4ISA_BHAvf10uCNOIfQTK00ucRaCsmXSmZBVq15EhfIFrpC22uosY-xBI5k04Dppis_ohY-yWjVSN6wgHhSlYzUBUWpHj2L5Xkal1k7q8r-vP_grSRKWdxcCFj4owXzpBE4/s1600/what+is+Java.jpg&quot; title=&quot;what is java&quot; /&gt;&lt;/a&gt;&lt;b&gt;&lt;u&gt;Need for Java?&lt;/u&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
Many
of you have following questions in your mind:-&lt;br /&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;i&gt;What is java?&lt;/i&gt; &lt;i&gt;&lt;br /&gt;
Why is java needed? &lt;br /&gt;
Any alternative for JAVA?&lt;/i&gt;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;text-indent: -18pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;No one can say that without
JAVA networking and application development&amp;nbsp;wasn&#39;t&lt;/span&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;&amp;nbsp;there. It worked fine
without java too. Still there are 4% websites that need Java to run server side
applications and .2% websites for client side applications. That&amp;nbsp;doesn&#39;t&lt;/span&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;&amp;nbsp;implies
that the rest 95.8% websites are obsolete.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;JAVA is needed because it
is reliable, easy, fast and secure. From mobiles through laptops and Tabs to gaming
devices everywhere is Java. Many applications on the browsers need java and
moreover now every browser has Java Plugin installed or rather integrated in
their browser.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Wingdings; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;text-indent: -18pt;&quot;&gt;Almost every secured site&amp;nbsp;https: needs Java to be installed for transactions to accept the commands like submit etc which also works on javascript.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Incoming terms:&amp;nbsp;&lt;/b&gt;&lt;i&gt;why do we need Java, What exactly is java, No need for JAVA.&lt;/i&gt;&lt;/h5&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;mso-list: l1 level1 lfo2; text-indent: -18.0pt;&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/8107578833943706423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2013/04/what-is-java-and-why-is-java-needed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/8107578833943706423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/8107578833943706423'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2013/04/what-is-java-and-why-is-java-needed.html' title='What is Java and why is java needed?'/><author><name>harshit0215</name><uri>http://www.blogger.com/profile/14492301040519656714</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggrNl9HVVs4ISA_BHAvf10uCNOIfQTK00ucRaCsmXSmZBVq15EhfIFrpC22uosY-xBI5k04Dppis_ohY-yWjVSN6wgHhSlYzUBUWpHj2L5Xkal1k7q8r-vP_grSRKWdxcCFj4owXzpBE4/s72-c/what+is+Java.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-8159378652665691113</id><published>2013-04-16T12:58:00.000-07:00</published><updated>2013-04-19T05:27:49.997-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><title type='text'>Character array c / chracter array java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Character array in c and character array in java can be implemented in two ways:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;1. Character array using pointers:&amp;nbsp;&lt;/b&gt;&lt;/div&gt;

&lt;div class=&quot;codes&quot;&gt;

&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
char *arr=&quot;hello&quot;;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
or&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
char *arr;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
arr=&quot;hello&quot;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
printf(&quot;%c&quot;, arr); &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
printf(&quot;\n%c&quot;,arr+3);&lt;/div&gt;

&lt;/div&gt;

&lt;h4 style=&quot;text-align: left;&quot;&gt;
OUTPUT:&lt;br /&gt;h&lt;br /&gt;l&lt;br /&gt;&lt;br /&gt;You can also use it for string array:-&lt;/h4&gt;
&lt;div class=&quot;codes&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
printf(&quot;%s&quot;,arr);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
printf(&quot;%s&quot;,arr+1);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
printf(&quot;%s&quot;,arr+2);&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;OUTPUT:&lt;br /&gt;hello&lt;br /&gt;ello&lt;br /&gt;llo&lt;br /&gt;&lt;br /&gt;2. Character array using Default Datatypes:-&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Character array in Java:-&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
We have a String datatype so no problem at all. You can just implement the array using string datatype in array.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;div class=&quot;codes&quot;&gt;
String a[]={&quot;character&quot;,&quot;array&quot;,&quot;in&quot;,&quot;java&quot;};&lt;br /&gt;
for(i=0;i&lt;5;i++)&lt;!--5--&gt;&lt;/5&gt;&lt;br /&gt;
{ System.out.println(a[i]);&lt;br /&gt;
}
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
&lt;!--5--&gt;&lt;/div&gt;
&lt;br /&gt;
OUTPUT:&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;i&gt;character&lt;br /&gt;array&lt;br /&gt;in&lt;br /&gt;java&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Character array in C:-&lt;/b&gt;&lt;/h4&gt;
It is almost similar to that in Java but there we have to use char datatype.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;

&lt;div class=&quot;codes&quot;&gt;
&lt;blockquote&gt;

char a[4][10]={&quot;character&quot;,&quot;array&quot;,&quot;in&quot;,&quot;c&quot;};&lt;br /&gt;
for(i=0;i&lt;4;i++)&lt;br&gt;
{&lt;br/&gt; printf(&quot;%s&quot;,a[i]);&lt;br /&gt;
}

&lt;/blockquote&gt;
&lt;/div&gt;
&lt;!--4--&gt;&lt;!--4--&gt;&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;OUTPUT:
&lt;br /&gt;&lt;i&gt;character&lt;br /&gt;array&lt;br /&gt;in&lt;br /&gt;c&lt;/i&gt;&lt;/h4&gt;
&lt;!--5--&gt;&lt;!--4--&gt;&lt;!--5--&gt;&lt;!--4--&gt;&lt;!--5--&gt;&lt;!--4--&gt;
&lt;/4&gt;&lt;/div&gt;


Tags: Character array in c, Character array in java.</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/8159378652665691113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2013/04/character-array-c-chracter-array-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/8159378652665691113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/8159378652665691113'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2013/04/character-array-c-chracter-array-java.html' title='Character array c / chracter array java'/><author><name>harshit0215</name><uri>http://www.blogger.com/profile/14492301040519656714</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-4346721638869861146</id><published>2013-03-24T03:33:00.005-07:00</published><updated>2013-03-24T03:33:57.652-07:00</updated><title type='text'>How to Null a string or empty a string array</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: large;&quot;&gt;&lt;b&gt;
Null a String/ Empty a string array&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;i&gt;Null a string&lt;/i&gt; in C using pointer string or array string. Many times the string is nullified assigning arr[0]=&#39;\0&#39; but this will not nullify the array as only the first index will be NULL.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: large;&quot;&gt;&lt;b&gt;&lt;u&gt;1. Null a string using pointer string.&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;char *ptr=&quot;hello&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;printf(&quot;%s&quot; , ptr);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;*ptr=&#39;\0&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;printf(&quot;\n %s &amp;nbsp;and &amp;nbsp;%s &quot;,ptr,ptr+1); &amp;nbsp;


&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;TWywarn&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;TO show that array/pointer is not actually empty or null the first array null but the rest of array&amp;nbsp;characters&amp;nbsp;are still on the same address.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;  

&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;ptr=&quot;&quot;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;printf(&quot;%s and %s&quot;, ptr,ptr+1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;OUTPUT:&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;hello&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; and ello&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: large;&quot;&gt;&lt;b&gt;&lt;u&gt;2. Null a string using array string&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;i&gt;Null a string&lt;/i&gt; using an array is not efficient as though the first index is nullified but the rest of the characters still have the same address.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;char arr[30]=&quot;hello&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;arr[0]=&#39;\0&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;printf(&quot;null string=%s and %c&quot;,arr,arr[2]);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;OUTPUT:&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;null string=&lt;/span&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;and l&lt;/span&gt;&lt;/h4&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/4346721638869861146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2013/03/how-to-null-string-or-empty-string-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/4346721638869861146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/4346721638869861146'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2013/03/how-to-null-string-or-empty-string-array.html' title='How to Null a string or empty a string array'/><author><name>harshit0215</name><uri>http://www.blogger.com/profile/14492301040519656714</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-8795175114267045719</id><published>2013-03-14T10:11:00.001-07:00</published><updated>2013-03-16T22:06:01.931-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><title type='text'>C Program to count prime numbers in given range</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
This is the program to count total number of Prime numbers with in 1 to specified range&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
#include&amp;lt;math.h&amp;gt;&lt;br /&gt;
long countprime(long a,long k)&lt;br /&gt;
{&lt;br /&gt;
long i;&lt;br /&gt;
for(i=a;i&amp;gt;=2;i--)&lt;br /&gt;
{&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
if(k%i==0)&lt;br /&gt;
return 0;&lt;br /&gt;
}&lt;br /&gt;
return 1;&lt;br /&gt;
}&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
long i,range;&lt;br /&gt;
long count=1;&lt;br /&gt;
double x;&lt;br /&gt;
printf(&quot;Enter the range: &quot;);&lt;br /&gt;
scanf(&quot;%ld\n&quot;,&amp;amp;range);&lt;br /&gt;
for(i=3;i&amp;lt;range;i++)&lt;br /&gt;
{&lt;br /&gt;
x=sqrt(i);&lt;br /&gt;
count+=countprime(floor(x),i);&lt;br /&gt;
}&lt;br /&gt;
printf(&quot;\n Total number of prime numbers are %ld&quot;,count);&lt;br /&gt;
getch();&lt;br /&gt;
}&lt;/blockquote&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Output&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKVhPNSPkxdEDt1z_8K-pmWlnFheF5PoUW931fLfABsOmsKednwOOq_NRCSmVTNmRBr7TLLSm-yADxheo9OCq8BJ7xNAkbTk_x38g98qpfSSVqlvwMaf-q5NV1YHvg-VZFKwEv8sRHFCfH/s1600/Capture.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;103&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKVhPNSPkxdEDt1z_8K-pmWlnFheF5PoUW931fLfABsOmsKednwOOq_NRCSmVTNmRBr7TLLSm-yADxheo9OCq8BJ7xNAkbTk_x38g98qpfSSVqlvwMaf-q5NV1YHvg-VZFKwEv8sRHFCfH/s320/Capture.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&lt;/h2&gt;
&lt;div&gt;
These are the some sample output which you can check using this programs.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;table bgcolor=&quot;#F0F9FF&quot; border=&quot;0&quot; style=&quot;color: black; text-align: right;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: right;&quot;&gt;&lt;br /&gt;
1&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;10&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;4&lt;/td&gt;&lt;td style=&quot;text-align: left;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: right;&quot;&gt;2&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;100&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;25&lt;/td&gt;&lt;td style=&quot;text-align: left;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: right;&quot;&gt;3&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;1,000&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;168&lt;/td&gt;&lt;td style=&quot;text-align: left;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: right;&quot;&gt;4&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;10,000&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;1,229&lt;/td&gt;&lt;td style=&quot;text-align: left;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: right;&quot;&gt;5&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;100,000&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;9,592&lt;/td&gt;&lt;td style=&quot;text-align: left;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: right;&quot;&gt;6&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;1,000,000&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;78,498&lt;/td&gt;&lt;td style=&quot;text-align: left;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: right;&quot;&gt;7&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;10,000,000&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;664,579&lt;/td&gt;&lt;td style=&quot;text-align: left;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: right;&quot;&gt;8&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;100,000,000&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;5,761,455&lt;/td&gt;&lt;td style=&quot;text-align: left;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: right;&quot;&gt;9&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;1,000,000,000&lt;/td&gt;&lt;td style=&quot;text-align: right;&quot;&gt;50,847,534&lt;/td&gt;&lt;td style=&quot;text-align: left;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
tags: Prime Numbers, Program to find total number of prime numbers&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/8795175114267045719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2013/03/this-is-program-to-count-total-number.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/8795175114267045719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/8795175114267045719'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2013/03/this-is-program-to-count-total-number.html' title='C Program to count prime numbers in given range'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKVhPNSPkxdEDt1z_8K-pmWlnFheF5PoUW931fLfABsOmsKednwOOq_NRCSmVTNmRBr7TLLSm-yADxheo9OCq8BJ7xNAkbTk_x38g98qpfSSVqlvwMaf-q5NV1YHvg-VZFKwEv8sRHFCfH/s72-c/Capture.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-2010907932448482081</id><published>2013-03-08T09:18:00.001-08:00</published><updated>2013-03-12T09:18:14.790-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><title type='text'>C Program for Bit Stuffing</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Bit Stuffing: In bit stuffing&amp;nbsp;following&amp;nbsp;rules hold:-&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;To the given bits add the string 01111110 to both the starting and the end of the string&lt;/li&gt;
&lt;li&gt;To add 0 to each set of 5 one&#39;s i.e. after every five consecutive 1&#39;s appear a zero&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
#include&lt;conio .h=&quot;&quot;&gt;&lt;/conio&gt;&lt;br /&gt;
#include&lt;stdio .h=&quot;&quot;&gt;&lt;/stdio&gt;&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int i=0,count=0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;char a[100],p[8]=&quot;01111110&quot;;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clrscr();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;printf(&quot;enter the bits : &amp;nbsp;&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;scanf(&quot;%s&quot;,a);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;printf(&quot;After bit stuffing \n&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;printf(&quot;%s&quot;,p);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;for(i=0;a[i]!=&#39;\0&#39;;((a[i]==1)? count++ : count==0))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;printf(&quot;%c&quot;,a[i]);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if(count==5)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;printf(&quot;0&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;count=0;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;printf(&quot;%s&quot;,p);&lt;br /&gt;
getch();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Tags: Write a C program for bit stuffing, bit-stuffing&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/2010907932448482081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2013/03/c-program-for-bit-stuffing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/2010907932448482081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/2010907932448482081'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2013/03/c-program-for-bit-stuffing.html' title='C Program for Bit Stuffing'/><author><name>harshit0215</name><uri>http://www.blogger.com/profile/14492301040519656714</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-6430176012545984167</id><published>2013-03-05T12:43:00.000-08:00</published><updated>2013-03-18T11:24:01.803-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="Protocols"/><title type='text'>C Program to implement CRC (Cyclic Redundancy Code)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a C Program for implementing CRC (Cyclic Redundancy Check Code)&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include&amp;lt;conio.h&amp;gt;&lt;br /&gt;
#include&amp;lt;string.h&amp;gt;&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
int i,j,keylen,msglen;&lt;br /&gt;
char input[100], key[30],temp[30],quot[100],rem[30],key1[30];&lt;br /&gt;
clrscr();&lt;br /&gt;
printf(&quot;Enter Data: &quot;);&lt;br /&gt;
gets(input);&lt;br /&gt;
printf(&quot;Enter Key: &quot;);&lt;br /&gt;
gets(key);&lt;br /&gt;
keylen=strlen(key);&lt;br /&gt;
msglen=strlen(input);&lt;br /&gt;
strcpy(key1,key);&lt;br /&gt;
for(i=0;i&amp;lt;keylen-1;i++)&lt;br /&gt;
{&lt;br /&gt;
input[msglen+i]=&#39;0&#39;;&lt;br /&gt;
}&lt;br /&gt;
for(i=0;i&amp;lt;keylen;i++)&lt;br /&gt;
temp[i]=input[i];&lt;br /&gt;
for(i=0;i&amp;lt;msglen;i++)&lt;br /&gt;
{&lt;br /&gt;
quot[i]=temp[0];&lt;br /&gt;
if(quot[i]==&#39;0&#39;)&lt;br /&gt;
for(j=0;j&amp;lt;keylen;j++)&lt;br /&gt;
key[j]=&#39;0&#39;;&lt;br /&gt;
else&lt;br /&gt;
for(j=0;j&amp;lt;keylen;j++)&lt;br /&gt;
key[j]=key1[j];&lt;br /&gt;
for(j=keylen-1;j&amp;gt;0;j--)&lt;br /&gt;
{&lt;br /&gt;
if(temp[j]==key[j])&lt;br /&gt;
rem[j-1]=&#39;0&#39;;&lt;br /&gt;
else&lt;br /&gt;
rem[j-1]=&#39;1&#39;;&lt;br /&gt;
}&lt;br /&gt;
rem[keylen-1]=input[i+keylen];&lt;br /&gt;
strcpy(temp,rem);&lt;br /&gt;
}&lt;br /&gt;
strcpy(rem,temp);&lt;br /&gt;
printf(&quot;\nQuotient is &quot;);&lt;br /&gt;
for(i=0;i&amp;lt;msglen;i++)&lt;br /&gt;
printf(&quot;%c&quot;,quot[i]);&lt;br /&gt;
printf(&quot;\nRemainder is &quot;);&lt;br /&gt;
for(i=0;i&amp;lt;keylen-1;i++)&lt;br /&gt;
printf(&quot;%c&quot;,rem[i]);&lt;br /&gt;
printf(&quot;\nFinal data is: &quot;);&lt;br /&gt;
for(i=0;i&amp;lt;msglen;i++)&lt;br /&gt;
printf(&quot;%c&quot;,input[i]);&lt;br /&gt;
for(i=0;i&amp;lt;keylen-1;i++)&lt;br /&gt;
printf(&quot;%c&quot;,rem[i]);&lt;br /&gt;
getch();&lt;br /&gt;
}&lt;/blockquote&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Output:&amp;nbsp;&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlt2fFG-B4tqUTt7iYqanK3n865QPia66dqUsJSfaiAwhoZBYz2exUkpmndEZ7m10dUe8hoF7jl_fbsbveFGltJpuGVUqmRQOFX96es3BgdHDO77_2nzWA8rQ-i2T_vpx0QRhToMCm4kG0/s1600/crc.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;164&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlt2fFG-B4tqUTt7iYqanK3n865QPia66dqUsJSfaiAwhoZBYz2exUkpmndEZ7m10dUe8hoF7jl_fbsbveFGltJpuGVUqmRQOFX96es3BgdHDO77_2nzWA8rQ-i2T_vpx0QRhToMCm4kG0/s320/crc.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
tags: Error Checking and Correction, CRC program, C program of CRC,Cyclic Redundancy Check Code, protocols&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/6430176012545984167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2013/03/c-program-to-implement-crc-checksum.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/6430176012545984167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/6430176012545984167'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2013/03/c-program-to-implement-crc-checksum.html' title='C Program to implement CRC (Cyclic Redundancy Code)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlt2fFG-B4tqUTt7iYqanK3n865QPia66dqUsJSfaiAwhoZBYz2exUkpmndEZ7m10dUe8hoF7jl_fbsbveFGltJpuGVUqmRQOFX96es3BgdHDO77_2nzWA8rQ-i2T_vpx0QRhToMCm4kG0/s72-c/crc.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-4970372397980589507</id><published>2013-03-05T11:39:00.002-08:00</published><updated>2013-03-05T11:42:00.128-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><title type='text'>C Program for Add two Numbers without using Operator</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
This is the simple c program which takes two numbers as input and give addition of those number as output. this program doesn&#39;t use any operator for that purpose.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Program 1:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
#include&quot;stdio.h&quot;&lt;br /&gt;
#include&quot;conio.h&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp;int a,b,sum;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;char *p;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;clrscr();&lt;br /&gt;
&amp;nbsp; &amp;nbsp;printf(&quot;Enter 2 values : &quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;scanf(&quot;%d%d&quot;,&amp;amp;a,&amp;amp;b);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;p = (char *)a;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;sum = (int)&amp;amp;p[b];&lt;br /&gt;
&amp;nbsp; &amp;nbsp;printf(&quot;\nSum : %d&quot;,sum);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;getch();&lt;br /&gt;
}&lt;/blockquote&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Program 2:&lt;/b&gt;&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
#include&quot;stdio.h&quot;&lt;br /&gt;
#include&quot;conio.h&quot;&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp;int a,b,sum;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;char *p;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;clrscr();&lt;br /&gt;
&amp;nbsp; &amp;nbsp;printf(&quot;Enter 2 values : &quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;scanf(&quot;%d%d&quot;,&amp;amp;a,&amp;amp;b);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;printf(&quot;\nResult is: %d&quot;,printf(&quot;%*c%*c&quot;,a,&#39; &#39;,b,&#39; &#39;));&lt;br /&gt;
&amp;nbsp; &amp;nbsp;getch();&lt;br /&gt;
}&lt;/blockquote&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Output:&lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOA4i8sC9RB-6-Y4JX26ZHB5cMrnhAMyqxsEdf83WPIJy3j1jY5r2ibYi_ayE0g8-dmdmCh03zEQhEIAyNBB7VrkGoEEFP9TzEz9sQTrmsya1d0JqLoQgzJD4zAPCSx2ytmaRU-dmU-S3y/s1600/pro.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;232&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOA4i8sC9RB-6-Y4JX26ZHB5cMrnhAMyqxsEdf83WPIJy3j1jY5r2ibYi_ayE0g8-dmdmCh03zEQhEIAyNBB7VrkGoEEFP9TzEz9sQTrmsya1d0JqLoQgzJD4zAPCSx2ytmaRU-dmU-S3y/s320/pro.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
tags: C program for addition of two numbers without using operators, addition on number, C program,without Operator addition, Operator less addition&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/4970372397980589507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2013/03/c-program-for-add-two-numbers-without.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/4970372397980589507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/4970372397980589507'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2013/03/c-program-for-add-two-numbers-without.html' title='C Program for Add two Numbers without using Operator'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOA4i8sC9RB-6-Y4JX26ZHB5cMrnhAMyqxsEdf83WPIJy3j1jY5r2ibYi_ayE0g8-dmdmCh03zEQhEIAyNBB7VrkGoEEFP9TzEz9sQTrmsya1d0JqLoQgzJD4zAPCSx2ytmaRU-dmU-S3y/s72-c/pro.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-6228834169554177360</id><published>2013-03-02T21:43:00.000-08:00</published><updated>2013-03-02T21:51:21.608-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="Compiler Design"/><title type='text'>C Program for Implementation of Regular Expession</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
C Program for implementing DFA of Regular Expression&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
(a+aa*b)*&amp;nbsp;&lt;/blockquote&gt;
In this program you have to enter a string and output will be shown as &amp;nbsp;whether string will be accepted or not. Program is implemented using transition table not jumping on different states. It can be easily modifiable for other regular expressions.&lt;br /&gt;
&lt;br /&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include&amp;lt;conio.h&amp;gt;&lt;br /&gt;
#include&amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
int table[2][2],i,j,l,status=0,success;&lt;br /&gt;
char input[100];&lt;br /&gt;
printf(&quot;Program for implmenting DFA of language (a+aa*b)*\n\n\nEnter Input String \n&quot;);&lt;br /&gt;
table[0][0]=1;&lt;br /&gt;
table[0][1]=-1;&lt;br /&gt;
table[1][0]=1;&lt;br /&gt;
table[1][1]=0;&lt;br /&gt;
scanf(&quot;%s&quot;,input);&lt;br /&gt;
l=strlen(input);&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&amp;lt;l;i++)&lt;br /&gt;
{&lt;br /&gt;
if(input[i]!=&#39;a&#39;&amp;amp;&amp;amp;input[i]!=&#39;b&#39;)&lt;br /&gt;
{&lt;br /&gt;
printf(&quot;Value entered is wrong&quot;);&lt;br /&gt;
getch();&lt;br /&gt;
exit(0);&lt;br /&gt;
}&lt;br /&gt;
if(input[i]==&#39;a&#39;)&lt;br /&gt;
status=table[status][0];&lt;br /&gt;
else&lt;br /&gt;
status=table[status][1];&lt;br /&gt;
&lt;br /&gt;
if(status==-1)&lt;br /&gt;
{&lt;br /&gt;
printf(&quot;String not Accepted by this Language&quot;);&lt;br /&gt;
break;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
if(i==l)&lt;br /&gt;
printf(&quot;String Accepted&quot;);&lt;br /&gt;
getch();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
OUTPUT:&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu41Dp_XO_N0dtXYFk36QV4VOjwE2TbmDgk70q6Sq202EBEr5EPjar2bWtGmu5NzveGb9sD33MxXx0dBdPwF0LX-24BS9yOjBApec_H1akRTcPk-95GmHx1k90GfUpVEICUrmSOCvSAcwZ/s1600/dfa.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;117&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu41Dp_XO_N0dtXYFk36QV4VOjwE2TbmDgk70q6Sq202EBEr5EPjar2bWtGmu5NzveGb9sD33MxXx0dBdPwF0LX-24BS9yOjBApec_H1akRTcPk-95GmHx1k90GfUpVEICUrmSOCvSAcwZ/s320/dfa.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
If you find any difficulty in this program than please comment you problem here. We will happily solve you problem.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
tags: Compiler Design, DFA implementation, Regular expression implementation, C program for DFA&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/6228834169554177360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2013/03/c-program-for-implementation-of-regular.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/6228834169554177360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/6228834169554177360'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2013/03/c-program-for-implementation-of-regular.html' title='C Program for Implementation of Regular Expession'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu41Dp_XO_N0dtXYFk36QV4VOjwE2TbmDgk70q6Sq202EBEr5EPjar2bWtGmu5NzveGb9sD33MxXx0dBdPwF0LX-24BS9yOjBApec_H1akRTcPk-95GmHx1k90GfUpVEICUrmSOCvSAcwZ/s72-c/dfa.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-5092737704539166786</id><published>2013-03-02T21:30:00.000-08:00</published><updated>2013-03-02T21:53:13.470-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="Compiler Design"/><category scheme="http://www.blogger.com/atom/ns#" term="Parsing"/><title type='text'>C Program for Recursive Descent Parser</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;
C Program for implementation of Recursive Descent Parser for language given below&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
E-&amp;gt; TE&#39;&lt;br /&gt;
E&#39;-&amp;gt; +TE&#39; | -TE&#39; | null&lt;br /&gt;
T-&amp;gt; FT&#39;&lt;br /&gt;
T&#39;-&amp;gt; *FT&#39;| /FT&#39; | null&lt;br /&gt;
F-&amp;gt; id/ (E)/ num&lt;/blockquote&gt;
&lt;br /&gt;
Here &#39;id&#39; can be a single letter. And &#39;num&#39; can be a single digit number.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;br /&gt;#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include&amp;lt;string.h&amp;gt;&lt;br /&gt;char input[100];&lt;br /&gt;char prod[100][100];&lt;br /&gt;int pos=-1,l,st=-1;&lt;br /&gt;char id,num;&lt;br /&gt;void E();&lt;br /&gt;void T();&lt;br /&gt;void F();&lt;br /&gt;void advance();&lt;br /&gt;void Td();&lt;br /&gt;void Ed();&lt;br /&gt;void advance()&lt;br /&gt;{&lt;br /&gt;pos++;&lt;br /&gt;if(pos&amp;lt;l)&lt;br /&gt;{&lt;br /&gt;if(input[pos]&amp;gt;=&#39;0&#39;&amp;amp;&amp;amp; input[pos]&amp;lt;=&#39;9&#39;)&lt;br /&gt;{&lt;br /&gt;num=input[pos];&lt;br /&gt;id=&#39;\0&#39;;&lt;br /&gt;}&lt;br /&gt;if((input[pos]&amp;gt;=&#39;a&#39; || input[pos]&amp;gt;=&#39;A&#39;)&amp;amp;&amp;amp;(input[pos]&amp;lt;=&#39;z&#39; || input[pos]&amp;lt;=&#39;Z&#39;))&lt;br /&gt;{id=input[pos];&lt;br /&gt;num=&#39;\0&#39;;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;void E()&lt;br /&gt;{&lt;br /&gt;strcpy(prod[++st],&quot;E-&amp;gt;TE&#39;&quot;);&lt;br /&gt;T();&lt;br /&gt;Ed();&lt;br /&gt;}&lt;br /&gt;void Ed()&lt;br /&gt;{&lt;br /&gt;int p=1;&lt;br /&gt;if(input[pos]==&#39;+&#39;)&lt;br /&gt;{&lt;br /&gt;p=0;&lt;br /&gt;strcpy(prod[++st],&quot;E&#39;-&amp;gt;+TE&#39;&quot;);&lt;br /&gt;advance();&lt;br /&gt;T();&lt;br /&gt;Ed();&lt;br /&gt;}&lt;br /&gt;if(input[pos]==&#39;-&#39;)&lt;br /&gt;{ &amp;nbsp; p=0;&lt;br /&gt;strcpy(prod[++st],&quot;E&#39;-&amp;gt;-TE&#39;&quot;);&lt;br /&gt;advance();&lt;br /&gt;T();&lt;br /&gt;Ed();&lt;br /&gt;}&lt;br /&gt;if(p==1)&lt;br /&gt;{&lt;br /&gt;strcpy(prod[++st],&quot;E&#39;-&amp;gt;null&quot;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void T()&lt;br /&gt;{&lt;br /&gt;strcpy(prod[++st],&quot;T-&amp;gt;FT&#39;&quot;);&lt;br /&gt;F();&lt;br /&gt;Td();&lt;br /&gt;}&lt;br /&gt;void Td()&lt;br /&gt;{&lt;br /&gt;int p=1;&lt;br /&gt;if(input[pos]==&#39;*&#39;)&lt;br /&gt;{&lt;br /&gt;p=0;&lt;br /&gt;strcpy(prod[++st],&quot;T&#39;-&amp;gt;*FT&#39;&quot;);&lt;br /&gt;advance();&lt;br /&gt;F();&lt;br /&gt;Td();&lt;br /&gt;}&lt;br /&gt;if(input[pos]==&#39;/&#39;)&lt;br /&gt;{ &amp;nbsp; p=0;&lt;br /&gt;strcpy(prod[++st],&quot;T&#39;-&amp;gt;/FT&#39;&quot;);&lt;br /&gt;advance();&lt;br /&gt;F();&lt;br /&gt;Td();&lt;br /&gt;}&lt;br /&gt;if(p==1)&lt;br /&gt;strcpy(prod[++st],&quot;T&#39;-&amp;gt;null&quot;);&lt;br /&gt;}&lt;br /&gt;void F()&lt;br /&gt;{&lt;br /&gt;if(input[pos]==id) {&lt;br /&gt;strcpy(prod[++st],&quot;F-&amp;gt;id&quot;);&lt;br /&gt;advance(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;if(input[pos]==&#39;(&#39;)&lt;br /&gt;{&lt;br /&gt;strcpy(prod[++st],&quot;F-&amp;gt;(E)&quot;);&lt;br /&gt;advance();&lt;br /&gt;E();&lt;br /&gt;if(input[pos]==&#39;)&#39;) &amp;nbsp; {&lt;br /&gt;//strcpy(prod[++st],&quot;F-&amp;gt;(E)&quot;);&lt;br /&gt;advance(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;if(input[pos]==num)&lt;br /&gt;{&lt;br /&gt;strcpy(prod[++st],&quot;F-&amp;gt;num&quot;);&lt;br /&gt;advance();&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;printf(&quot;Enter Input String &quot;);&lt;br /&gt;scanf(&quot;%s&quot;,input);&lt;br /&gt;l=strlen(input);&lt;br /&gt;input[l]=&#39;$&#39;;&lt;br /&gt;advance();&lt;br /&gt;E();&lt;br /&gt;if(pos==l)&lt;br /&gt;{&lt;br /&gt;printf(&quot;String Accepted\n&quot;);&lt;br /&gt;for(i=0;i&amp;lt;=st;i++)&lt;br /&gt;{&lt;br /&gt;printf(&quot;%s\n&quot;,prod[i]);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;printf(&quot;String rejected\n&quot;);&lt;br /&gt;}&lt;br /&gt;getch();&lt;br /&gt;return 0;&lt;br /&gt;}&lt;/blockquote&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
OUTPUT:&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8ljIokAiOKgPIzmb6FTOyOlT9e7yZwG9TRvN5Yv0w0HWkPPDr6G0QSmIYhXEp_MtJekeAjnNLuEABXIF_mFkY8c6co0gFXzv-4lC8yjAEk8xsecwEFA-RvzD34xxd-7JWiwo-hoUarN-B/s1600/descent.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8ljIokAiOKgPIzmb6FTOyOlT9e7yZwG9TRvN5Yv0w0HWkPPDr6G0QSmIYhXEp_MtJekeAjnNLuEABXIF_mFkY8c6co0gFXzv-4lC8yjAEk8xsecwEFA-RvzD34xxd-7JWiwo-hoUarN-B/s320/descent.JPG&quot; width=&quot;235&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
If you like this then please share this page. You can comment you queries here. Or you can also ask for a program. We are happy to help you.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
tags: C program for Recursive Decsent parser, compiler design programs, parsing techniques&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/5092737704539166786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2013/03/c-program-for-recursive-descent-parser.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/5092737704539166786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/5092737704539166786'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2013/03/c-program-for-recursive-descent-parser.html' title='C Program for Recursive Descent Parser'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8ljIokAiOKgPIzmb6FTOyOlT9e7yZwG9TRvN5Yv0w0HWkPPDr6G0QSmIYhXEp_MtJekeAjnNLuEABXIF_mFkY8c6co0gFXzv-4lC8yjAEk8xsecwEFA-RvzD34xxd-7JWiwo-hoUarN-B/s72-c/descent.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-8195383242509906260</id><published>2013-02-27T10:35:00.000-08:00</published><updated>2013-03-02T21:31:54.030-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><title type='text'>program in Java/ Bluej to display the present date and the date after N days</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Q. Write a program to input the number of days, year and integer N and display the present date and date&amp;nbsp;after&amp;nbsp;N Days.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class iscdate2&lt;br /&gt;
{&lt;br /&gt;
void calc(int yr,int cd,int n1)&lt;br /&gt;
{&lt;br /&gt;
String m[]={&quot;jan&quot;,&quot;feb&quot;,&quot;march&quot;,&quot;april&quot;,&quot;may&quot;,&quot;june&quot;,&quot;july&quot;,&quot;august&quot;,&quot;september&quot;,&quot;october&quot;,&quot;november&quot;, &quot;december&quot;};&lt;br /&gt;
{&lt;br /&gt;
int a[]={31,29,31,30,31,30,31,31,30,31,30,31};&lt;br /&gt;
int b[]={31,28,31,30,31,30,31,31,30,31,30,31};&lt;br /&gt;
int t=0,d,c,i;&lt;br /&gt;
c=(n1/30+1);&lt;br /&gt;
for(i=0;i&amp;lt;c;i++)&lt;br /&gt;
{&lt;br /&gt;
if(yr%4==0)&lt;br /&gt;
t+=a[i];&lt;br /&gt;
else&lt;br /&gt;
t+=b[i];&lt;br /&gt;
if(t&amp;gt;n1)&lt;br /&gt;
{&lt;br /&gt;
if(n1&amp;gt;30)&lt;br /&gt;
d=n1-t+a[i];&lt;br /&gt;
else&lt;br /&gt;
d=n1;&lt;br /&gt;
if(cd==1)&lt;br /&gt;
System.out.println(&quot;present date:&quot;+d+m[i]+yr);&lt;br /&gt;
else&lt;br /&gt;
System.out.println(&quot;date after&quot;+cd+&quot;day is:&quot;+d+m[i]+yr);&lt;br /&gt;
break;&lt;br /&gt;
}&lt;br /&gt;
}}}&lt;br /&gt;
public static void main(int y,int n,int N)&lt;br /&gt;
{&lt;br /&gt;
iscdate2 ob=new iscdate2();&lt;br /&gt;
ob.calc(y,1,n);&lt;br /&gt;
if(n+N&amp;gt;366)&lt;br /&gt;
{&lt;br /&gt;
int z=n+N-366;&lt;br /&gt;
ob.calc(y+1,N,2);&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
ob.calc(y,N,n+N);&lt;br /&gt;
}}&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/8195383242509906260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2013/02/program-in-java-bluej-to-display.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/8195383242509906260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/8195383242509906260'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2013/02/program-in-java-bluej-to-display.html' title='program in Java/ Bluej to display the present date and the date after N days'/><author><name>harshit0215</name><uri>http://www.blogger.com/profile/14492301040519656714</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-7357423128873375220</id><published>2012-11-18T18:52:00.001-08:00</published><updated>2012-11-19T04:58:54.595-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Window8Help"/><title type='text'>How is windows8 different from windows7</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Windows 8 in growing its demand however Microsoft is putting it hard to establish the market since their expectations were much more. Here we will mention&amp;nbsp;the differences between windows 8 and windows 7, &amp;nbsp;list the extra features of windows 8, and tell why Windows 8 is superior to windows 7.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT0Le-nG1JrqaGTwRx8YkXgWb0_nwNw7l7cdk_U3dh47XdJH54k7yWSt2KvViy7dMt00LQcBNVB-0jV5sF21knGHXfZDf1Dcw8uJVAc7JumV4u2E1pXwS2yauMnlq91QOPa6wOrEYM1i4/s1600/Windows8+different+to+windows7.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Windows 8 superior to windows 7&quot; border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT0Le-nG1JrqaGTwRx8YkXgWb0_nwNw7l7cdk_U3dh47XdJH54k7yWSt2KvViy7dMt00LQcBNVB-0jV5sF21knGHXfZDf1Dcw8uJVAc7JumV4u2E1pXwS2yauMnlq91QOPa6wOrEYM1i4/s320/Windows8+different+to+windows7.jpg&quot; title=&quot;Windows8 different from windows7&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
1. Windows 8 is best suited for touchscreen devices. It gives the look of a tablet etc and the representation of icons is in the form of Apps.&amp;nbsp;In-fact&amp;nbsp;windows 8 is basically brought for users to build their own applications and suit their&amp;nbsp;purpose.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;i&gt;Windows 8= Windows 7 + Windows RT(Runtime)&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
This is where the main concept of windows 8 is- it includes the windows RT(Windows runtime) which takes less power to run Apps thus decreasing the battery power consumption. Critics say that windows 7 is much more user friendly however soon windows 8 will adjust in the market and grab the seat.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
2. Their is no start button instead a whole start screen where your applications icons are placed and moreover you can switch to the windows 7 look by clicking the desktop.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;
3. There is no X(close) button - rather you have to grab the windows downward and close it.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
4. The best of all feature is its copy , move etc all merged into one with pause and resume option included. So those who are using Tera Copy or such software need to do so. Their features are included in Windows 8.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
5. Those who are using Daemon tools or similar softwares - stop using it. Windows 8 has inbuilt feature of mount and unmount a disk or drive of an image (ISO file).&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
6. You can create you Bootable flash drive also without using a third party software.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
7. Easier windows restore option and handling.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
8. Improved&amp;nbsp;task manager.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;i&gt;Tags: Windows 8 superior to windows 7, differences between windows 8 and windows 7, how is windows 8 different to windows 7.&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/7357423128873375220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/how-is-windows-8-different-from-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/7357423128873375220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/7357423128873375220'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/how-is-windows-8-different-from-windows.html' title='How is windows8 different from windows7'/><author><name>harshit0215</name><uri>http://www.blogger.com/profile/14492301040519656714</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT0Le-nG1JrqaGTwRx8YkXgWb0_nwNw7l7cdk_U3dh47XdJH54k7yWSt2KvViy7dMt00LQcBNVB-0jV5sF21knGHXfZDf1Dcw8uJVAc7JumV4u2E1pXwS2yauMnlq91QOPa6wOrEYM1i4/s72-c/Windows8+different+to+windows7.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-2587430213957525269</id><published>2012-11-15T23:27:00.001-08:00</published><updated>2012-11-18T18:20:25.204-08:00</updated><title type='text'>Java program for producing prime numbers for given range</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Program to print all prime numbers between 100 to 10000 or whatever given range.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;class prime&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;public static void main()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;int i,j,k;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;for(i=101;i&amp;lt;10000li++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;k=0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for(j=2;j&amp;lt;i;j++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(i%j==0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;k++;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(k==0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.print(i+&quot; &amp;nbsp; &quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;OUTPUT:&lt;/span&gt;&lt;/h4&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2boNgl15GZ0Ouqjvlr31oJmMRO88RwtNWtb_g7E1VTe7SyEdpgfo0FMKE-Q7cpfe5NVNKHFl-yQDgZm77O8KcpFOazOgzpo_hQwDORVXTkhJRF9CXMgZCGWyG1R6-0Kwrziwg3Gk9bSw/s1600/program+for+prime+numbers.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;139&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2boNgl15GZ0Ouqjvlr31oJmMRO88RwtNWtb_g7E1VTe7SyEdpgfo0FMKE-Q7cpfe5NVNKHFl-yQDgZm77O8KcpFOazOgzpo_hQwDORVXTkhJRF9CXMgZCGWyG1R6-0Kwrziwg3Gk9bSw/s640/program+for+prime+numbers.png&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Tags: bluej program to find the prime numbers between 100 to 1000, prime numbers for a given range.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/2587430213957525269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/java-program-for-producing-prime.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/2587430213957525269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/2587430213957525269'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/java-program-for-producing-prime.html' title='Java program for producing prime numbers for given range'/><author><name>harshit0215</name><uri>http://www.blogger.com/profile/14492301040519656714</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2boNgl15GZ0Ouqjvlr31oJmMRO88RwtNWtb_g7E1VTe7SyEdpgfo0FMKE-Q7cpfe5NVNKHFl-yQDgZm77O8KcpFOazOgzpo_hQwDORVXTkhJRF9CXMgZCGWyG1R6-0Kwrziwg3Gk9bSw/s72-c/program+for+prime+numbers.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-2235813682735098461</id><published>2012-11-15T08:54:00.001-08:00</published><updated>2013-03-29T20:49:44.826-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blue J"/><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><title type='text'>Program to find difference between two dates java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Java program to find out the number of days elapsed between two dates.&lt;br /&gt;Java program to find out the difference between two dates given as DD-MM-YY.&lt;/h4&gt;
import java.io.*;&lt;br /&gt;
class datedif&lt;br /&gt;
{&lt;br /&gt;
public static void main(String args[])throws IOException&lt;br /&gt;
{&lt;br /&gt;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); &lt;br /&gt;
System.out.println(&quot;enter the first date:&quot;);&lt;br /&gt;
System.out.print(&quot;enter the days=&quot;);&lt;br /&gt;
int d1=Integer.parseInt(br.readLine());&lt;br /&gt;
System.out.print(&quot;enter the month=&quot;);&lt;br /&gt;
int m1=Integer.parseInt(br.readLine());&lt;br /&gt;
System.out.print(&quot;enter the year=&quot;);&lt;br /&gt;
int y1=Integer.parseInt(br.readLine());&lt;br /&gt;
System.out.println(&quot;enter the second date coming after the first date:&quot;);&lt;br /&gt;
System.out.print(&quot;enter the days=&quot;);&lt;br /&gt;
int d2=Integer.parseInt(br.readLine());&lt;br /&gt;
System.out.print(&quot;enter the month=&quot;);&lt;br /&gt;
int m2=Integer.parseInt(br.readLine());&lt;br /&gt;
System.out.print(&quot;enter the year=&quot;);&lt;br /&gt;
int y2=Integer.parseInt(br.readLine());&lt;br /&gt;
int c,i,j,t=0;&lt;br /&gt;
int a[]={31,29,31,30,31,30,31,31,30,31,30,31};&lt;br /&gt;
int b[]={31,28,31,30,31,30,31,31,30,31,30,31};&lt;br /&gt;
c=y2-y1;&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&amp;lt;c;i++)&lt;br /&gt;
{&lt;br /&gt;
for(j=m2-1;j&amp;gt;=0;j--)&lt;br /&gt;
{&lt;br /&gt;
if(y2%4==0)&lt;br /&gt;
t+=a[j];&lt;br /&gt;
else&lt;br /&gt;
t+=b[j];&lt;br /&gt;
}&lt;br /&gt;
m2=12;&lt;br /&gt;
}&lt;br /&gt;
for(i=m2-1;i&amp;gt;=m1;i--)&lt;br /&gt;
{&lt;br /&gt;
if(y1%4==0)&lt;br /&gt;
t+=a[i];&lt;br /&gt;
else&lt;br /&gt;
t+=b[i];&lt;br /&gt;
}&lt;br /&gt;
t+=(d2-d1);&lt;br /&gt;
System.out.println(&quot;number of days elapsed between two dates=&quot;+t);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
OUTPUT:&lt;/h4&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;color: black; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiShnbvAGM7bTaXnv2vHVlzz2qoJ-uzKwZZ2QVFe5r_K9JhZAntZvf_Fw543sAmltPwtr_d1OkzVAgHfmMoZqX232hKjRgrtbzwcmCFWG6M0oGa4rutGNeXap3ID_hEVzxWV11nRKwTuVc/s1600/DATEDIFFERENCE.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;178&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiShnbvAGM7bTaXnv2vHVlzz2qoJ-uzKwZZ2QVFe5r_K9JhZAntZvf_Fw543sAmltPwtr_d1OkzVAgHfmMoZqX232hKjRgrtbzwcmCFWG6M0oGa4rutGNeXap3ID_hEVzxWV11nRKwTuVc/s400/DATEDIFFERENCE.jpg&quot; title=&quot;&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Tags: program to find out the difference between two dates in java / bluej / c.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/2235813682735098461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/java-program-to-find-difference-between.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/2235813682735098461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/2235813682735098461'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/java-program-to-find-difference-between.html' title='Program to find difference between two dates java'/><author><name>harshit0215</name><uri>http://www.blogger.com/profile/14492301040519656714</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiShnbvAGM7bTaXnv2vHVlzz2qoJ-uzKwZZ2QVFe5r_K9JhZAntZvf_Fw543sAmltPwtr_d1OkzVAgHfmMoZqX232hKjRgrtbzwcmCFWG6M0oGa4rutGNeXap3ID_hEVzxWV11nRKwTuVc/s72-c/DATEDIFFERENCE.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-2031995086401256025</id><published>2012-11-15T07:54:00.002-08:00</published><updated>2012-11-15T07:54:56.711-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blue J"/><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><category scheme="http://www.blogger.com/atom/ns#" term="Pattern Making"/><title type='text'>Java program for string in circular fashion.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Write a program to input any string and output it in the following format:&lt;/span&gt;&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;hello&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;elloh&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;llohe&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;lohel&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;ohell&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;class circularstring&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;public static void main(String args[])&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;String str=args[0],p,s=&quot;&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;int i,j;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;for(i=0;i&amp;lt;str.length();i++)&lt;br /&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;p=str.substring(i,l);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;s=str.substring(0,i);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;System.out.println(p+s);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;OUTPUT:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;hello&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;elloh&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;llohe&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;lohel&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;ohell&lt;/span&gt;&lt;/div&gt;
&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;i&gt;Tags: java program for circular string, bluej program for circulating the string in each line, program for string in round robin fashion.&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/2031995086401256025/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/java-program-for-string-in-circular.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/2031995086401256025'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/2031995086401256025'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/java-program-for-string-in-circular.html' title='Java program for string in circular fashion.'/><author><name>harshit0215</name><uri>http://www.blogger.com/profile/14492301040519656714</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-9013095086868243255</id><published>2012-11-07T08:48:00.003-08:00</published><updated>2012-11-07T09:12:59.060-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><title type='text'>C Program for Binary Search Tree (BST)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
This is a c program for Binary search tree. In a BST smaller element is the left child and larger element is the right child.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
DOWNLOAD THE .C FILE OF BST USING THIS LINK:- &lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;http://ideone.com/plain/icvIC&quot; rel=&quot;nofollow&quot;&gt;&lt;span style=&quot;color: red; font-size: large;&quot;&gt;C program for binary search tree(bst)&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;OUTPUT:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnd6cCQmZy-cFIH6w4R-RcXef5V79GEbd4lfMGBX4qbwxsRKMEQ0yePx2PrdVptSsFnq8wrFMhm8o1DAX1s2cTzE9Y192uCMpkXxOC9x_qjwPqJW-WGU8KSdHUcSuMmD7g3lAbr3LlKCg/s1600/Untitled.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnd6cCQmZy-cFIH6w4R-RcXef5V79GEbd4lfMGBX4qbwxsRKMEQ0yePx2PrdVptSsFnq8wrFMhm8o1DAX1s2cTzE9Y192uCMpkXxOC9x_qjwPqJW-WGU8KSdHUcSuMmD7g3lAbr3LlKCg/s400/Untitled.jpg&quot; width=&quot;305&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Tags: &amp;nbsp;c program for bst, c program for binary search tree.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/9013095086868243255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/c-program-for-binary-search-tree-bst.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/9013095086868243255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/9013095086868243255'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/c-program-for-binary-search-tree-bst.html' title='C Program for Binary Search Tree (BST)'/><author><name>harshit0215</name><uri>http://www.blogger.com/profile/14492301040519656714</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnd6cCQmZy-cFIH6w4R-RcXef5V79GEbd4lfMGBX4qbwxsRKMEQ0yePx2PrdVptSsFnq8wrFMhm8o1DAX1s2cTzE9Y192uCMpkXxOC9x_qjwPqJW-WGU8KSdHUcSuMmD7g3lAbr3LlKCg/s72-c/Untitled.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-5092087300922578942</id><published>2012-11-07T06:13:00.001-08:00</published><updated>2012-11-07T06:25:02.432-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><title type='text'>C Program for Priority Heap</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;void maxheapify(int [],int,int);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;void buildmaxheap(int arr[],int n)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;int i;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;for(i=n/2;i&amp;gt;=1;i--)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;maxheapify(arr,i,n);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;void maxheapify(int arr[],int i,int n)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;int l,r,largest,temp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;l=2*i;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;r=(2*i)+1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;if(l&amp;lt;=n&amp;amp;&amp;amp;arr[l]&amp;gt;arr[i])&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;largest=l;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;largest=i;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;if(r&amp;lt;=n&amp;amp;&amp;amp;arr[r]&amp;gt;arr[largest])&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;largest=r;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;if(largest!=i)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;temp=arr[i];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;arr[i]=arr[largest];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;arr[largest]=temp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;maxheapify(arr,largest,n);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;int heapmaximum(int arr[])&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;return arr[1];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;int heapextractmax(int arr[], int n)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;int max;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;if(n&amp;lt;1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;printf(&quot;\nHeap Underflow&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;return -1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;max=arr[1];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;arr[1]=arr[n];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;n=n-1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;maxheapify(arr,1,n);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;return max;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;void heapincreasekey(int arr[],int i,int
key)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{int temp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;if (key&amp;lt;=arr[i])&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;printf(&quot;\nThevalue of key is Less
Than Or Equal To Existing Key&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;arr[i]=key;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;while(i&amp;gt;1&amp;amp;&amp;amp;arr[i/2]&amp;lt;arr[i])&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;temp=arr[i];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;arr[i]=arr[i/2];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;arr[i/2]=temp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;i=i/2;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;void maxheapinsert(int arr[],int key,int
n)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;arr[n]=-100;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;heapincreasekey(arr,n,key);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;void main()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;int i,n,arr[50],cho,max,key;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;clrscr();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;printf(&quot;\nEnterThe Size Of
Array&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;scanf(&quot;%d&quot;,&amp;amp;n);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;for(i=1;i&amp;lt;=n;i++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;printf(&quot;\nEnter The Element
%d\n&quot;,i);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;scanf(&quot;%d&quot;,&amp;amp;arr[i]);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;buildmaxheap(arr,n);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;printf(&quot;\nEnter Your Choice&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;printf(&quot;\n1. Heap Maximum&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;printf(&quot;\n2. Heap Extract
Max&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;printf(&quot;\n3. Heap Increase
Key&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;printf(&quot;\n4. Max Heap
Insert\n&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;scanf(&quot;%d&quot;,&amp;amp;cho);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;switch(cho)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;case 1:max=heapmaximum(arr);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
printf(&quot;\nMaximum Element= %d&quot;,max);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;case 2:max=heapextractmax(arr,n);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
n=n-1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
printf(&quot;\n Maximum Element Extracted Is= %d&quot;,max);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
printf(&quot;\nAfter Extracting Array Is&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
for(i=1;i&amp;lt;=n;i++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
printf(&quot;\n%d&quot;,arr[i]);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;case 3:printf(&quot;\nEnterThe Value Of
Key&amp;nbsp; &quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
scanf(&quot;\n%d&quot;,&amp;amp;key);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
printf(&quot;\nEnter The Value Of Index&amp;nbsp;
&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
scanf(&quot;%d&quot;,&amp;amp;i);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
heapincreasekey(arr,i,key);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
printf(&quot;\nAfter Increasing Key Array Is&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
for(i=1;i&amp;lt;=n;i++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
printf(&quot;\n%d&quot;,arr[i]);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;case 4:printf(&quot;\Enter The Value Of
Key&amp;nbsp; &quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
scanf(&quot;%d&quot;,&amp;amp;key);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
n=n+1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
maxheapinsert(arr,key,n);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
printf(&quot;\nAfter Inserting Array Is&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
for(i=1;i&amp;lt;=n;i++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
printf(&quot;\n%d&quot;,arr[i]);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;getch();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;OUTPUT:&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj929Y57SdBh9wNiq5pwzwkotLmy9-SqgTClgEPV_M-MEoTtA4kfffgej6lsR_YtHq6ys4P2QjI3p2hnuo7dXRMSy4LxYGsYReFOCZTy19l5l6aJ3Rkfdw6CgdBXYMaX8zmFWizooXenjM/s1600/image009.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj929Y57SdBh9wNiq5pwzwkotLmy9-SqgTClgEPV_M-MEoTtA4kfffgej6lsR_YtHq6ys4P2QjI3p2hnuo7dXRMSy4LxYGsYReFOCZTy19l5l6aJ3Rkfdw6CgdBXYMaX8zmFWizooXenjM/s1600/image009.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinR16VXRXLIhI2Wa1dbkvd8U_IE6mgfHvS2ekSYaQcvBrU_J1uQ1B8bzYW5UivdCDKWO5VrEswr4gxZHkQ_n_kOmgHGGPUXApC5CV4KzjkiryEZRooIZgwTroTrD_8bwwb3gYxpUgqr20/s1600/image008.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinR16VXRXLIhI2Wa1dbkvd8U_IE6mgfHvS2ekSYaQcvBrU_J1uQ1B8bzYW5UivdCDKWO5VrEswr4gxZHkQ_n_kOmgHGGPUXApC5CV4KzjkiryEZRooIZgwTroTrD_8bwwb3gYxpUgqr20/s1600/image008.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDXUTHNLAgiko_gkBOrNk87HsCfbpEZOnoWUm2KE-d9R0xfPtCW0g3fjpX-2rDXY2vmfBVxpEOOQTIcwIzvAj-9TfhymUJ1s7C6jjVwoqhjwdfXLkkvAhse3pbNUhEDKqKA9HbNmReJU4/s1600/image010.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDXUTHNLAgiko_gkBOrNk87HsCfbpEZOnoWUm2KE-d9R0xfPtCW0g3fjpX-2rDXY2vmfBVxpEOOQTIcwIzvAj-9TfhymUJ1s7C6jjVwoqhjwdfXLkkvAhse3pbNUhEDKqKA9HbNmReJU4/s1600/image010.jpg&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
Tags: c program for priority heap, priority heap sort program in c, program for priority heap in c&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/5092087300922578942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/c-program-for-priority-heap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/5092087300922578942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/5092087300922578942'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/c-program-for-priority-heap.html' title='C Program for Priority Heap'/><author><name>harshit0215</name><uri>http://www.blogger.com/profile/14492301040519656714</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj929Y57SdBh9wNiq5pwzwkotLmy9-SqgTClgEPV_M-MEoTtA4kfffgej6lsR_YtHq6ys4P2QjI3p2hnuo7dXRMSy4LxYGsYReFOCZTy19l5l6aJ3Rkfdw6CgdBXYMaX8zmFWizooXenjM/s72-c/image009.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-931879719614868920</id><published>2012-11-06T10:42:00.001-08:00</published><updated>2013-04-20T09:19:05.399-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="MST"/><title type='text'>C program for Kruskal Algorithm</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Kruskals Algorithm is used to find minimum spanning tree in a connected weighted graph. Kruskal algorithm is a greedy algorithm that finds the minimum cost to traverse every node of a tree. Here is a c program for kruskals algorithm that will tell you the edges selected and the minimum cost too.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;!--[if gte vml 1]&gt;&lt;v:shapetype
 id=&quot;_x0000_t75&quot; coordsize=&quot;21600,21600&quot; o:spt=&quot;75&quot; o:preferrelative=&quot;t&quot;
 path=&quot;m@4@5l@4@11@9@11@9@5xe&quot; filled=&quot;f&quot; stroked=&quot;f&quot;&gt;
 &lt;v:stroke joinstyle=&quot;miter&quot;/&gt;
 &lt;v:formulas&gt;
  &lt;v:f eqn=&quot;if lineDrawn pixelLineWidth 0&quot;/&gt;
  &lt;v:f eqn=&quot;sum @0 1 0&quot;/&gt;
  &lt;v:f eqn=&quot;sum 0 0 @1&quot;/&gt;
  &lt;v:f eqn=&quot;prod @2 1 2&quot;/&gt;
  &lt;v:f eqn=&quot;prod @3 21600 pixelWidth&quot;/&gt;
  &lt;v:f eqn=&quot;prod @3 21600 pixelHeight&quot;/&gt;
  &lt;v:f eqn=&quot;sum @0 0 1&quot;/&gt;
  &lt;v:f eqn=&quot;prod @6 1 2&quot;/&gt;
  &lt;v:f eqn=&quot;prod @7 21600 pixelWidth&quot;/&gt;
  &lt;v:f eqn=&quot;sum @8 21600 0&quot;/&gt;
  &lt;v:f eqn=&quot;prod @7 21600 pixelHeight&quot;/&gt;
  &lt;v:f eqn=&quot;sum @10 21600 0&quot;/&gt;
 &lt;/v:formulas&gt;
 &lt;v:path o:extrusionok=&quot;f&quot; gradientshapeok=&quot;t&quot; o:connecttype=&quot;rect&quot;/&gt;
 &lt;o:lock v:ext=&quot;edit&quot; aspectratio=&quot;t&quot;/&gt;
&lt;/v:shapetype&gt;&lt;v:shape id=&quot;Picture_x0020_10&quot; o:spid=&quot;_x0000_s1026&quot; type=&quot;#_x0000_t75&quot;
 style=&#39;position:absolute;margin-left:199.7pt;margin-top:15pt;width:237.8pt;
 height:358.65pt;z-index:1;visibility:visible;mso-wrap-style:square;
 mso-wrap-distance-left:9pt;mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;
 mso-wrap-distance-bottom:0;mso-position-horizontal:absolute;
 mso-position-horizontal-relative:text;mso-position-vertical:absolute;
 mso-position-vertical-relative:text&#39; wrapcoords=&quot;-136 0 -136 21501 21664 21501 21664 0 -136 0&quot;&gt;
 &lt;v:imagedata src=&quot;file:///E:\Users\PRAVEEN\AppData\Local\Temp\msohtmlclip1\01\clip_image001.jpg&quot;
  o:title=&quot;kruskal&quot;/&gt;
 &lt;w:wrap type=&quot;through&quot;/&gt;
&lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;!--[endif]--&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;#include&amp;lt;stdio.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;#define INF 1000&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;char vertex[10];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;int wght[10][10];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;int span_wght[10][10];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;int source;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;struct Sort&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;int v1,v2;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;int weight;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;}que[20];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;int n,ed,f,r;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;int cycle(int s,int d)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;int j,k;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;if(source==d)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;return 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;for(j=0;j&amp;lt;n;j++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;if(span_wght[d][j]!=INF
&amp;amp;&amp;amp; s!=j)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;if(cycle(d,j))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;return 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;return 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;void build_tree()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;int i,j,w,k,count=0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;for(count=0;count&amp;lt;n;f++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;i=que[f].v1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;j=que[f].v2;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;w=que[f].weight;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;span_wght[i][j]=span_wght[j][i]=w;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;source=i;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;k=cycle(i,j);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;if(k)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;span_wght[i][j]=span_wght[j][i]=INF;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;count++;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;void swap(int *i,int *j)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;int t;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;t=*i;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;*i=*j;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;*j=t;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;void main()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;int i,j,k=0,temp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;int sum=0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;clrscr();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;printf(&quot;\tKRUSKAL&#39;S
ALGORITHM TO FIND SPANNING TREE\n&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;printf(&quot;\n\tEnter the No. of
Nodes : &quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;scanf(&quot;%d&quot;,&amp;amp;n);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;for(i=0;i&amp;lt;n;i++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;vertex[i]=i+1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;for(j=0;j&amp;lt;n;j++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;wght[i][j]=INF;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;span_wght[i][j]=INF;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;printf(&quot;Getting
Weight\n&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;for(i=0;i&amp;lt;n;i++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;for(j=i+1;j&amp;lt;n;j++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;printf(&quot;Enter 0 if path
Doesn&#39;t exist between %d to %d : &quot;,vertex[i],vertex[j]);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;scanf(&quot;%d&quot;,&amp;amp;ed);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;if(ed&amp;gt;=1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;wght[i][j]=wght[j][i]=ed;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;que[r].v1=i;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;que[r].v2=j;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;que[r].weight=wght[i][j];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;if(r)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;for(k=0;k&amp;lt;r;k++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;if(que[k].weight&amp;gt;que[r].weight)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;swap(&amp;amp;que[k].weight,&amp;amp;que[r].weight);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;swap(&amp;amp;que[k].v1,&amp;amp;que[r].v1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;swap(&amp;amp;que[k].v2,&amp;amp;que[r].v2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;r++;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;//clrscr();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;printf(&quot;\n\tORIGINAL GRAPH
WEIGHT MATRIX\n\n&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;printf(&quot;\n\tweight
matrix\n\n\t&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;for(i=0;i&amp;lt;n;i++,printf(&quot;\n\t&quot;))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;for(j=0;j&amp;lt;n;j++,printf(&quot;\t&quot;))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;printf(&quot;%d&quot;,wght[i][j]);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;build_tree();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;printf(&quot;\n\n\t\tMINIMUM
SPANNING TREE\n\n&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;printf(&quot;\n\t\tLIST OF
EDGES\n\n&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;for(i=0;i&amp;lt;n;i++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;for(j=i+1;j&amp;lt;n;j++)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;if(span_wght[i][j]!=INF)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;printf(&quot;\n\t\t%d ------ %d =
%d &quot;,vertex[i],vertex[j],span_wght[i][j]);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;sum+=span_wght[i][j];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;printf(&quot;\n\n\t\tTotal Weight
: %d &quot;,sum);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;getch();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;OUTPUT&lt;/span&gt;&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=3473077794025186772&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgawob4tuwOXblMSS3d6Ibw5egwX3FPz_aqy1FkpmJmUM9Qj_TWnvTKrN_YIhlBfsuhhTzD6D6w31kZhCYGoKZdr_P8sG3ypfRLwYj1yLT3-dSqwnoZjWIXE2JrFBI60siTWauSjrKEvAmk/s1600/kruskal.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;kruskals algorithm&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgawob4tuwOXblMSS3d6Ibw5egwX3FPz_aqy1FkpmJmUM9Qj_TWnvTKrN_YIhlBfsuhhTzD6D6w31kZhCYGoKZdr_P8sG3ypfRLwYj1yLT3-dSqwnoZjWIXE2JrFBI60siTWauSjrKEvAmk/s1600/kruskal.JPG&quot; title=&quot;c program for kruskal&#39;s algorithm&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;i&gt;Tags: Program to implement Kruskal Algorithm, MST using Kruskal Algorithm, C program for Kruskal Algorithm&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/931879719614868920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/c-program-for-kruskal-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/931879719614868920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/931879719614868920'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/c-program-for-kruskal-algorithm.html' title='C program for Kruskal Algorithm'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgawob4tuwOXblMSS3d6Ibw5egwX3FPz_aqy1FkpmJmUM9Qj_TWnvTKrN_YIhlBfsuhhTzD6D6w31kZhCYGoKZdr_P8sG3ypfRLwYj1yLT3-dSqwnoZjWIXE2JrFBI60siTWauSjrKEvAmk/s72-c/kruskal.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-7402169008093466010</id><published>2012-11-06T08:01:00.002-08:00</published><updated>2012-11-06T22:36:33.422-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="Sorting"/><title type='text'>Program for Heap sort in C Language</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
void maxheap(int [],int,int);&lt;br /&gt;
void buildmaxheap(int a[],int n)&lt;br /&gt;
{&lt;br /&gt;
int i;&lt;br /&gt;
for(i=n/2;i&amp;gt;=1;i--)&lt;br /&gt;
{&lt;br /&gt;
maxheap(a,i,n);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
void maxheap(int a[],int i,int n)&lt;br /&gt;
{&lt;br /&gt;
int R,L,largest,t;&lt;br /&gt;
L=2*i;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
R=2*i+1;&lt;br /&gt;
if((L&amp;lt;=n) &amp;amp;&amp;amp; (a[L]&amp;gt;a[i]))&lt;br /&gt;
largest=L;&lt;br /&gt;
else&lt;br /&gt;
largest=i;&lt;br /&gt;
if((R&amp;lt;=n) &amp;amp;&amp;amp; (a[i]&amp;gt;a[largest]))&lt;br /&gt;
largest=R;&lt;br /&gt;
if(largest!=i)&lt;br /&gt;
{&lt;br /&gt;
t=a[i];&lt;br /&gt;
a[i]=a[largest];&lt;br /&gt;
a[largest]=t;&lt;br /&gt;
maxheap(a,largest,n);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
void heapsort(int a[],int n)&lt;br /&gt;
{&lt;br /&gt;
int i,temp;&lt;br /&gt;
buildmaxheap(a,n);&lt;br /&gt;
for(i=n;i&amp;gt;=2;i--)&lt;br /&gt;
{&lt;br /&gt;
temp=a[1];&lt;br /&gt;
a[1]=a[i];&lt;br /&gt;
a[i]=temp;&lt;br /&gt;
maxheap(a,1,i-1);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
int a[50],i,n;&lt;br /&gt;
clrscr();&lt;br /&gt;
printf(&quot;Enter the size of array : &quot;);&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;n);&lt;br /&gt;
printf(&quot;Enter the elements of array \n&quot;);&lt;br /&gt;
for(i=1;i&amp;lt;=n;i++)&lt;br /&gt;
{&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;a[i]);&lt;br /&gt;
}&lt;br /&gt;
heapsort(a,n);&lt;br /&gt;
printf(&quot;sorted array is \n&quot;);&lt;br /&gt;
for(i=1;i&amp;lt;=n;i++)&lt;br /&gt;
{&lt;br /&gt;
printf(&quot;%d\t&quot;,a[i]);&lt;br /&gt;
}&lt;br /&gt;
getch();&lt;br /&gt;
}&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/7402169008093466010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/program-for-heap-sort-in-c-language.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/7402169008093466010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/7402169008093466010'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/program-for-heap-sort-in-c-language.html' title='Program for Heap sort in C Language'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-8167978370642299770</id><published>2012-11-06T07:59:00.004-08:00</published><updated>2012-11-06T08:00:54.726-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="MST"/><title type='text'>C program for Prim&#39;s Algorithm</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
#define IN 99&lt;br /&gt;
int dist[10],path[10];&lt;br /&gt;
int extract_min(int Q[], int n)&lt;br /&gt;
{&lt;br /&gt;
int i,temp[10],t=0,pos;&lt;br /&gt;
for(i=0;i&amp;lt;n;i++)&lt;br /&gt;
{&lt;br /&gt;
if(Q[i]!=-1)&lt;br /&gt;
temp[i]=1;&lt;br /&gt;
else&lt;br /&gt;
temp[i]=0;&lt;br /&gt;
}&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
for(i=0;i&amp;lt;n;i++)&lt;br /&gt;
{&lt;br /&gt;
if(t==0 &amp;amp;&amp;amp; temp[i]==1)&lt;br /&gt;
{pos =i;&lt;br /&gt;
t=1;&lt;br /&gt;
continue;&lt;br /&gt;
}&lt;br /&gt;
if(temp[i]==1)&lt;br /&gt;
if(dist[i]&amp;lt;dist[pos])&lt;br /&gt;
pos=i;&lt;br /&gt;
}&lt;br /&gt;
return pos;&lt;br /&gt;
}&lt;br /&gt;
int contain(int Q[],int v,int n)&lt;br /&gt;
{&lt;br /&gt;
int i;&lt;br /&gt;
for(i=0;i&amp;lt;n;i++)&lt;br /&gt;
if(Q[i]==v+1)&lt;br /&gt;
return 1;&lt;br /&gt;
return 0;&lt;br /&gt;
}&lt;br /&gt;
int isempty(int Q[], int n)&lt;br /&gt;
{&lt;br /&gt;
int i;&lt;br /&gt;
for(i=0;i&amp;lt;n;i++)&lt;br /&gt;
{&lt;br /&gt;
if(Q[i]!=-1)&lt;br /&gt;
return 0;&lt;br /&gt;
}&lt;br /&gt;
return 1;&lt;br /&gt;
}&lt;br /&gt;
void initialize(int n,int s)&lt;br /&gt;
{&lt;br /&gt;
int i;&lt;br /&gt;
for(i=0;i&amp;lt;n;i++)&lt;br /&gt;
{&lt;br /&gt;
dist[i]=IN;&lt;br /&gt;
path[i]=-1;&lt;br /&gt;
}&lt;br /&gt;
dist[s]=0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//Module which implement prim algorithm&lt;br /&gt;
&lt;br /&gt;
void prim(int edge[10][10],int n,int s)&lt;br /&gt;
{&lt;br /&gt;
int Q[10],i,u,v,alt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//Initialization step&lt;br /&gt;
&lt;br /&gt;
initialize(n,s);&lt;br /&gt;
for(i=0;i&amp;lt;n;i++)&lt;br /&gt;
Q[i]=i+1;&lt;br /&gt;
while(isempty(Q,n)==0)&lt;br /&gt;
{&lt;br /&gt;
u=extract_min(Q,n);&lt;br /&gt;
Q[u]=-1;&lt;br /&gt;
if(dist[u]==IN)&lt;br /&gt;
break;&lt;br /&gt;
for(i=0;i&amp;lt;n;i++)&lt;br /&gt;
{&lt;br /&gt;
if(edge[u][i]!=0 &amp;amp;&amp;amp; edge[u][i]!=IN)&lt;br /&gt;
{&lt;br /&gt;
v=i;&lt;br /&gt;
if(edge[u][i]&amp;lt;dist[v] &amp;amp;&amp;amp; contain(Q,v,n)==1)&lt;br /&gt;
{&lt;br /&gt;
dist[v]=edge[u][i];&lt;br /&gt;
path[v]=u+1;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
int n,edge[10][10],i,j,s,t,wt=0;&lt;br /&gt;
clrscr();&lt;br /&gt;
printf(&quot;Enter total number of vertices&quot;);&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;n);&lt;br /&gt;
&lt;br /&gt;
//printf(&quot;\nEnter Edge matrix in row major order&quot;);&lt;br /&gt;
&lt;br /&gt;
printf(&quot;: &amp;nbsp;Enter 99 for Infinity\n&quot;);&lt;br /&gt;
for(i=0;i&amp;lt;n;i++)&lt;br /&gt;
{&lt;br /&gt;
for(j=i+1;j&amp;lt;n;j++)&lt;br /&gt;
{&lt;br /&gt;
printf(&quot;Enter the edge between %d and %d: &quot;,i+1,j+1);&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;edge[i][j]);&lt;br /&gt;
edge[j][i]=edge[i][j];&lt;br /&gt;
}&lt;br /&gt;
edge[i][i]=0;&lt;br /&gt;
}&lt;br /&gt;
printf(&quot;\n&quot;);&lt;br /&gt;
printf(&quot;Enter the source for MST: &quot;);&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;s);&lt;br /&gt;
prim(edge,n,s-1);&lt;br /&gt;
printf(&quot;\nPATH OF MINIMUM SPANNING TREE is\n&quot;);&lt;br /&gt;
for(i=0;i&amp;lt;n;i++)&lt;br /&gt;
{&lt;br /&gt;
if(s-1==i)&lt;br /&gt;
continue;&lt;br /&gt;
if(dist[i]==IN)&lt;br /&gt;
{&lt;br /&gt;
printf(&quot;PATH from %d to %d not exist\n&quot;,i+1,s);&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
printf(&quot;PATH from %d to %d is %d:&quot;,i+1,s,i+1);&lt;br /&gt;
t=i;&lt;br /&gt;
for(j=1;j&amp;lt;n;j++)&lt;br /&gt;
{&lt;br /&gt;
printf(&quot;&amp;lt;--%d&quot;,path[t]);&lt;br /&gt;
if(path[t]==s)&lt;br /&gt;
break;&lt;br /&gt;
t=path[t]-1;&lt;br /&gt;
}&lt;br /&gt;
printf(&quot;\n&quot;);&lt;br /&gt;
}&lt;br /&gt;
wt+=dist[i];&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
printf(&quot;\nMinimum Weight of a Graph is %d&quot;,wt);&lt;br /&gt;
getch();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
OUTPUT&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkes0302X3nrKONrFc7D_4uTxWQG_gyOU9uhCt0Ad2YtGO9hTHHZm4__if7SLlVObAmJHWG3z4KDLOI-TVmYWktHec9OmIoi8n0CwLFPB3RZ39Gtwpu-awiZbUtOKr-YNu74x2CfEkM9Pf/s1600/prim.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkes0302X3nrKONrFc7D_4uTxWQG_gyOU9uhCt0Ad2YtGO9hTHHZm4__if7SLlVObAmJHWG3z4KDLOI-TVmYWktHec9OmIoi8n0CwLFPB3RZ39Gtwpu-awiZbUtOKr-YNu74x2CfEkM9Pf/s320/prim.JPG&quot; width=&quot;267&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;i&gt;Tags: Prim&#39;s algorithm implementation, C program for Prim&#39;s algorithm, Minimum Spanning Tree , algorithm to find Minimum Spanning Tree&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/8167978370642299770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/c-program-for-prims-algorithm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/8167978370642299770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/8167978370642299770'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/c-program-for-prims-algorithm.html' title='C program for Prim&#39;s Algorithm'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkes0302X3nrKONrFc7D_4uTxWQG_gyOU9uhCt0Ad2YtGO9hTHHZm4__if7SLlVObAmJHWG3z4KDLOI-TVmYWktHec9OmIoi8n0CwLFPB3RZ39Gtwpu-awiZbUtOKr-YNu74x2CfEkM9Pf/s72-c/prim.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-4439187998049876942</id><published>2012-11-06T07:15:00.001-08:00</published><updated>2012-11-06T08:04:46.495-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="Sorting"/><title type='text'>Program for Merge Sort in C</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include&amp;lt;conio.h&amp;gt;&lt;br /&gt;
void mergesort(int [],int,int);&lt;br /&gt;
void merge(int [],int,int,int);&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
int ar[30],p,n,r,i;&lt;br /&gt;
clrscr();&lt;br /&gt;
printf(&quot;\n enter the size of array \n&quot;);&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;n);&lt;br /&gt;
printf(&quot;\n enter the values of array \n&quot;);&lt;br /&gt;
for(i=1;i&amp;lt;=n;i++)&lt;br /&gt;
{&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;ar[i]);&lt;br /&gt;
}&lt;br /&gt;
p=1;&lt;br /&gt;
r=n;&lt;br /&gt;
mergesort(ar,p,r);&lt;br /&gt;
printf(&quot;AFTER SORTING \n&quot;);&lt;br /&gt;
for(i=1;i&amp;lt;=r;i++)&lt;br /&gt;
{&lt;br /&gt;
printf(&quot;%d \n&quot;,ar[i]);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; }&lt;br /&gt;
getch();&lt;br /&gt;
}&lt;br /&gt;
void mergesort(int ar[],int p,int r)&lt;br /&gt;
{&lt;br /&gt;
int q;&lt;br /&gt;
if(p&amp;lt;r)&lt;br /&gt;
{&lt;br /&gt;
q=(p+r)/2;&lt;br /&gt;
mergesort(ar,p,q);&lt;br /&gt;
mergesort(ar,q+1,r);&lt;br /&gt;
merge(ar,p,q,r);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
void merge(int ar[30],int p,int q,int r)&lt;br /&gt;
{&lt;br /&gt;
int i,j,k,n1,n2;&lt;br /&gt;
int lar[30],rar[30];&lt;br /&gt;
n1=q-p+1;&lt;br /&gt;
n2=r-q;&lt;br /&gt;
for(i=1;i&amp;lt;=n1;i++)&lt;br /&gt;
&lt;br /&gt;
lar[i]=ar[p+i-1];&lt;br /&gt;
for(j=1;j&amp;lt;=n2;j++)&lt;br /&gt;
rar[j]=ar[q+j];&lt;br /&gt;
lar[n1+1]=32000;&lt;br /&gt;
rar[n2+1]=32000;&lt;br /&gt;
i=1;&lt;br /&gt;
j=1;&lt;br /&gt;
for(k=p;k&amp;lt;=r;k++)&lt;br /&gt;
{&lt;br /&gt;
if(lar[i]&amp;lt;=rar[j])&lt;br /&gt;
{&lt;br /&gt;
ar[k]=lar[i];&lt;br /&gt;
i++;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
ar[k]=rar[j];&lt;br /&gt;
j++;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/4439187998049876942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/merge-sort-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/4439187998049876942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/4439187998049876942'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/merge-sort-in-c.html' title='Program for Merge Sort in C'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-8049989000507945808</id><published>2012-11-05T09:29:00.001-08:00</published><updated>2012-11-05T09:36:49.024-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="Graphics"/><title type='text'>Draw a Line using Equation y=mx+c in C</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
#include&amp;lt;math.h&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
#include&amp;lt;graphics.h&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
void
draw_line(float,float,float,float);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
int
round(float);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
main()&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
{ int
driver,mode;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;float x1,y1,x2,y2;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;clrscr();&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;printf(&quot;Enter the two end-points of the
line:&quot;);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;printf(&quot;nx1 =&quot;);&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;scanf(&quot;%f&quot;,&amp;amp;x1);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;printf(&quot;y1 =&quot;);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;scanf(&quot;%f&quot;,&amp;amp;y1);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;printf(&quot;x2 =&quot;);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;scanf(&quot;%f&quot;,&amp;amp;x2);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;printf(&quot;y2 =&quot;);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;scanf(&quot;%f&quot;,&amp;amp;y2);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;clrscr();driver = DETECT;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;initgraph(&amp;amp;driver,&amp;amp;mode,&quot;c:\\tc\\bgi&quot;);
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;draw_line(x1,y1,x2,y2);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;getch();&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;closegraph();}&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
void
draw_line(float x1,float y1,float x2,float y2)&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
{ float m,c;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;float x,y;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;m = (y2 - y1)/(x2 - x1);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;c = y1 - m * x1;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;for(x = x1; x&amp;lt;x2; x++)&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y
= m * x + c;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y = round(y);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; putpixel(x,(int)y,EGA_WHITE);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }}&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
int
round(float x)&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
{&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;float temp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;int val = (x + 0.5);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp;return val;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
OUTPUT:&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsY-7u_sSjvw51TJcMiGlrjpCqUNok9jU1QD_fzHRruy_gJtSf_-t7bPA15pAUau_ToMbd4MMbY4CxEm0cSqCtoAJCMcjuE5zCG8DyHqrjzeVMPSH-S6lu1_TgR0B70S2wpEq_X9UlJ0v2/s1600/line.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;77&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsY-7u_sSjvw51TJcMiGlrjpCqUNok9jU1QD_fzHRruy_gJtSf_-t7bPA15pAUau_ToMbd4MMbY4CxEm0cSqCtoAJCMcjuE5zCG8DyHqrjzeVMPSH-S6lu1_TgR0B70S2wpEq_X9UlJ0v2/s320/line.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWlQG_lHWEoiMtcM0CUl11Npl723Yd1XIQqO8Jata6Z24are5M_fK1EcqELyNTNOZRqk58TKB0nVj2k9_nyPaPrgWZGSQWTDaqS4pdDkNPnnKeqnY4s9YiMnNC0tlfqNmce_VW_b6aiYa4/s1600/line+2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWlQG_lHWEoiMtcM0CUl11Npl723Yd1XIQqO8Jata6Z24are5M_fK1EcqELyNTNOZRqk58TKB0nVj2k9_nyPaPrgWZGSQWTDaqS4pdDkNPnnKeqnY4s9YiMnNC0tlfqNmce_VW_b6aiYa4/s1600/line+2.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;i&gt;Tags:Line Drawing algorithm, Draw line using its eqation, C Program for line drawing, Line drawing using y=mx+c&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/8049989000507945808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/draw-line-using-equation-ymxc-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/8049989000507945808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/8049989000507945808'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/draw-line-using-equation-ymxc-in-c.html' title='Draw a Line using Equation y=mx+c in C'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsY-7u_sSjvw51TJcMiGlrjpCqUNok9jU1QD_fzHRruy_gJtSf_-t7bPA15pAUau_ToMbd4MMbY4CxEm0cSqCtoAJCMcjuE5zCG8DyHqrjzeVMPSH-S6lu1_TgR0B70S2wpEq_X9UlJ0v2/s72-c/line.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-1666759187244483301</id><published>2012-11-05T09:26:00.001-08:00</published><updated>2012-11-05T09:26:10.626-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="Graphics"/><title type='text'>Draw Concentric Circle in C</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
#include&amp;lt;math.h&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
#include&amp;lt;graphics.h&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
void main()&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
{&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
int rc, rb,
xc, yc, i;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
float x,y;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
int
gd=DETECT, gm;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
initgraph(&amp;amp;gd,&amp;amp;gm,&quot;c:\\tc\\bgi&quot;);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
printf(&quot;enter
the radius of the outer circle \n&quot;);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
scanf(&quot;%d&quot;,&amp;amp;rc);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
printf(&quot;enter
the radius of the inner circle \n&quot;);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
scanf(&quot;%d&quot;,
&amp;amp;rb);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
printf(&quot;enter
the center of the circle&quot;);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
scanf(&quot;%d&quot;,&amp;amp;xc);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
scanf(&quot;%d&quot;,&amp;amp;yc);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
for(i=1;i&amp;lt;=360;i++)&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
{&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp; x=xc+(rb*(cos(i)));&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp; y=yc+(rb*(sin(i)));&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp; putpixel(x,y,7);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
for(i=1;i&amp;lt;=360;i++)&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
{&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp; x=xc+(rc*(cos(i)));&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp; y=yc+(rc*(sin(i)));&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp; putpixel(x,y,7);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp; getch();&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp; closegraph();&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
OUTPUT&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGq0K_eL8tqde6H_AO_43G6idBG-hJ_CQ0qmuaPkFVPshYqjgi_lSo2g8VeZq73Uxps25YJUmF50-Jeexi9hPKkuB3FvTLAClnwzF7Tq4YPhV62v0JA_CGzGtbfMuGLidXpzHyVNOK3HRq/s1600/conc.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGq0K_eL8tqde6H_AO_43G6idBG-hJ_CQ0qmuaPkFVPshYqjgi_lSo2g8VeZq73Uxps25YJUmF50-Jeexi9hPKkuB3FvTLAClnwzF7Tq4YPhV62v0JA_CGzGtbfMuGLidXpzHyVNOK3HRq/s1600/conc.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;i&gt;Tags: Cicrle drawing, concentric circles, how to draw concentric circle in C, program in C to draw Concentric Circle&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/1666759187244483301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/draw-concentric-circle-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/1666759187244483301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/1666759187244483301'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/draw-concentric-circle-in-c.html' title='Draw Concentric Circle in C'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGq0K_eL8tqde6H_AO_43G6idBG-hJ_CQ0qmuaPkFVPshYqjgi_lSo2g8VeZq73Uxps25YJUmF50-Jeexi9hPKkuB3FvTLAClnwzF7Tq4YPhV62v0JA_CGzGtbfMuGLidXpzHyVNOK3HRq/s72-c/conc.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-3513551930181152332</id><published>2012-11-05T09:21:00.002-08:00</published><updated>2012-11-16T08:22:37.430-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Animation"/><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="Graphics"/><title type='text'>C Program for Drawing a Scenery using Graphics</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
#include&amp;lt;graphics.h&amp;gt;&lt;br /&gt;
#include&amp;lt;math.h&amp;gt;&lt;br /&gt;
void tree(int t,int q)&lt;br /&gt;
{&lt;br /&gt;
int r=15;&lt;br /&gt;
&lt;br /&gt;
r=15;&lt;br /&gt;
setfillstyle(6,BROWN);&lt;br /&gt;
rectangle(150+t,390+q,170+t,340+q);&lt;br /&gt;
floodfill(151+t,342+q,2);&lt;br /&gt;
setfillstyle(11,GREEN);&lt;br /&gt;
fillellipse(142+t,347+q,r,r);&lt;br /&gt;
fillellipse(160+t,330+q,r,r);&lt;br /&gt;
fillellipse(175+t,340+q,r,r);&lt;br /&gt;
fillellipse(180+t,350+q,r,r);&lt;br /&gt;
}&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
int gd=DETECT,gm;&lt;br /&gt;
int i,j,k,t,q,r;&lt;br /&gt;
float x,y;&lt;br /&gt;
initgraph(&amp;amp;gd,&amp;amp;gm,&quot;c:\\tc\\bgi&quot;);&lt;br /&gt;
setcolor(2);&lt;br /&gt;
rectangle(0,0,getmaxx(),getmaxy());&lt;br /&gt;
for(i=0;i&amp;lt;getmaxx();i+=120)&lt;br /&gt;
{&lt;br /&gt;
line(i,250,i+60,170);&lt;br /&gt;
line(i+60,170,i+120,250);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
t=10;&lt;br /&gt;
line(0,400,getmaxx(),350);&lt;br /&gt;
B:line(50+t,280,50+t,320);&lt;br /&gt;
line(50+t,320,60+t,320);&lt;br /&gt;
line(60+t,320,70+t,320);&lt;br /&gt;
line(70+t,320,80+t,320);&lt;br /&gt;
line(130+t,320,80+t,320);&lt;br /&gt;
line(70+t,320,70+t,300);&lt;br /&gt;
line(60+t,300,60+t,320);&lt;br /&gt;
line(70+t,300,60+t,300);&lt;br /&gt;
line(80+t,320,80+t,280);&lt;br /&gt;
line(130+t,320,130+t,280);&lt;br /&gt;
line(80+t,280,130+t,280);&lt;br /&gt;
line(50+t,280,80+t,280);&lt;br /&gt;
line(50+t,280,65+t,260);&lt;br /&gt;
line(65+t,260,80+t,280);&lt;br /&gt;
line(65+t,260,110+t,260);&lt;br /&gt;
line(130+t,280,110+t,260);&lt;br /&gt;
setfillstyle(SOLID_FILL,DARKGRAY);&lt;br /&gt;
floodfill(51+t,282,2);&lt;br /&gt;
setfillstyle(SOLID_FILL,RED);&lt;br /&gt;
floodfill(61+t,302,2);&lt;br /&gt;
setfillstyle(SOLID_FILL,YELLOW);&lt;br /&gt;
floodfill(81+t,282,2);&lt;br /&gt;
setfillstyle(SOLID_FILL,MAGENTA);&lt;br /&gt;
floodfill(66+t,270,2);&lt;br /&gt;
setfillstyle(4,BROWN);&lt;br /&gt;
floodfill(100+t,270,2);&lt;br /&gt;
if(t==10)&lt;br /&gt;
{&lt;br /&gt;
t=320;&lt;br /&gt;
goto B;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
tree(0,-10);&lt;br /&gt;
tree(100,-20);&lt;br /&gt;
tree(30,-100);&lt;br /&gt;
tree(350,-60);&lt;br /&gt;
tree(160,-50);&lt;br /&gt;
//circle();&lt;br /&gt;
&lt;br /&gt;
setfillstyle(SOLID_FILL,12);&lt;br /&gt;
fillellipse(150,80,35,35);&lt;br /&gt;
&lt;br /&gt;
setfillstyle(2,LIGHTBLUE);&lt;br /&gt;
floodfill(10,10,2);&lt;br /&gt;
&lt;br /&gt;
setfillstyle(SOLID_FILL,CYAN);&lt;br /&gt;
floodfill(1,getmaxy()-1,2);&lt;br /&gt;
&lt;br /&gt;
setfillstyle(SOLID_FILL,LIGHTGREEN);&lt;br /&gt;
floodfill(49,270,2);&lt;br /&gt;
&lt;br /&gt;
//x=150;&lt;br /&gt;
//y=80;&lt;br /&gt;
for(i=36;i&amp;lt;80;i++)&lt;br /&gt;
for(j=0;j&amp;lt;=360;j+=10)&lt;br /&gt;
{&lt;br /&gt;
x=150+i*cos(((float)j*3.14)/180);&lt;br /&gt;
y=80+i*sin(((float)j*3.14)/180);&lt;br /&gt;
putpixel(x,y,LIGHTRED);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
getch();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
OUTPUT:&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxhp_N6vVPslFfcC5t0a5zSZ5UA-fYvRk5NZQjOBLdCKrKMnFa4OSXv8Kk5OTgBt9-wCLCYbtJKj4KsgdbBn5_qwufdBgf6ySyzfCSEj1aG_CX0SLpW2ZtnSGAgmWS7A4-dHXojNo9B-Iv/s1600/scenery.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxhp_N6vVPslFfcC5t0a5zSZ5UA-fYvRk5NZQjOBLdCKrKMnFa4OSXv8Kk5OTgBt9-wCLCYbtJKj4KsgdbBn5_qwufdBgf6ySyzfCSEj1aG_CX0SLpW2ZtnSGAgmWS7A4-dHXojNo9B-Iv/s1600/scenery.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;i&gt;Tags: Computer Graphics, Scenery Drawing using C, Graphics program, Pattern Filling using C, Boundary Fill, Scenery drawing program&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/3513551930181152332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/c-program-for-drawing-scenery-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/3513551930181152332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/3513551930181152332'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/c-program-for-drawing-scenery-using.html' title='C Program for Drawing a Scenery using Graphics'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxhp_N6vVPslFfcC5t0a5zSZ5UA-fYvRk5NZQjOBLdCKrKMnFa4OSXv8Kk5OTgBt9-wCLCYbtJKj4KsgdbBn5_qwufdBgf6ySyzfCSEj1aG_CX0SLpW2ZtnSGAgmWS7A4-dHXojNo9B-Iv/s72-c/scenery.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-9070057896994696637</id><published>2012-11-05T09:18:00.001-08:00</published><updated>2012-11-16T08:22:37.436-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Animation"/><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="Graphics"/><title type='text'>C Program for Sunrise Animation using Graphics</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
#include&amp;lt;graphics.h&amp;gt;&lt;br /&gt;
#include&amp;lt;math.h&amp;gt;&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
int gd=DETECT,gm;&lt;br /&gt;
int i,j,k,t,q;&lt;br /&gt;
float x,y;&lt;br /&gt;
initgraph(&amp;amp;gd,&amp;amp;gm,&quot;c:\\tc\\bgi&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
setcolor(2);&lt;br /&gt;
&lt;br /&gt;
rectangle(0,0,getmaxx(),getmaxy());&lt;br /&gt;
&amp;nbsp;setcolor(2);&lt;br /&gt;
&amp;nbsp;i=0;&lt;br /&gt;
for(t=0;t&amp;lt;getmaxx();t+=120)&lt;br /&gt;
{&lt;br /&gt;
line(t,250,t+60,170);&lt;br /&gt;
line(t+60,170,t+120,250);&lt;br /&gt;
}&lt;br /&gt;
line(0,400,getmaxx(),350);&lt;br /&gt;
setfillstyle(11,CYAN);&lt;br /&gt;
floodfill(2,420,2);&lt;br /&gt;
setfillstyle(4,LIGHTGREEN);&lt;br /&gt;
floodfill(1,300,2);&lt;br /&gt;
&lt;br /&gt;
i=0;&lt;br /&gt;
while(i!=150)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
setcolor(BLACK);&lt;br /&gt;
setfillstyle(SOLID_FILL,BLACK);&lt;br /&gt;
fillellipse(k,j,30,30);&lt;br /&gt;
setfillstyle(SOLID_FILL,LIGHTRED);&lt;br /&gt;
fillellipse(170+i,235-i,30,30);&lt;br /&gt;
j=235-i;&lt;br /&gt;
k=170+i;&lt;br /&gt;
i++;&lt;br /&gt;
setcolor(2);&lt;br /&gt;
for(t=0;t&amp;lt;getmaxx();t+=120)&lt;br /&gt;
{&lt;br /&gt;
line(t,250,t+60,170);&lt;br /&gt;
line(t+60,170,t+120,250);&lt;br /&gt;
}&lt;br /&gt;
setfillstyle(1,GREEN);&lt;br /&gt;
floodfill(202,200,GREEN);&lt;br /&gt;
delay(25);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
for(i=36;i&amp;lt;80;i++)&lt;br /&gt;
for(j=0;j&amp;lt;=360;j+=20)&lt;br /&gt;
{&lt;br /&gt;
x=319+i*cos(((float)j*3.14)/180);&lt;br /&gt;
y=86+i*sin(((float)j*3.14)/180);&lt;br /&gt;
putpixel(x,y,LIGHTRED);&lt;br /&gt;
delay(1);&lt;br /&gt;
}&lt;br /&gt;
getch();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
OUTPUT:&lt;/h2&gt;
&lt;div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgunb5g0Cv_4UDpBfl5rqjQwUdIY2tbSZSDiCbD7RcnZ0RecLgonSuWIIcdX9Fj8KBTg4Cu3s20A8QjoAcs1qlPQv4IaSAHmWDUyXsA2OxKy-eLy7GjCy9rUEQN0epcsVt_ga6iTVXAPdj4/s1600/sunrise.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgunb5g0Cv_4UDpBfl5rqjQwUdIY2tbSZSDiCbD7RcnZ0RecLgonSuWIIcdX9Fj8KBTg4Cu3s20A8QjoAcs1qlPQv4IaSAHmWDUyXsA2OxKy-eLy7GjCy9rUEQN0epcsVt_ga6iTVXAPdj4/s1600/sunrise.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;i&gt;tags: Computer Graphics, Sunrise Animation , Animation using C , Graphics in C&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/9070057896994696637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/c-program-for-sunrise-animation-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/9070057896994696637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/9070057896994696637'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/c-program-for-sunrise-animation-using.html' title='C Program for Sunrise Animation using Graphics'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgunb5g0Cv_4UDpBfl5rqjQwUdIY2tbSZSDiCbD7RcnZ0RecLgonSuWIIcdX9Fj8KBTg4Cu3s20A8QjoAcs1qlPQv4IaSAHmWDUyXsA2OxKy-eLy7GjCy9rUEQN0epcsVt_ga6iTVXAPdj4/s72-c/sunrise.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3473077794025186772.post-7142097661223164826</id><published>2012-11-05T09:14:00.003-08:00</published><updated>2012-11-16T08:22:37.433-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Animation"/><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="Graphics"/><title type='text'>Program in C for COIN TOSS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;#include &amp;lt;conio.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;#include &amp;lt;dos.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;#include&amp;lt;graphics.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;int
main(void)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;int gd=DETECT,gm,errorcode;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;int midx,midy,k=1,b=0,a=60;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;int xradius,yradius=60;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;initgraph(&amp;amp;gd,&amp;amp;gm,&quot;d:\\tc\\bgi&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;errorcode =graphresult();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;if (errorcode != grOk)&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;printf(&quot;Graphics error: %s\n&quot;, grapherrormsg(errorcode));&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;printf(&quot;Press any key to halt:&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;getch();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;exit(1);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;midx = getmaxx() / 2;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;midy = getmaxy() / 2;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;setcolor(getmaxcolor());&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;settextstyle(2,0,0);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;while(!kbhit())&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;for(a=60;a&amp;gt;=0;a=a-1)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;cleardevice();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;xradius=a;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;if(a==0)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;k=k+1;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;for(b=a;b&amp;lt;=60;b++)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;cleardevice();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;xradius=b;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;if(k%2==0)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;outtextxy(midx-10,midy-90,&quot;TAIL&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;setfillstyle(4,1);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;else&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;outtextxy(midx-10,midy-90,&quot;HEAD&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;setfillstyle(5,3);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;if(b&amp;gt;0 &amp;amp;&amp;amp; b&amp;lt;57)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;int xradius1=b-3;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;fillellipse(midx,midy,xradius1+1, yradius);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;fillellipse(midx,midy,xradius1+2, yradius);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;fillellipse(midx,midy,xradius1+3, yradius);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;outtextxy(10,5,&quot;PROGRAM:TO SHOW THE ROTATION OF A COIN&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;fillellipse(midx,midy,xradius, yradius);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;delay(25);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;if(a&amp;lt;57&amp;gt;0)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;int xradius1=a+3;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;fillellipse(midx,midy,xradius1-1, yradius);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;fillellipse(midx,midy,xradius1-2, yradius);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;fillellipse(midx,midy,xradius1-3, yradius);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;if (k%2==0)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;outtextxy(midx-10,midy-90,&quot;TAIL&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;setfillstyle(4,1);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;else&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;outtextxy(midx-10,midy-90,&quot;HEAD&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;setfillstyle(5,3);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;outtextxy(10,5,&quot;PROGRAM:TO SHOW THE ROTATION OF A COIN&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;fillellipse(midx,midy,xradius, yradius);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;delay(25);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;getch();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;closegraph();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;return 0;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;OUTPUT:&lt;/span&gt;&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqXTTmDKehj6agJEOqCoey0Zjv4RSbrZYe1u-Kvj-1hIxmAotHAxMAJEmeZD7fgi5w4os-coCHCFjoz3x8LigKcTb4vCoxxPuVpDf6uFiweXSna_Nvwh6xwM-ei1QCH5hQrF3tnXvxqnM/s1600/image011.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; display: inline !important; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqXTTmDKehj6agJEOqCoey0Zjv4RSbrZYe1u-Kvj-1hIxmAotHAxMAJEmeZD7fgi5w4os-coCHCFjoz3x8LigKcTb4vCoxxPuVpDf6uFiweXSna_Nvwh6xwM-ei1QCH5hQrF3tnXvxqnM/s1600/image011.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-18OKWvshfbUgz-Bf2I2tsuP0UnxNOo1PtutdLo_z1JpurwBPEzqwYdgzzcmBvOxNT98li0TBmtumlgWlXSDdESVTx5-72OfDWYeV9qSN-g1GdoFKahcUF4GO4hyphenhyphenAwLLQ2ohLDRajMHs/s1600/image009.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-18OKWvshfbUgz-Bf2I2tsuP0UnxNOo1PtutdLo_z1JpurwBPEzqwYdgzzcmBvOxNT98li0TBmtumlgWlXSDdESVTx5-72OfDWYeV9qSN-g1GdoFKahcUF4GO4hyphenhyphenAwLLQ2ohLDRajMHs/s1600/image009.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAxL-nM1Kgblp6m8RUjl5qT_UXsm2Rr1JMF5A2GzPDfeOuCf0ryXL-XJYkZL2GKecYaVAQZOv1WuHhsbZ1z5W9H12tNMRYd9z1gG98xpW5aoH4uiM45f195V30zZ_tFyb6RSPaNRWZ-hs/s1600/image010.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAxL-nM1Kgblp6m8RUjl5qT_UXsm2Rr1JMF5A2GzPDfeOuCf0ryXL-XJYkZL2GKecYaVAQZOv1WuHhsbZ1z5W9H12tNMRYd9z1gG98xpW5aoH4uiM45f195V30zZ_tFyb6RSPaNRWZ-hs/s1600/image010.jpg&quot; title=&quot;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;b style=&quot;text-align: left;&quot;&gt;&lt;i&gt;Tags: &amp;nbsp;c program for coin toss, c program for tossing coin,&amp;nbsp;graphics&amp;nbsp;program for rotating coin.&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://getprogramcode.blogspot.com/feeds/7142097661223164826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/program-in-c-for-coin-toss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/7142097661223164826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3473077794025186772/posts/default/7142097661223164826'/><link rel='alternate' type='text/html' href='http://getprogramcode.blogspot.com/2012/11/program-in-c-for-coin-toss.html' title='Program in C for COIN TOSS'/><author><name>harshit0215</name><uri>http://www.blogger.com/profile/14492301040519656714</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqXTTmDKehj6agJEOqCoey0Zjv4RSbrZYe1u-Kvj-1hIxmAotHAxMAJEmeZD7fgi5w4os-coCHCFjoz3x8LigKcTb4vCoxxPuVpDf6uFiweXSna_Nvwh6xwM-ei1QCH5hQrF3tnXvxqnM/s72-c/image011.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>