<?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-3355953161202209180</id><updated>2026-10-07T00:21:47.179-07:00</updated><title type='text'>PROGRAMMING IN C LANGUAGE</title><subtitle type='html'>ALl Btech, Bsc, MCA assignments can be done.&lt;br&gt;&#xa;Contact: shri4ram@yahoo.com</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>76</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-6841340067083001220</id><published>2011-12-01T02:31:00.001-08:00</published><updated>2011-12-01T03:01:21.676-08:00</updated><title type='text'>How To Add Syntax Highlighter for Blogger/Blogspot</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Syntax Highlighter are generally used for blogs, which mainly focus on scripting tutorials. We could have seen in many popular blogs using script highlighter to highlight the script. It not only highlight the script, but also give us a clear idea, how the script was formulated. This javascript can be capable of displaying css, xml, jscript, python, c# and much more supported programing languages. Most of the blogs are using the older version of Syntax Highlighter created by Alexgorbatchev.  So here I am going to teach you, how to install syntax highlighter 2.1 (latest version) on your blogger / blogspot blogs. Before you could get in to the process, I recommend you to back up your template.&lt;br /&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/AVvXsEgaKr_ZD2gHJC5hVuDQmGK4paTnaJlOYqeU0PS_hN0Ryrk2U1C8I3i8JJngKRmnyUFSAAAldVPrfrrNqyq_xYQikK2vtEC3g2Z3DnTpSwFHN6GrPvyON9fdPBqAEuAKLNQ5j0JooAs2eTk/s1600/syntax+highlighter+for+blogger+copy.png&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; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaKr_ZD2gHJC5hVuDQmGK4paTnaJlOYqeU0PS_hN0Ryrk2U1C8I3i8JJngKRmnyUFSAAAldVPrfrrNqyq_xYQikK2vtEC3g2Z3DnTpSwFHN6GrPvyON9fdPBqAEuAKLNQ5j0JooAs2eTk/s320/syntax+highlighter+for+blogger+copy.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 1:&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&lt;/b&gt;I made the installation steps more simple to  help people implement it without any mess. Navigate to Blogger dashboard  &amp;gt; Layout &amp;gt; Edit HTML&amp;nbsp; and Expand Widget Templates. Search for &lt;code&gt;  &lt;/code&gt; and replace it with the below code&lt;br /&gt;
&lt;pre class=&quot;brush: js&quot;&gt;
&amp;lt;head&amp;gt;
&lt;link href=&quot;http://sites.google.com/site/bloggermintcom/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt;

&lt;link href=&quot;http://sites.google.com/site/bloggermintcom/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt;

&lt;script src=&quot;http://sites.google.com/site/bloggermintcom/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;

&lt;script src=&quot;http://sites.google.com/site/bloggermintcom/shBrushCss.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;

&lt;script src=&quot;http://sites.google.com/site/bloggermintcom/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;

&lt;script src=&quot;http://sites.google.com/site/bloggermintcom/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
SyntaxHighlighter.all()
&lt;/script&gt;

&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 2:&lt;/b&gt; Whenever you publish a post with script, include the script within the &lt;span style=&quot;color: red;&quot;&gt;&amp;lt; pre &amp;gt;&lt;/span&gt; section&lt;br /&gt;
&amp;lt;pre class=”brush: js”&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Your script here&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/6841340067083001220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2011/12/sample-syntaxt-editor.html#comment-form' title='34 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/6841340067083001220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/6841340067083001220'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2011/12/sample-syntaxt-editor.html' title='How To Add Syntax Highlighter for Blogger/Blogspot'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaKr_ZD2gHJC5hVuDQmGK4paTnaJlOYqeU0PS_hN0Ryrk2U1C8I3i8JJngKRmnyUFSAAAldVPrfrrNqyq_xYQikK2vtEC3g2Z3DnTpSwFHN6GrPvyON9fdPBqAEuAKLNQ5j0JooAs2eTk/s72-c/syntax+highlighter+for+blogger+copy.png" height="72" width="72"/><thr:total>34</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-2646345345139381241</id><published>2011-09-30T02:55:00.001-07:00</published><updated>2011-09-30T02:55:52.812-07:00</updated><title type='text'>C Data type - void</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Linguistic meaning of void is nothing. Size of void data type is meaningless question.&lt;br /&gt;
&lt;br /&gt;
What will be output of following c code?&lt;br /&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int main(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; int size;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; size=sizeof(void);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;%d&quot;,size);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Output: Compilation error&lt;br /&gt;
&lt;br /&gt;
If we will try to find the size of void data type complier will show an error message “not type allowed”. We cannot use any storage class modifier with void data type so void data type doesn’t reserve any memory space. Hence we cannot declare any variable as of void type i.e.&lt;br /&gt;
void num;&amp;nbsp;&amp;nbsp; //compilation error&lt;br /&gt;
&lt;br /&gt;
Use of void data type&lt;br /&gt;
&lt;br /&gt;
1. To declare generic pointer&lt;br /&gt;
2. As a function return type&lt;br /&gt;
3. As a function parameter.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/2646345345139381241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2011/09/c-data-type-void.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/2646345345139381241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/2646345345139381241'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2011/09/c-data-type-void.html' title='C Data type - void'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-2151788953093607743</id><published>2011-09-30T02:52:00.000-07:00</published><updated>2011-09-30T02:52:14.648-07:00</updated><title type='text'>Write a C program to check prime number or not without using recursion</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int isPrime(int);&lt;br /&gt;
&lt;br /&gt;
int main(){&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; int num,prime;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;Enter a positive number: &quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; scanf(&quot;%d&quot;,&amp;amp;num);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; prime = isPrime(num);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; if(prime==1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;%d is a prime number&quot;,num);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;%d is not a prime number&quot;,num);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int isPrime(int num){&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; int i=2;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; while(i&amp;lt;=num/2){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(num%i==0)&lt;br /&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; return 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&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; i++;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1;&lt;br /&gt;
}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/2151788953093607743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2011/09/write-c-program-to-check-prime-number.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/2151788953093607743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/2151788953093607743'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2011/09/write-c-program-to-check-prime-number.html' title='Write a C program to check prime number or not without using recursion'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-9211558808030379328</id><published>2011-09-30T02:49:00.000-07:00</published><updated>2011-09-30T02:49:13.424-07:00</updated><title type='text'>Prime number program in c using recursion</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int isPrime(int);&lt;br /&gt;
&lt;br /&gt;
int main(){&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; int num,prime;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;Enter a positive number: &quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; scanf(&quot;%d&quot;,&amp;amp;num);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; prime = isPrime(num);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; if(prime==1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;%d is a prime number&quot;,num);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;%d is not a prime number&quot;,num);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int isPrime(int num){&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; static int i=2;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(i&amp;lt;=num/2){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(num%i==0)&lt;br /&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; return 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else{&lt;br /&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; i++;&lt;br /&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; isPrime(num);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return 1;&lt;br /&gt;
}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/9211558808030379328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2011/09/prime-number-program-in-c-using.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/9211558808030379328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/9211558808030379328'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2011/09/prime-number-program-in-c-using.html' title='Prime number program in c using recursion'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-7321241265626436228</id><published>2011-09-28T01:18:00.000-07:00</published><updated>2011-09-28T01:18:28.461-07:00</updated><title type='text'>C interview questions and answers</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;1.&lt;b&gt; &lt;span style=&quot;color: orange;&quot;&gt;Write a c program without using any semicolon which output will : Hello word.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution: 1&lt;br /&gt;
void main(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(printf(&quot;Hello world&quot;)){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
Solution: 2&lt;br /&gt;
void main(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; while(!printf(&quot;Hello world&quot;)){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
Solution: 3&lt;br /&gt;
void main(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; switch(printf(&quot;Hello world&quot;)){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
2.&lt;b&gt; &lt;span style=&quot;color: orange;&quot;&gt;Write a C program to Swap two variables without using third variable.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; int a=5,b=10;&lt;br /&gt;
//process one&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a=b+a;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; b=a-b;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a=a-b;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;a= %d&amp;nbsp; b=&amp;nbsp; %d&quot;,a,b);&lt;br /&gt;
&lt;br /&gt;
//process two&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a=5;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; b=10;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a=a+b-(b=a);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;\na= %d&amp;nbsp; b=&amp;nbsp; %d&quot;,a,b);&lt;br /&gt;
//process three&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a=5;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; b=10;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a=a^b;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; b=a^b;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a=b^a;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;\na= %d&amp;nbsp; b=&amp;nbsp; %d&quot;,a,b);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
//process four&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a=5;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; b=10;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a=b-~a-1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; b=a+~b+1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a=a+~b+1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;\na= %d&amp;nbsp; b=&amp;nbsp; %d&quot;,a,b);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
//process five&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a=5,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; b=10;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a=b+a,b=a-b,a=a-b;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;\na= %d&amp;nbsp; b=&amp;nbsp; %d&quot;,a,b);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; getch();&lt;br /&gt;
&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
3. &lt;b style=&quot;color: orange;&quot;&gt;What is dangling pointer in c?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If any pointer is pointing the memory address of any variable but after some variable has deleted from that memory location while pointer is still pointing such memory location. Such pointer is known as dangling pointer and this problem is known as dangling pointer problem. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Initially&lt;/b&gt;: &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&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/AVvXsEjPDjG98Pb-5EjBJgPoMzWdDkzzJYTGj0DBzZ2Y0iJKVltB-1WTGsTJ7ldOfJUphwq0U-BeUmy3RJltBncAdNkomjWAcw-UWUQKwh84cGgsKXIhDuMpYbV38COhJkS9T0OioBNUfQ_fQnE/s1600/Concept8.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;138&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPDjG98Pb-5EjBJgPoMzWdDkzzJYTGj0DBzZ2Y0iJKVltB-1WTGsTJ7ldOfJUphwq0U-BeUmy3RJltBncAdNkomjWAcw-UWUQKwh84cGgsKXIhDuMpYbV38COhJkS9T0OioBNUfQ_fQnE/s320/Concept8.jpeg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;color: black;&quot;&gt;&lt;b&gt;Later:&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&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/AVvXsEhZacW0qPk6Zs_sMjZkj7VLuhKEExnYa47skgp3rTwZ4KqUlWOZL7j4sd_9vizeu4W0uHH24aIUV0QoUMA3_rN6zk8xx1I6NLf9E4k0sQSWopzTQEzTAXgG1Ut81_633Ix03dICs89n2tU/s1600/Concept9.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;161&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZacW0qPk6Zs_sMjZkj7VLuhKEExnYa47skgp3rTwZ4KqUlWOZL7j4sd_9vizeu4W0uHH24aIUV0QoUMA3_rN6zk8xx1I6NLf9E4k0sQSWopzTQEzTAXgG1Ut81_633Ix03dICs89n2tU/s320/Concept9.jpeg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;4. &lt;b style=&quot;color: orange;&quot;&gt;What is wild pointer in c ? &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
A pointer in c which has not been initialized is known as wild pointer.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Example&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
(q)What will be output of following c program?&lt;br /&gt;
&lt;br /&gt;
void main(){&lt;br /&gt;
int *ptr;&lt;br /&gt;
printf(&quot;%u\n&quot;,ptr);&lt;br /&gt;
printf(&quot;%d&quot;,*ptr);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Output&lt;/b&gt;: Any address&lt;br /&gt;
Garbage value&lt;br /&gt;
&lt;br /&gt;
Here ptr is wild pointer because it has not been initialized.&lt;br /&gt;
There is difference between the NULL pointer and wild pointer. Null pointer points the base address of segmentwhile wild pointer doesn’t point any specific memory location. &lt;br /&gt;
&lt;br /&gt;
5. &lt;b style=&quot;color: #444444;&quot;&gt;What is the meaning of prototype of a function ?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Prototype of a function&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Answer&lt;/b&gt;: Declaration of function is known as prototype of a function. Prototype of a function means&lt;br /&gt;
(1) What is return type of function?&lt;br /&gt;
(2) What parameters are we passing?&lt;br /&gt;
(3) For example prototype of printf function is:&lt;br /&gt;
int printf(const char *, …);&lt;br /&gt;
I.e. its return type is int data type, its first parameter constant character pointer and second parameter is ellipsis i.e. variable number of arguments.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. &lt;b style=&quot;color: orange;&quot;&gt;What are merits and demerits of array in c?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
(a) We can easily access each element of array.&lt;br /&gt;
(b) Not necessity to declare two many variables.&lt;br /&gt;
(c) Array elements are stored in continuous memory location.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Demerit&lt;/b&gt;:&lt;br /&gt;
(a) Wastage of memory space. We cannot change size of array at the run time. &lt;br /&gt;
(b) It can store only similar type of data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 19px; line-height: 21px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/7321241265626436228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2011/09/c-interview-questions-and-answers.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/7321241265626436228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/7321241265626436228'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2011/09/c-interview-questions-and-answers.html' title='C interview questions and answers'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPDjG98Pb-5EjBJgPoMzWdDkzzJYTGj0DBzZ2Y0iJKVltB-1WTGsTJ7ldOfJUphwq0U-BeUmy3RJltBncAdNkomjWAcw-UWUQKwh84cGgsKXIhDuMpYbV38COhJkS9T0OioBNUfQ_fQnE/s72-c/Concept8.jpeg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-3438255190336605010</id><published>2010-04-16T18:33:00.000-07:00</published><updated>2010-04-16T18:33:38.406-07:00</updated><title type='text'>If a  five digit number is input through keyboard ,write a  program to print a new number by adding one to each of tis digits.</title><content type='html'>Note: If a five digit number is input through keyboard ,write a program to print a new number by adding one to each of tis digits &lt;strong&gt;&lt;em&gt;for example a number is input is 12391 then the output should be displayed as 23502&lt;/em&gt;&lt;/strong&gt; .&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;
int main()&lt;br /&gt;
{&lt;br /&gt;
long int no,sum=0;&lt;br /&gt;
int rem,check=0;&lt;br /&gt;
clrscr( );&lt;br /&gt;
printf(&quot;Enter the required number:&quot;);&lt;br /&gt;
scanf(&quot;%ld&quot;,&amp;amp;no);&lt;br /&gt;
printf(&quot;\nGiven Number: %d&quot;,no);&lt;br /&gt;
while(no&amp;gt;0) // to store the number in reverse by adding one to each digit&lt;br /&gt;
{&lt;br /&gt;
rem=no%10;&lt;br /&gt;
if(rem!=9)&lt;br /&gt;
{&lt;br /&gt;
&lt;strong&gt;if(check==0) // imp , try to take few minutes here&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;sum=(10*sum)+(rem+1);&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;else{&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;sum=(10*sum)+(rem+2);&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;check=0;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;}&lt;/strong&gt;&lt;br /&gt;
} //if closed&lt;br /&gt;
else{&lt;br /&gt;
sum=(10*sum)+0;&lt;br /&gt;
check=1;&lt;br /&gt;
}&lt;br /&gt;
no=no/10;&lt;br /&gt;
} // while closed&lt;br /&gt;
&lt;br /&gt;
// Afftr adding , again to print the reverse number in origianl form.&lt;br /&gt;
&lt;br /&gt;
no=sum; sum=0;&lt;br /&gt;
while(no&amp;gt;0)&lt;br /&gt;
{&lt;br /&gt;
rem=no%10;&lt;br /&gt;
sum=(10*sum)+rem;&lt;br /&gt;
no=no/10;&lt;br /&gt;
}&lt;br /&gt;
printf(&quot;\nAfter Adding one: %ld&quot;,sum);&lt;br /&gt;
getch( );&lt;br /&gt;
return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
Enter the reuired Number: 12391&lt;br /&gt;
Given Number: 12391&lt;br /&gt;
After Adding one to each of its digits: 23502</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/3438255190336605010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2010/04/if-five-digit-number-is-input-through.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/3438255190336605010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/3438255190336605010'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2010/04/if-five-digit-number-is-input-through.html' title='If a  five digit number is input through keyboard ,write a  program to print a new number by adding one to each of tis digits.'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-8347768710423750126</id><published>2010-03-08T18:04:00.000-08:00</published><updated>2010-03-08T18:05:03.959-08:00</updated><title type='text'>Write a C program to find the greatest common divisor (GCD) of the two given positive integers.</title><content type='html'>#include&amp;lt; stido.h&amp;gt;&lt;br /&gt;
#include&amp;lt; conio.h&amp;gt;&lt;br /&gt;
int&amp;nbsp;main( )&lt;br /&gt;
{&lt;br /&gt;
int a, b, res;&lt;br /&gt;
clrscr( );&lt;br /&gt;
printf(&quot;Enter the two integer values:&quot;);&lt;br /&gt;
scanf(&quot;%d%d&quot;, &amp;amp;a, &amp;amp;b);&lt;br /&gt;
&lt;br /&gt;
for( ; ; ) //This is empty for loop.&lt;br /&gt;
{&lt;br /&gt;
res = a%b;&lt;br /&gt;
if( res = = 0) break;&lt;br /&gt;
a = b;&lt;br /&gt;
b = res;&lt;br /&gt;
}&lt;br /&gt;
printf(&quot;\n The GCF is : %d&quot;, res);&lt;br /&gt;
getch( );&lt;br /&gt;
return 0;&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/8347768710423750126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2010/03/write-c-program-to-find-greatest-common.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/8347768710423750126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/8347768710423750126'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2010/03/write-c-program-to-find-greatest-common.html' title='Write a C program to find the greatest common divisor (GCD) of the two given positive integers.'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-9198579341960292502</id><published>2010-03-08T17:23:00.000-08:00</published><updated>2010-03-08T17:23:36.277-08:00</updated><title type='text'>Write a C program that prints a given positive integer in reverse order and also sum of the individual digits involved in the given integer.</title><content type='html'>#include&amp;lt; stdio.h&amp;gt;&lt;br /&gt;
#include&amp;lt; conio.h&amp;gt;&lt;br /&gt;
int main( )&lt;br /&gt;
{&lt;br /&gt;
int no, rev=0, rem, sum=0;&lt;br /&gt;
clrscr( );&lt;br /&gt;
printf(&quot;Enter the required integer:&quot;);&lt;br /&gt;
scanf(&quot;%d&quot;, &amp;amp;no);&lt;br /&gt;
while(no&amp;gt;0)&lt;br /&gt;
{&lt;br /&gt;
rem = no%10;&lt;br /&gt;
rev = (10*rev)+rem;&lt;br /&gt;
sum = sum+rem;&lt;br /&gt;
no=no/10;&lt;br /&gt;
}&lt;br /&gt;
printf(&quot;\nReverse Number : %d&quot;, rev);&lt;br /&gt;
printf(&quot;\nSum of the individual digits : %d&quot;, sum);&lt;br /&gt;
getch( );&lt;br /&gt;
&lt;br /&gt;
return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Note: If any compile errors, please mail to me..</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/9198579341960292502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2010/03/write-c-program-that-prints-given.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/9198579341960292502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/9198579341960292502'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2010/03/write-c-program-that-prints-given.html' title='Write a C program that prints a given positive integer in reverse order and also sum of the individual digits involved in the given integer.'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-7531018398127579607</id><published>2010-03-08T17:14:00.000-08:00</published><updated>2010-03-08T17:14:51.758-08:00</updated><title type='text'>Write a C program to find the commission on a salesman&#39;s total sales</title><content type='html'>Full Question:&lt;br /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The commission on a salesman’s total sales is as follows:&lt;br /&gt;
a) If sales &amp;lt;100, then there is no commission.&lt;br /&gt;
&lt;br /&gt;
b) If 100&amp;gt;= sales &amp;lt;=500, then commission = 10% of sales.&lt;br /&gt;
&lt;br /&gt;
c) If sales &amp;gt; 500, then commission = 100+8% of sales above 500&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;Solution&lt;/em&gt;&lt;/strong&gt;:-&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;
int main( )&lt;br /&gt;
{&lt;br /&gt;
int sales;&lt;br /&gt;
float comm;&lt;br /&gt;
clrscr( );&lt;br /&gt;
printf(&quot;Enter the total sales:&quot;);&lt;br /&gt;
scanf(&quot;%d&quot;, &amp;amp;sales);&lt;br /&gt;
if(sales&amp;lt;100)&lt;br /&gt;
printf(&quot;\nSorry no Commission, please do more sales&quot;);&lt;br /&gt;
else if(sales&amp;gt;=100 &amp;amp;&amp;amp; sales&amp;lt;=500)&lt;br /&gt;
printf(&quot;\nCommission : %f &quot;, (sales*0.1));&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
comm=(sales-500)*0.08;&lt;br /&gt;
printf(&quot;\nCommission : %f &quot;,&amp;nbsp;(comm+100));&lt;br /&gt;
}&lt;br /&gt;
getch( );&lt;br /&gt;
return 0;&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/7531018398127579607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2010/03/write-c-program-to-find-commission-on.html#comment-form' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/7531018398127579607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/7531018398127579607'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2010/03/write-c-program-to-find-commission-on.html' title='Write a C program to find the commission on a salesman&#39;s total sales'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-6097599124459882678</id><published>2010-02-17T07:01:00.000-08:00</published><updated>2010-02-17T07:01:22.829-08:00</updated><title type='text'>Write a C program to find the exponential series of 1+x+x2/2!+x3/3!+.......+xn/n!</title><content type='html'>#include&amp;lt; math.h&amp;gt;&lt;br /&gt;
void main( )&lt;br /&gt;
{&lt;br /&gt;
int x, n, fact, i, j;&lt;br /&gt;
float sum=1;&lt;br /&gt;
clrscr( );&lt;br /&gt;
printf(&quot;Enter the &#39;x&#39; value:&quot;);&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;x);&lt;br /&gt;
printf(&quot;\nEnter the &#39;n&#39; value:&quot;);&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;n);&lt;br /&gt;
for(i=1; i&amp;lt; =n ; i++)&lt;br /&gt;
{&lt;br /&gt;
fact=1;&lt;br /&gt;
for( j=i ; j &amp;gt;=1; j--)&lt;br /&gt;
fact=fact*j;&lt;br /&gt;
&lt;br /&gt;
sum=sum+(pow(x,i )/ fact);&lt;br /&gt;
}&lt;br /&gt;
printf(&quot;\nSum of the&amp;nbsp;series : %f &quot;,sum);&lt;br /&gt;
getch( );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Note:- If any errors,, plz mail to me.</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/6097599124459882678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2010/02/write-c-program-to-find-exponential.html#comment-form' title='29 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/6097599124459882678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/6097599124459882678'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2010/02/write-c-program-to-find-exponential.html' title='Write a C program to find the exponential series of 1+x+x2/2!+x3/3!+.......+xn/n!'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>29</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-7813518252150784499</id><published>2010-02-14T18:57:00.000-08:00</published><updated>2010-02-14T18:57:12.373-08:00</updated><title type='text'>Write a C program to display all Even numbers upto the given range.</title><content type='html'>#include&amp;lt; stdio.h&amp;gt; &lt;div&gt;#include&amp;lt; conio.h&amp;gt;&lt;br /&gt;
int main( )&lt;br /&gt;
{&lt;br /&gt;
int x, r;&lt;br /&gt;
clrscr( );&lt;br /&gt;
printf(&quot;Enter the range:&quot;);&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;r);&lt;br /&gt;
for(x=1; x &amp;lt;=r; x++)&lt;br /&gt;
{&lt;br /&gt;
if(x%2==0)&lt;br /&gt;
printf(&quot;%5d&quot;, x);&lt;br /&gt;
}&lt;br /&gt;
getch( );&lt;/div&gt;return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Output:-&lt;br /&gt;
Enter the range:10&lt;br /&gt;
2 4 6 8 10</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/7813518252150784499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2010/02/write-c-program-to-display-all-even.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/7813518252150784499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/7813518252150784499'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2010/02/write-c-program-to-display-all-even.html' title='Write a C program to display all Even numbers upto the given range.'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-1344305191478169818</id><published>2010-02-09T08:41:00.000-08:00</published><updated>2010-02-09T08:41:56.207-08:00</updated><title type='text'>Write a program to compute the sum of the terms 1+3+5+7+9+--------- until the sum&gt;500</title><content type='html'>#include&lt; stdio.h&gt;&lt;br /&gt;
#include&lt; conio.h&gt;&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
long int i,sum=0;&lt;br /&gt;
clrscr();&lt;br /&gt;
for(i=1; ;i++)&lt;br /&gt;
{&lt;br /&gt;
if(i%2!=0)&lt;br /&gt;
sum=sum+i;&lt;br /&gt;
if(sum&gt;500)&lt;br /&gt;
break;&lt;br /&gt;
}&lt;br /&gt;
printf(&quot;\nSum of the 1+3+5+---- until the sum&gt;500 is : %ld&quot;,sum);&lt;br /&gt;
getch( );&lt;br /&gt;
return 0;&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/1344305191478169818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2010/02/write-program-to-compute-sum-of-terms.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/1344305191478169818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/1344305191478169818'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2010/02/write-program-to-compute-sum-of-terms.html' title='Write a program to compute the sum of the terms 1+3+5+7+9+--------- until the sum&gt;500'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-6214726806349512612</id><published>2010-02-09T08:33:00.000-08:00</published><updated>2010-02-09T08:33:37.239-08:00</updated><title type='text'>Write a C program to compute the sum of the terms 1+2+3+.....upto N terms</title><content type='html'>#include&lt; stdio.h&gt;&lt;br /&gt;
#include&lt; conio.h&gt;&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
int n,i,sum=0;&lt;br /&gt;
clrscr();&lt;br /&gt;
printf(&quot;Enter the &#39;n&#39; value:&quot;);&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;n);&lt;br /&gt;
for(i=1; i&lt;=n; i++)&lt;br /&gt;
{&lt;br /&gt;
sum=sum+i;&lt;br /&gt;
}&lt;br /&gt;
printf(&quot;\nSum of the &#39;n&#39; terms: %d&quot;,sum);&lt;br /&gt;
getch();&lt;br /&gt;
return 0;&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/6214726806349512612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2010/02/write-c-program-to-compute-sum-of-terms.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/6214726806349512612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/6214726806349512612'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2010/02/write-c-program-to-compute-sum-of-terms.html' title='Write a C program to compute the sum of the terms 1+2+3+.....upto N terms'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-480001651287340257</id><published>2010-01-11T04:57:00.000-08:00</published><updated>2010-01-11T05:04:18.524-08:00</updated><title type='text'>Write a C program that adds first seven terms of the following series 1/1! +2/2! + 3/3! + ..........</title><content type='html'>#include&lt; stdio.h&gt;&lt;br /&gt;
#include&lt; conio.h&gt;&lt;br /&gt;
int main( )&lt;br /&gt;
{&lt;br /&gt;
int n,i,j,fact;&lt;br /&gt;
float sum=0;&lt;br /&gt;
clrscr();&lt;br /&gt;
for(i=1; i&lt;=7; i++)
{
fact=1;
for(j=i; j&gt;=1; j--) // to find the factorial&lt;br /&gt;
fact=fact*j;&lt;br /&gt;
&lt;br /&gt;
sum=sum+(float)i/fact;&lt;br /&gt;
}&lt;br /&gt;
printf(&quot;\nSum : %f&quot;,sum);&lt;br /&gt;
getch();&lt;br /&gt;
return 0;&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/480001651287340257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2010/01/write-c-program-that-adds-first-seven.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/480001651287340257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/480001651287340257'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2010/01/write-c-program-that-adds-first-seven.html' title='Write a C program that adds first seven terms of the following series 1/1! +2/2! + 3/3! + ..........'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-1476900601520495863</id><published>2010-01-11T04:54:00.000-08:00</published><updated>2010-01-11T04:54:09.750-08:00</updated><title type='text'>Write a C program to find a peculiar two digit number which is three times the sum of its digits?</title><content type='html'>example:- 27&lt;br /&gt;
=3(2+7)&lt;br /&gt;
=3(9)&lt;br /&gt;
=27&lt;br /&gt;
&lt;br /&gt;
#include&lt; stdio.h&gt;&lt;br /&gt;
#include&lt; conio.h&gt;&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
  int n,sum=0,rem,temp;&lt;br /&gt;
  clrscr();&lt;br /&gt;
  printf(&quot;Enter any two digit number:&quot;);&lt;br /&gt;
  scanf(&quot;%d&quot;,&amp;n);&lt;br /&gt;
  for(temp=n;temp&gt;0;temp=temp/10)&lt;br /&gt;
  {&lt;br /&gt;
   rem=temp%10;&lt;br /&gt;
   sum=sum+rem;&lt;br /&gt;
  }&lt;br /&gt;
  if(n==(sum*3))&lt;br /&gt;
    printf(&quot;\nIts a Peculiar two digit number&quot;);&lt;br /&gt;
  else&lt;br /&gt;
    printf(&quot;\nNot a Peculiar two digit number&quot;);&lt;br /&gt;
 getch();&lt;br /&gt;
return 0;&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/1476900601520495863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2010/01/write-c-program-to-find-peculiar-two.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/1476900601520495863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/1476900601520495863'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2010/01/write-c-program-to-find-peculiar-two.html' title='Write a C program to find a peculiar two digit number which is three times the sum of its digits?'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-181060915440001401</id><published>2009-11-26T23:33:00.000-08:00</published><updated>2009-11-26T23:33:33.883-08:00</updated><title type='text'>Write a C program to print the given alphabet pyramid -2</title><content type='html'>&lt;pre&gt;&lt;span style=&quot;font-family: inherit; font-size: large;&quot;&gt;
A B C D E F G F E D C B A
  A B C D E F E D C B A
    A B C D E D C B A
      A B C D C B A
        A B C B A
          A B A
            A 


#include&amp;lt;stdio.h&amp;gt;
#incldue&amp;lt;conio.h&amp;gt;
int main( )
{
  int r,c,askey,sp;
  clrscr( );
  
  for( r=7; r&amp;gt;=1; r-- )
  {
    for(sp=6; sp&amp;gt;=r; sp--)
        printf(&quot;  &quot;); //2 spaces

    askey=65;
    for(c=1; c&amp;lt;=r; c++ )
      printf(&quot;%2c&quot;, askey++ );
    
    for(c=r-1; c&amp;gt;=1; c-- )
       printf(&quot;%2c&quot;, --askey);
   
   printf(&quot;\n&quot;);
  }
  getch();
  return 0;
}

&lt;b&gt;&lt;u&gt;Output:-&lt;/u&gt;
A B C D E F G F E D C B A
  A B C D E F E D C B A
    A B C D E D C B A
      A B C D C B A
        A B C B A
          A B A
            A
&lt;/b&gt; 
&lt;/span&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/181060915440001401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2009/11/write-c-program-to-print-given-alphabet.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/181060915440001401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/181060915440001401'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2009/11/write-c-program-to-print-given-alphabet.html' title='Write a C program to print the given alphabet pyramid -2'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-7197618762119352152</id><published>2009-11-26T18:10:00.000-08:00</published><updated>2009-11-26T23:20:59.609-08:00</updated><title type='text'>Write a C program to print the given alphabet pyramid.</title><content type='html'>&lt;pre&gt;&lt;span style=&quot;font-family: inherit; font-size: large;&quot;&gt;A B C D E F G G F E D C B A
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A
-----------------------------------

#include&amp;lt;stdio.h&amp;gt;
#include&amp;lt;conio.h&amp;gt;
int main( )
{
  int r,c,askey;
  clrscr( );
  
  for( r=7; r&amp;gt;=1; r-- )
  {
    askey=65;
    for(c=1; c&amp;lt;=r; c++ )
      printf(&quot;%2c&quot;, askey++ );&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;font-family: inherit; font-size: large;&quot;&gt;    askey--; 
&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;font-family: inherit; font-size: large;&quot;&gt;    for(c=r; c&amp;gt;=1; c-- )
       printf(&quot;%2c&quot;, askey--);
   
   printf(&quot;\n&quot;);
  }
  getch();
  return 0;
}
 
&lt;b&gt;&lt;u&gt;Output:- &lt;/u&gt;
A B C D E F G G F E D C B A
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A
&lt;/b&gt;
Note:-&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;font-family: inherit; font-size: large;&quot;&gt;&#39;r&#39; and &#39;c&#39; means rows and columns .&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;font-family: inherit; font-size: large;&quot;&gt;&#39;askey&#39; variable is for disp. values.&lt;/span&gt;
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/7197618762119352152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2009/11/include-main-int-rcaskey-clrscr-for-r7.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/7197618762119352152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/7197618762119352152'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2009/11/include-main-int-rcaskey-clrscr-for-r7.html' title='Write a C program to print the given alphabet pyramid.'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-4486203270443486682</id><published>2009-11-12T08:13:00.000-08:00</published><updated>2009-11-13T04:07:01.975-08:00</updated><title type='text'>Write a C program to find the roots of a quadratic equation using Pointers and Functions.</title><content type='html'>#include(stdio.h) // place this &#39;&amp;lt;&#39; &amp;amp; &#39;&amp;gt;&#39; instead of &#39;(&#39; &amp;amp; &#39;)&#39; before stdio.h&lt;br /&gt;
#include(math.h)&lt;br /&gt;
void quadratic_roots(double *,double *, double *); &lt;br /&gt;
int main(void)&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #3333ff;&quot;&gt;{&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
double a, b, c;&lt;br /&gt;
clrscr( );&lt;br /&gt;
printf(&quot;Enter the values of a,b and c :&quot;);&lt;br /&gt;
scanf(&quot;%lf %lf %lf&quot;, &amp;amp;a, &amp;amp;b, &amp;amp;c);&lt;br /&gt;
printf(&quot;\nThe required quadratic equation is : ax^2 + bx + c = 0&quot;);&lt;br /&gt;
printf(&quot;\nGiven Values: a = %lf \n b= %lf \n c= %lf &quot;,a ,b, c);&lt;br /&gt;
quadratic_roots(&amp;amp;a,&amp;amp;b,&amp;amp;c);&lt;br /&gt;
getch( );&lt;br /&gt;
return 0; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void quadratic_roots(double *aa, double *bb, double *cc)&lt;br /&gt;
{&lt;br /&gt;
double root1, root2;&lt;br /&gt;
if((*bb)*(*bb)= = 4*(*aa)*(*cc))&lt;br /&gt;
{&lt;br /&gt;
root1= -(*bb)/2*(*aa);&lt;br /&gt;
printf(&quot;\nRoots are equal&quot;);&lt;br /&gt;
printf(&quot;\nvalue : %lf&quot;, root1);&lt;br /&gt;
}&amp;nbsp; &lt;br /&gt;
else if((*bb)*(*bb) &amp;gt; 4*(*aa)*(*cc))&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;{&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;root1= (-(*bb) + sqrt((*bb)*(*bb) -(4*(*aa)*(*cc))))/(2*(*aa));&lt;br /&gt;
root2= (-(*bb) - sqrt((*bb)*(*bb) -(4*(*aa)*(*cc))))/(2*(*aa));&lt;br /&gt;
printf(&quot;\nThe roots of the equation are: %lf and %lf &quot;, root1, root2);&lt;br /&gt;
&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
printf(&quot;\nImaginary roots&quot;);&lt;br /&gt;
root1= (-(*bb) + sqrt((*bb)*(*bb) -(4*(*aa)*(*cc))))/(2*(*aa));&lt;br /&gt;
root2= (-(*bb) - sqrt((*bb)*(*bb) -(4*(*aa)*(*cc))))/(2*(*aa));&lt;br /&gt;
&lt;div class=&quot;talk&quot;&gt;printf(&quot;roots are %f+i(%&lt;wbr&gt;&lt;/wbr&gt;f) , %&lt;wbr&gt;&lt;/wbr&gt;f-&lt;wbr&gt;&lt;/wbr&gt;i(%&lt;wbr&gt;&lt;/wbr&gt;f)&quot;,r1, r2, r1, r2);&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/4486203270443486682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2009/11/write-c-program-to-find-roots-of.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/4486203270443486682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/4486203270443486682'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2009/11/write-c-program-to-find-roots-of.html' title='Write a C program to find the roots of a quadratic equation using Pointers and Functions.'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-2643367702831666890</id><published>2009-11-11T23:17:00.000-08:00</published><updated>2009-11-11T23:17:52.862-08:00</updated><title type='text'>Write a C function that defines two strings as parameters, as follows, and  checks whether the second string (str2) is a substring of the first one (str1).</title><content type='html'>&lt;span style=&quot;font-family: Verdana; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;int substring_finder(char* str1, char*  str2);&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt; &lt;div align=&quot;left&quot;&gt;The function should return an integer as  follows:&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: SymbolMT;&quot;&gt;&lt;span style=&quot;font-family: SymbolMT;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: SymbolMT;&quot;&gt;&lt;span style=&quot;font-family: SymbolMT;&quot;&gt;• &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;2 &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;if str2 is a substring of str1 and also of same  length&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier;&quot;&gt;&lt;span style=&quot;font-family: Courier;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier;&quot;&gt;&lt;span style=&quot;font-family: Courier;&quot;&gt;o &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;e.g. str1 = &quot;Hello&quot; and str2= &quot;Hello&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: SymbolMT;&quot;&gt;&lt;span style=&quot;font-family: SymbolMT;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: SymbolMT;&quot;&gt;&lt;span style=&quot;font-family: SymbolMT;&quot;&gt;• &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;1 &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;if str2 is a substring of str1 and of different  lengths&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier;&quot;&gt;&lt;span style=&quot;font-family: Courier;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier;&quot;&gt;&lt;span style=&quot;font-family: Courier;&quot;&gt;o &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;e.g. str1 = &quot;Hello World&quot; and str2= &quot;Hello&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: SymbolMT;&quot;&gt;&lt;span style=&quot;font-family: SymbolMT;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: SymbolMT;&quot;&gt;&lt;span style=&quot;font-family: SymbolMT;&quot;&gt;• &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;0 &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;if str2 is not a substring of str1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier;&quot;&gt;&lt;span style=&quot;font-family: Courier;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Courier;&quot;&gt;&lt;span style=&quot;font-family: Courier;&quot;&gt;o &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;e.g. str1 = &quot;Hello&quot; and str2= &quot;Helo&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt; &lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;#include(string.h) //&amp;nbsp; note place &#39;&amp;lt;&#39; &amp;amp; &#39;&amp;gt;&#39; in place of &#39;(&#39; &amp;amp; &#39;)&#39;&lt;br /&gt;
#include(stdio.h)&lt;br /&gt;
int substring_finder(char *,char *);&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; char *str1,*str2;&lt;br /&gt;
&amp;nbsp; int fl;&lt;br /&gt;
&amp;nbsp; clrscr();&lt;br /&gt;
&amp;nbsp; printf(&quot;Enter the main string:&quot;);&lt;br /&gt;
&amp;nbsp; gets(str1);&lt;br /&gt;
&amp;nbsp; printf(&quot;Enter the sub-string:&quot;);&lt;br /&gt;
&amp;nbsp; gets(str2);&lt;br /&gt;
&amp;nbsp; fl=substring_finder(str1,str2);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; if(fl==0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;\n&#39;str2&#39; is not a substring of &#39;str1&#39;&quot;);&lt;br /&gt;
&amp;nbsp; else if(fl==1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;\n&#39;str2&#39; is a substring of &#39;str1&#39;&quot;);&lt;br /&gt;
&amp;nbsp; else if(fl==2)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;\nBoth are equal&quot;);&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;getch();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;return 0;&lt;br /&gt;
}&lt;br /&gt;
int substring_finder(char *str,char *sub)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; int flag;&lt;br /&gt;
&amp;nbsp; if(strcmp(str,sub)==0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag=2;&lt;br /&gt;
&amp;nbsp; else if(strstr(str,sub))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag=1;&lt;br /&gt;
&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag=0;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; return flag;&lt;br /&gt;
}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;i&gt;&lt;b&gt;Output&lt;/b&gt;&lt;/i&gt;:- Enter the main string: Hello world&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Enter the sub string: world&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&#39;str2&#39; is a substring of &#39;str1&#39;&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/2643367702831666890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2009/11/write-c-function-that-defines-two.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/2643367702831666890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/2643367702831666890'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2009/11/write-c-function-that-defines-two.html' title='Write a C function that defines two strings as parameters, as follows, and  checks whether the second string (str2) is a substring of the first one (str1).'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-6259224638087026254</id><published>2009-11-11T21:16:00.000-08:00</published><updated>2009-11-11T21:24:41.720-08:00</updated><title type='text'>Write a C program to merge two unsorted one dimensional arrays in descending order</title><content type='html'>&lt;span style=&quot;font-size: small;&quot;&gt;Write a program to merge two unsorted 1D arrays in &lt;b&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span id=&quot;lw_1258001851_0&quot; style=&quot;-moz-background-clip: border; -moz-background-inline-policy: continuous; -moz-background-origin: padding; background: transparent none repeat scroll 0% 0%; border-bottom: 1px dashed rgb(0, 102, 204);&quot;&gt;descending  order&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Note: &lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Define the sizes of  each array as a constant i.e. your program should run for arrays of any size.&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;#include(stdio.h)&amp;nbsp; // note &#39;&amp;lt;&#39; &amp;amp; &#39;&amp;gt;&#39; in place of &#39;(&#39; &amp;amp; &#39;)&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // size of the array is 20&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;#define MAX 20&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;int main()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;int f[MAX],s[MAX];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;int m,n; // to read the size of two arrays&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;int i,j,temp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;clrscr();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;printf(&quot;Enter the 1st array size(1-20) :&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;scanf(&quot;%d&quot;,&amp;amp;m);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;printf(&quot;Enter the 2nd array size(1-20) :&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;scanf(&quot;%d&quot;,&amp;amp;n);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;printf(&quot;\nEnter the 1st array elements:&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;for(i=0; i&amp;lt; m; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; scanf(&quot;%d&quot;,&amp;amp;f[i] );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;printf(&quot;\nEnter the 2nd array elements:&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;for(j=0; j&amp;lt; n; j++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; scanf(&quot;%d&quot;, &amp;amp;s[j] );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;for(j=0; j&amp;lt; n; j++)&amp;nbsp; // to store &#39;s&#39; elements to &#39;f&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; f[i]=s[ j];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i++;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;printf(&quot;\nBefore descending, the merged array is:\n&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;for(i=0; i&amp;lt; m+n; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;%5d&quot;,f[i] );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;for(i=0; i&amp;lt; m+n; i++)// to arrange the &#39;f&#39; elements in Descending oder&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(j=i; j&amp;lt; (m+n)-1; j++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(f[i]&amp;lt; f[ j+1])&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;temp=f[i];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;f[i]=f[ j+1];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;f[ j+1]=temp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;printf(&quot;\nAfter descending, the merged array is:\n&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; for(i=0; i&amp;lt; m+n; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;%5d&quot;,f[i] );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;getch();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;return 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;&lt;b&gt;Output:-&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Enter the 1st array size(1-20) :4&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Enter the 2nd array size(1-20) :5&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Enter the 1st array elements:12&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;3&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;45&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;12&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Enter the 2nd array elements:78&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;5&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;43&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;23&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Before descending, the merged array is:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp; 45&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp; 78&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp; 43&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 23&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;After descending, the merged array is:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; 78&amp;nbsp;&amp;nbsp; 45&amp;nbsp;&amp;nbsp; 43&amp;nbsp;&amp;nbsp; 23&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp; 12&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/6259224638087026254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2009/11/write-c-program-to-merge-two-unsorted.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/6259224638087026254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/6259224638087026254'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2009/11/write-c-program-to-merge-two-unsorted.html' title='Write a C program to merge two unsorted one dimensional arrays in descending order'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-6626318645135098515</id><published>2009-11-10T09:43:00.001-08:00</published><updated>2009-11-12T07:13:13.509-08:00</updated><title type='text'>Write a C program to print the Given pyramid</title><content type='html'>&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;font-family: inherit; font-size-adjust: inherit; font-size: inherit; font-stretch: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit;&quot; valign=&quot;top&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;2&amp;nbsp; &lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; 1 2&amp;nbsp;3&amp;nbsp;&amp;nbsp;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp; 1 2 3 4 &lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;1 2 3 4 5&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;.&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;.&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;.&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;n&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;#include(stdio.h) // note place &#39;&amp;lt;&#39; &amp;amp; &#39;&amp;gt;&#39; in place of &#39;(&#39; &amp;amp; &#39;)&#39;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;#include(conio.h)&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;int main( )&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;{&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;int r,c,n,sp;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;clrscr( );&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;printf(&quot;Enter the no. of rows u want to print:&quot;);&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;scanf(&quot;%d&quot;, &amp;amp;n);&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;for(r=1; r&amp;lt;=n; r++)&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;{ &lt;br /&gt;
&lt;/div&gt;&lt;div&gt;for(sp=n; sp&amp;gt;=r; sp--)&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;printf(&quot; &quot;); // give one space in betw quotations.&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;for(c=1; c&amp;lt;=r; c++)&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;printf(&quot;%2d&quot;, c);&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;printf(&quot;\n&quot;);&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;}&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;getch( );&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;return 0;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;}&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/6626318645135098515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2009/11/write-c-program-to-print-given-pyramid.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/6626318645135098515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/6626318645135098515'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2009/11/write-c-program-to-print-given-pyramid.html' title='Write a C program to print the Given pyramid'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-6203089362971563375</id><published>2009-10-30T00:48:00.000-07:00</published><updated>2009-10-30T00:48:11.597-07:00</updated><title type='text'>Write a C program to get the maximum and minimum values of a Data type</title><content type='html'>#include(stdio.h)&amp;nbsp; // note place &#39;&amp;lt;&#39; &amp;amp; &#39;&amp;gt;&#39; in place of &#39;(&#39; &amp;amp; &#39;)&#39;&lt;br /&gt;
#include(conio.h) &lt;br /&gt;
void main( )&lt;br /&gt;
{&lt;br /&gt;
int x, y;&lt;br /&gt;
clrscr( );&lt;br /&gt;
x=1;&amp;nbsp; &lt;br /&gt;
while( x &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
y = x;&lt;br /&gt;
x + + ;&lt;br /&gt;
}&lt;br /&gt;
printf(&quot;\nMaximum value : %d &quot;, y );&lt;br /&gt;
printf(&quot;\nMinimum value : %d&quot;, x);&lt;br /&gt;
getch( );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;/i&gt;- Maximum value : 32767&lt;br /&gt;
Minimum value : -32768&lt;br /&gt;
&lt;br /&gt;
Similarly we can find the below datatypes,&lt;br /&gt;
long int ( %ld ) &lt;br /&gt;
char ( %d ) &lt;br /&gt;
unsigned ( %u )&lt;br /&gt;
.....</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/6203089362971563375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2009/10/write-c-program-to-get-maximum-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/6203089362971563375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/6203089362971563375'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2009/10/write-c-program-to-get-maximum-and.html' title='Write a C program to get the maximum and minimum values of a Data type'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-1438561169709022623</id><published>2009-10-29T23:54:00.000-07:00</published><updated>2009-10-29T23:54:29.828-07:00</updated><title type='text'>Write a C program to Sort the list of integers using Bubble Sort</title><content type='html'>#include(stdio.h)&amp;nbsp; //note place &#39;&amp;lt;&#39; &amp;amp; &#39;&amp;gt;&#39; in place of &#39;(&#39; &amp;amp; &#39;)&#39;&lt;br /&gt;
#include(conio.h)&lt;br /&gt;
void bubble(int [ ], int); // func. declaration&lt;br /&gt;
void main( )&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;&amp;nbsp;int a[10],n,i;&lt;br /&gt;
clrscr();&lt;br /&gt;
printf(&quot;Enter the no. of elements u want to fill:&quot;);&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;n);&lt;br /&gt;
printf(&quot;\nEnter the array elements:&quot;);&lt;br /&gt;
for(i=0; i&amp;lt; n; i++)&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;a[i]);&lt;br /&gt;
&lt;br /&gt;
bubble(a,n);&amp;nbsp; // calling function&lt;br /&gt;
getch();&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
void bubble(int b[], int no)&amp;nbsp; // called function&lt;br /&gt;
&lt;div style=&quot;color: blue;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;int i,j,temp;&lt;br /&gt;
for(i=0; i&amp;lt; no-1; i++)&lt;br /&gt;
&lt;div style=&quot;color: #660000;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;for(j=0; j&amp;lt; no-i; j++)&lt;br /&gt;
{&lt;br /&gt;
if(b[j]&amp;gt;b[j+1])&lt;br /&gt;
&lt;div style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;{&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;temp=b[j];&lt;br /&gt;
b[j]=b[j+1];&lt;br /&gt;
b[j+1]=temp;&lt;br /&gt;
&lt;div style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;}&lt;br /&gt;
&lt;div style=&quot;color: #660000;&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;printf(&quot;\nAfter sorting : &quot;);&lt;br /&gt;
for(i=0; i&amp;lt; no; i++)&lt;br /&gt;
printf(&quot;%5d&quot;,b[i] );&lt;br /&gt;
&lt;b style=&quot;color: blue;&quot;&gt;}&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;Output&lt;/b&gt;&lt;/i&gt;:- Enter the no. of elements u want to fill: 5&lt;br /&gt;
Enter the array elements : 8&amp;nbsp; 1&amp;nbsp; 90&amp;nbsp; 5&amp;nbsp; 4&lt;br /&gt;
After sorting : 1&amp;nbsp; 4&amp;nbsp; 5&amp;nbsp; 8&amp;nbsp; 90</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/1438561169709022623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2009/10/write-c-program-to-sort-list-of.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/1438561169709022623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/1438561169709022623'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2009/10/write-c-program-to-sort-list-of.html' title='Write a C program to Sort the list of integers using Bubble Sort'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-1012688041293614614</id><published>2009-10-26T21:40:00.000-07:00</published><updated>2009-10-26T21:43:04.784-07:00</updated><title type='text'>Write a C program to find gcd of each of the two consecutive elements of an array. write a function GCD(a,b) that would take two consecutive elements of the array as arguments and return the GCD.</title><content type='html'>&lt;div&gt;#include(stdio.h) // Note place &#39;&amp;lt;&#39; &amp;amp; &#39;&amp;gt;&#39; in place of &#39;(&#39; &amp;amp; &#39;)&#39;&lt;br /&gt;
int gcd(int,int);&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; int  a[10],n,i,b[10];&lt;br /&gt;
&amp;nbsp; int x,y;&lt;br /&gt;
&amp;nbsp; clrscr();&lt;br /&gt;
&amp;nbsp; printf(&quot;Enter the size of the  array:&quot;);&lt;br /&gt;
&amp;nbsp; scanf(&quot;%d&quot;,&amp;amp;n);&lt;br /&gt;
&amp;nbsp; printf(&quot;\nEnter the array  elements:&quot;);&lt;br /&gt;
&amp;nbsp; for(i=0; i&amp;lt; n ;i++)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; scanf(&quot;%d&quot;,&amp;amp;a[i]);&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&amp;nbsp;for(i=0; i&amp;lt; n-1 ;i++)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x=a[i];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y=a[i+1];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  b[i]=gcd(x,y);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&quot;\nG.C.D of %d and %d is : %d&quot;,x,y,b[i]);&lt;br /&gt;
&amp;nbsp;  }&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;getch();&lt;br /&gt;
}&lt;br /&gt;
int gcd(int a,int b)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; int rem;&lt;br /&gt;
&amp;nbsp; for(;;)&lt;br /&gt;
&amp;nbsp;  {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; rem=a%b;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(rem==0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a=b;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;  b=rem;&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;return b;&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/1012688041293614614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2009/10/write-c-program-to-find-gcd-of-each-of.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/1012688041293614614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/1012688041293614614'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2009/10/write-c-program-to-find-gcd-of-each-of.html' title='Write a C program to find gcd of each of the two consecutive elements of an array. write a function GCD(a,b) that would take two consecutive elements of the array as arguments and return the GCD.'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3355953161202209180.post-2102049490701922806</id><published>2009-10-16T21:29:00.000-07:00</published><updated>2009-10-16T21:30:00.802-07:00</updated><title type='text'>Write a C program to Create a Paint brush using graphics functions</title><content type='html'>&lt;div&gt;#include(graphics.h) // note place &#39;&amp;lt;&#39; &amp;amp; &#39;&amp;gt;&#39; in place of &#39;(&#39; &amp;amp; &#39;)&#39;&lt;br /&gt;
#include(stdlib.h)&lt;br /&gt;
struct BYTEREGS&lt;br /&gt;
{&lt;br /&gt;
unsigned char al, ah, bl, bh;&lt;br /&gt;
unsigned char cl, ch, dl, dh;&lt;br /&gt;
};&lt;br /&gt;
struct WORDREGS&lt;br /&gt;
{&lt;br /&gt;
unsigned int ax, bx, cx, dx;&lt;br /&gt;
unsigned int si, di, cflag, flags;&lt;br /&gt;
};&lt;br /&gt;
union REGS&lt;br /&gt;
{&lt;br /&gt;
struct WORDREGS x;&lt;br /&gt;
struct BYTEREGS h;&lt;br /&gt;
};&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
int x,y,b,px,py,c,p,s,cl;&lt;br /&gt;
int d=0,m;&lt;br /&gt;
union REGS i,o;&lt;br /&gt;
initgraph(&amp;amp;d,&amp;amp;m,&quot;c:\tc&quot;);&lt;br /&gt;
i.x.ax=1;&lt;br /&gt;
int86(0x33,&amp;amp;i,&amp;amp;o);&lt;br /&gt;
i.x.ax=8;&lt;br /&gt;
i.x.cx=20;&lt;br /&gt;
i.x.dx=450;&lt;br /&gt;
int86(0x33,&amp;amp;i,&amp;amp;o);&lt;br /&gt;
printf(&quot;Brush style insert number from 0 to 5 : &quot;);&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;p);&lt;br /&gt;
printf(&quot;Brush size insert number from 1 to 7 : &quot;);&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;s);&lt;br /&gt;
printf(&quot;Brush color insert number from 1 to 16 : &quot;);&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;cl);&lt;br /&gt;
clrscr( );&lt;br /&gt;
&lt;br /&gt;
cleardevice();&lt;br /&gt;
printf(&quot;\t\t**********DRAW IMAGE************&quot;);&lt;br /&gt;
while(!kbhit( ))&lt;br /&gt;
{&lt;br /&gt;
i.x.ax=3;&lt;br /&gt;
b=o.x.bx;&lt;br /&gt;
x=o.x.cx;&lt;br /&gt;
y=o.x.dx;&lt;br /&gt;
px=x;&lt;br /&gt;
py=y;&lt;br /&gt;
int86(0x33,&amp;amp;i,&amp;amp;o);&lt;br /&gt;
if(cl==16)&lt;br /&gt;
{&lt;br /&gt;
c=random(16);&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
c=cl;&lt;br /&gt;
}&lt;br /&gt;
setcolor(c);&lt;br /&gt;
if(b==1)&lt;br /&gt;
{&lt;br /&gt;
i.x.ax=3;&lt;br /&gt;
int86(0x33,&amp;amp;i,&amp;amp;o);&lt;br /&gt;
x=o.x.cx;&lt;br /&gt;
y=o.x.dx;&lt;br /&gt;
b=o.x.bx;&lt;br /&gt;
switch( p )&lt;br /&gt;
{&lt;br /&gt;
case 1: circle(px,py,s);break;&lt;br /&gt;
case 2: ellipse(px,py,0,270,s,s+2);break;&lt;br /&gt;
case 3: fillellipse(px,py,s+2,s);break;&lt;br /&gt;
case 4: rectangle(px,py,x,y);break;&lt;br /&gt;
case 5: sector(px,py,30,120,s,s);break;&lt;br /&gt;
default : line(px,py,x,y);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
getch();&lt;br /&gt;
restorecrtmode();&lt;br /&gt;
closegraph();&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cprogramskills.blogspot.com/feeds/2102049490701922806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://cprogramskills.blogspot.com/2009/10/write-c-program-to-create-paint-brush.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/2102049490701922806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3355953161202209180/posts/default/2102049490701922806'/><link rel='alternate' type='text/html' href='http://cprogramskills.blogspot.com/2009/10/write-c-program-to-create-paint-brush.html' title='Write a C program to Create a Paint brush using graphics functions'/><author><name>shriram ( శ్రీరాం )</name><uri>http://www.blogger.com/profile/00971680137941932814</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEGTlINONrq0VczLe2nPfmnrOEp3kK1D880NQXzT0hz59E7WS8_-7ly0v4zUNy2OFEuE7TfreKF1GWOKDQNm5yMPgo4U2PYutO8ALaZX8vd5nD7HjzNRiUurQZsK5KOX8/s220/Photo0007.jpg'/></author><thr:total>1</thr:total></entry></feed>