<?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-5867554140238035443</id><updated>2024-09-04T08:50:29.729-07:00</updated><category term="FUN WITH C"/><category term="Base conversion"/><category term="Sorting"/><category term="Graphics in c"/><category term="Pointers in C"/><category term="Prime or not"/><category term="Random number generation program"/><category term="Read me (Important)"/><category term="const and volatile"/><category term="n Digit sum"/><title type='text'>ADVANCED &#39;c&#39;</title><subtitle type='html'>Correct Programs , Easiest Way , Interactive Discussions , Problem Solving , Innovation and that&amp;#39;s all we are......Learn with the best , Advanced &amp;#39;c&amp;#39; online research &amp;amp; discussion forum on c language.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5867554140238035443.post-6279121452008044902</id><published>2011-09-09T09:30:00.000-07:00</published><updated>2011-09-09T09:30:54.990-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Pointers in C"/><title type='text'>Malloc Implementation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h6 class=&quot;uiStreamMessage&quot; data-ft=&quot;{&amp;quot;type&amp;quot;:1}&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span class=&quot;messageBody&quot; data-ft=&quot;{&amp;quot;type&amp;quot;:3}&quot;&gt;Below
 is a program enter any integer either positive, negative or zero upto 
so many times you want and when you&#39;ve to stop then enter 01.&lt;br /&gt; The program will count number of positive,negative and zeros among the numbers you&#39;ve given in your program. &lt;br /&gt; &lt;br /&gt; #include &quot;stdio.h&quot;&lt;br /&gt; #include &quot;stdlib.h &quot;&lt;br /&gt; main() {&lt;br /&gt;  int p=0,q=0,z=0,*pt;&lt;br /&gt; &lt;br /&gt; while(1) {&lt;br /&gt; printf(&quot;note : press 01 to exit \n Enter any number : &quot;);&lt;br /&gt; pt=(int*)malloc(1*2);&lt;br /&gt; scanf(&quot;%d&quot;,pt);&lt;br /&gt; if(*pt==01)&lt;br /&gt; break;&lt;br /&gt; if(*pt &amp;gt; 0)&lt;br /&gt; p++;&lt;br /&gt; if(*pt &amp;lt; 0)&lt;br /&gt; q++;&lt;br /&gt; if(*pt==0)&lt;br /&gt; z++;&lt;br /&gt; }&lt;br /&gt; printf(&quot;you have entered \n positive = %d , negative = %d , zeros = %d&quot;,p,q,z);&lt;br /&gt; }&lt;/span&gt;&lt;/span&gt;&lt;/h6&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/6279121452008044902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://advancedc.blogspot.com/2011/09/malloc-implementation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/6279121452008044902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/6279121452008044902'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/2011/09/malloc-implementation.html' title='Malloc Implementation'/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5867554140238035443.post-1397636338648007778</id><published>2011-09-09T09:23:00.000-07:00</published><updated>2011-09-09T09:23:50.174-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FUN WITH C"/><title type='text'>Compile online RUN offline!</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
 &lt;span class=&quot;commentBody&quot; data-jsid=&quot;text&quot;&gt;&lt;i&gt;&lt;b&gt;http://www.onlinecompiler.net/&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&amp;nbsp;&lt;a href=&quot;&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div id=&quot;info&quot;&gt;
&lt;a href=&quot;&quot;&gt;
	
        &lt;br /&gt;
This is the C/C++ Online Compiler.&lt;br /&gt;

        In online compilers (.net) you can find and use online many 
compilers ( GCC, MINGW, GFORTRAN, JAVA, GPC, FREEBASIC) for the 
mainstream languages that exist, you can search THE LINUX MANUAL (DEV 
MAN) PAGES, the JAVA &amp;amp; WIN32 API&#39;S. Also, i have gathered some 
material to get you started with programming. &lt;br /&gt;

      &lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
 &lt;span class=&quot;commentBody&quot; data-jsid=&quot;text&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;commentBody&quot; data-jsid=&quot;text&quot;&gt;&lt;b&gt;Now you are&amp;nbsp; 
able to run graphics code in c whether you r on windows 7 &lt;/b&gt;from this 
website just copy and paste your code to this website then you got a exe
 file n you&#39;re done enjoy : )&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/1397636338648007778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://advancedc.blogspot.com/2011/09/compile-online-run-offline.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/1397636338648007778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/1397636338648007778'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/2011/09/compile-online-run-offline.html' title='Compile online RUN offline!'/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5867554140238035443.post-2085609375637511274</id><published>2011-09-07T10:45:00.000-07:00</published><updated>2011-09-07T10:45:40.443-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Base conversion"/><title type='text'>Any Base to Any Base conversion in C</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
This program is able to convert any base from any base you want and the most interesting feature is that&amp;nbsp; it can convert numbers which have fractional part too.&lt;br /&gt;
No program on the Internet till date can provide you such features.&lt;br /&gt;
Below is a link which will get you to the source code download page of this program.&lt;br /&gt;
Just download it and then copy that named conversi.c file&amp;nbsp; to the tc\bin\ folder and open your IDE and goto open and type there conversi.c and after that just press ctrl+F9 to run.&lt;br /&gt;
output :&lt;br /&gt;
Enter a number 43.25&lt;br /&gt;
&lt;br /&gt;
Enter its base 6&lt;br /&gt;
Enter the base to be converted : 4&lt;br /&gt;
Decimal value = 27&lt;br /&gt;
Converted value 123&lt;br /&gt;
converted value with fractional part 123.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.4shared.com/file/oY5-zj_k/conversi.html&quot; target=&quot;_blank&quot;&gt;conversi.c&lt;/a&gt;

http://www.4shared.com/file/oY5-zj_k/conversi.html &lt;br /&gt;
or download the exe file 
&lt;a href=&quot;http://www.4shared.com/file/xnstdsuv/conversi.html&quot; target=&quot;_blank&quot;&gt;conversi.exe&lt;/a&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
r u unable to understand this program??????????TRY THESE &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Email us at chelperr@gmail.com &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Post your question in the comment box. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. You can give us your email ID also. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4.
 If you want to ask a program/topic or wanted introduce any discussion 
topic then just email at chelperr@gmail.com or drop a comment in the 
comment box.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/2085609375637511274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://advancedc.blogspot.com/2011/09/any-base-to-any-base-conversion-in-c.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/2085609375637511274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/2085609375637511274'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/2011/09/any-base-to-any-base-conversion-in-c.html' title='Any Base to Any Base conversion in C'/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5867554140238035443.post-4557861937203638139</id><published>2011-08-28T13:54:00.000-07:00</published><updated>2011-08-28T13:54:03.338-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FUN WITH C"/><title type='text'>Finding a number is even or odd without using arithmatic operators</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;
main()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;int i,j;&amp;nbsp;&amp;nbsp; /*int type variables*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;scanf(&quot;%d&quot;,&amp;amp;i);/*read i value*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;j=i&amp;amp;1;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*perform logical AND operation */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if(j==0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; printf(&quot;even&quot;);&lt;br /&gt;
&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; printf(&quot;odd&quot;);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.mathsisfun.com/games/&quot;&gt;Math is Fun Games&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/4557861937203638139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://advancedc.blogspot.com/2011/08/finding-number-is-even-or-odd-without.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/4557861937203638139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/4557861937203638139'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/2011/08/finding-number-is-even-or-odd-without.html' title='Finding a number is even or odd without using arithmatic operators'/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5867554140238035443.post-5456848541426573766</id><published>2011-08-20T12:37:00.000-07:00</published><updated>2011-08-20T12:37:10.179-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FUN WITH C"/><title type='text'>I AM AN IDIOT.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h6 class=&quot;uiStreamMessage&quot; data-ft=&quot;{&amp;quot;type&amp;quot;:1}&quot;&gt;&lt;span class=&quot;messageBody&quot; data-ft=&quot;{&amp;quot;type&amp;quot;:3}&quot;&gt;#include &quot;stdio.h&quot;&lt;br /&gt;
#include &quot;conio.h&quot;&lt;br /&gt;
void main()&lt;br /&gt;
{char ch[]=&quot;I AM AN IDIOT.&quot;;&lt;br /&gt;
char c=&#39;A&#39;;&lt;br /&gt;
int i=0;&lt;br /&gt;
while(c)&lt;br /&gt;
{&lt;br /&gt;
c=getch();&lt;br /&gt;
printf(&quot;%c\a&quot;,ch[i]);&lt;br /&gt;
i++;&lt;br /&gt;
&lt;br /&gt;
if(i==14)&lt;br /&gt;
{printf(&quot; &quot;); i=0;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;/span&gt;&lt;/h6&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/5456848541426573766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://advancedc.blogspot.com/2011/08/i-am-idiot.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/5456848541426573766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/5456848541426573766'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/2011/08/i-am-idiot.html' title='I AM AN IDIOT.'/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5867554140238035443.post-6726796886523003251</id><published>2011-08-18T12:33:00.000-07:00</published><updated>2011-08-18T12:33:37.702-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sorting"/><title type='text'>Quick sort in C</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;#define maxsize 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int A[maxsize];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void quicksort(int a, int b)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
int rtidx=0,ltidx=0,k=a,l=0,pivot;&lt;br /&gt;
&lt;br /&gt;
int leftarr[maxsize],rtarr[maxsize];&lt;br /&gt;
&lt;br /&gt;
pivot=A[a];&lt;br /&gt;
&lt;br /&gt;
if(a==b)return;&lt;br /&gt;
&lt;br /&gt;
while(k&lt;b)&lt; p=&quot;&quot;&gt; &lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
++k;&lt;br /&gt;
&lt;br /&gt;
if(A[k]&lt;a[a])&lt; p=&quot;&quot;&gt; &lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
leftarr[ltidx]=A[k];&lt;br /&gt;
&lt;br /&gt;
ltidx++;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
rtarr[rtidx]=A[k];&lt;br /&gt;
&lt;br /&gt;
rtidx++;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
k=a;&lt;br /&gt;
&lt;br /&gt;
for(l=0;l&lt;ltidx;++l)a[k++]=leftarr[l];&lt; p=&quot;&quot;&gt; &lt;br /&gt;
&lt;br /&gt;
A[k++]=pivot;&lt;br /&gt;
&lt;br /&gt;
for(l=0;l&lt;rtidx;++l)a[k++]=rtarr[l];&lt; p=&quot;&quot;&gt; &lt;br /&gt;
&lt;br /&gt;
if(ltidx&amp;gt;0)quicksort(a,a+ltidx-1);&lt;br /&gt;
&lt;br /&gt;
if(rtidx&amp;gt;0)quicksort(b-rtidx+1,b);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void printarr(int a)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
int i;&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&lt;a;i++)&lt; p=&quot;&quot;&gt; &lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
printf(&quot;%d&quot;,A[i]);&lt;br /&gt;
&lt;br /&gt;
printf(&quot;\n&quot;);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
int i,s;&lt;br /&gt;
&lt;br /&gt;
printf(&quot;enter the number of numbers to be entered \n&quot;);&lt;br /&gt;
&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;s);&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&lt;s;i++)&lt; p=&quot;&quot;&gt; &lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
printf(&quot;enter the number \n&quot; );&lt;br /&gt;
&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;A[i]);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
printf(&quot;array before sorting &quot;);&lt;br /&gt;
&lt;br /&gt;
printarr(s);&lt;br /&gt;
&lt;br /&gt;
quicksort(0,s-1);&lt;br /&gt;
&lt;br /&gt;
printf(&quot;array after sorting&quot;);&lt;br /&gt;
&lt;br /&gt;
printarr(s);&lt;br /&gt;
&lt;br /&gt;
&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;} &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;OUTPUT : - &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;enter the number of numbers to be entered &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;5 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;enter the number &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;8 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;enter the number &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;0 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;enter the number &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;-5 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;enter the number &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;-1 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;enter the number &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;7 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;array before sorting 8 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;0 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;-5 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;-1 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;7 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;array after sorting -5 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;-1 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;0 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;7 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;8 &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_ofhej7=&quot;155&quot;&gt;r u unable to understand this program??????????TRY THESE &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;
1. Email us at chelperr@gmail.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Post your question in the comment box.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. You can give us your email ID also.&lt;br /&gt;
&lt;br /&gt;
4. If you want to ask a program/topic or wanted introduce any discussion topic then just email at chelperr@gmail.com or drop a comment in the comment box.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/6726796886523003251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://advancedc.blogspot.com/2011/08/quick-sort-in-c.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/6726796886523003251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/6726796886523003251'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/2011/08/quick-sort-in-c.html' title='Quick sort in C'/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5867554140238035443.post-5037435797277609999</id><published>2011-08-18T10:48:00.000-07:00</published><updated>2011-08-18T10:48:17.579-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="const and volatile"/><title type='text'>const and volatile in C</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h1&gt;&amp;nbsp;Const and volatile&lt;/h1&gt;These are new in Standard &lt;a href=&quot;http://training.gbdirect.co.uk/courses/c/&quot;&gt;C&lt;/a&gt;, although the idea of &lt;code&gt;const&lt;/code&gt;    has been borrowed from &lt;a href=&quot;http://training.gbdirect.co.uk/courses/c++/&quot;&gt;C++&lt;/a&gt;. Let us get one thing straight: the concepts    of &lt;code&gt;const&lt;/code&gt; and &lt;code&gt;volatile&lt;/code&gt; are &lt;i&gt;completely    independent&lt;/i&gt;. A common misconception is to imagine that somehow    &lt;code&gt;const&lt;/code&gt; is the opposite of &lt;code&gt;volatile&lt;/code&gt; and vice    versa. They are unrelated and you should remember the fact.&lt;br /&gt;
Since &lt;code&gt;const&lt;/code&gt; declarations are the simpler, we&#39;ll look at    them first, but only after we have seen where both of these type    qualifiers may be used. The complete list of relevant keywords is&lt;br /&gt;
&lt;pre&gt;char      long      float     volatile
short     signed    double    void
int       unsigned  const&lt;/pre&gt;In that list, &lt;code&gt;const&lt;/code&gt; and &lt;code&gt;volatile&lt;/code&gt; are type    qualifiers, the rest are &lt;dfn&gt;type specifiers&lt;/dfn&gt;. Various combinations    of type specifiers are permitted:&lt;br /&gt;
&lt;pre&gt;char, signed char, unsigned char
int, signed int, unsigned int
short int, signed short int, unsigned short int
long int, signed long int, unsigned long int
float
double
long double&lt;/pre&gt;A few points should be noted. All declarations to do with an    &lt;code&gt;int&lt;/code&gt; will be &lt;code&gt;signed&lt;/code&gt; anyway, so signed is    redundant in that context. If &lt;i&gt;any&lt;/i&gt; other type specifier or    qualifier is present, then the int part may be dropped, as that is the    default.&lt;br /&gt;
The keywords &lt;code&gt;const&lt;/code&gt; and &lt;code&gt;volatile&lt;/code&gt; can be    applied to any declaration, including those of structures, unions,    enumerated types or &lt;code&gt;typedef&lt;/code&gt; names. Applying them to    a declaration is called &lt;dfn&gt;qualifying&lt;/dfn&gt; the declaration—that&#39;s    why const and volatile are called type qualifiers, rather than type    specifiers. Here are a few representative examples:&lt;br /&gt;
&lt;pre&gt;volatile i;
volatile int j;
const long q;
const volatile unsigned long int rt_clk;
struct{
        const long int li;
        signed char sc;
}volatile vs;&lt;/pre&gt;Don&#39;t be put off; some of them are deliberately complicated: what they    mean will be explained later. Remember that they could also be further    complicated by introducing storage class specifications as well! In fact,    the truly spectacular&lt;br /&gt;
&lt;pre&gt;extern const volatile unsigned long int rt_clk;&lt;/pre&gt;is a strong possibility in some real-time operating system kernels.&lt;br /&gt;
&lt;h2&gt;&lt;a href=&quot;http://www.blogger.com/post-create.g?blogID=5867554140238035443&quot; name=&quot;section-1&quot;&gt;&lt;/a&gt;Const&lt;/h2&gt;Let&#39;s look at what is meant when &lt;code&gt;const&lt;/code&gt; is used. It&#39;s     really quite simple: &lt;code&gt;const&lt;/code&gt; means that something is not     modifiable, so a data object that is declared with &lt;code&gt;const&lt;/code&gt; as     a part of its type specification must not be assigned to in any way     during the run of a program. It is very likely that the definition of     the object will contain an initializer (otherwise, since you can&#39;t     assign to it, how would it ever get a value?), but this is not always     the case. For example, if you were accessing a hardware port at a fixed     memory address and promised only to read from it, then it would be     declared to be &lt;code&gt;const&lt;/code&gt; but not initialized.&lt;br /&gt;
Taking the address of a data object of a type which isn&#39;t     &lt;code&gt;const&lt;/code&gt; and putting it into a pointer to the     &lt;code&gt;const&lt;/code&gt;-qualified version of the same type is both safe and     explicitly permitted; you will be able to use the pointer to inspect the     object, but not modify it. Putting the address of a const type into     a pointer to the unqualified type is much more dangerous and     consequently prohibited (although you can get around this by using     a cast). Here is an example:&lt;br /&gt;
&lt;div class=&quot;inset-example&quot;&gt;&lt;a href=&quot;http://www.blogger.com/post-create.g?blogID=5867554140238035443&quot; name=&quot;example-3&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;pre&gt;#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

main(){
        int i;
        const int ci = 123;

        /* declare a pointer to a const.. */
        const int *cpi;

        /* ordinary pointer to a non-const */
        int *ncpi;

        cpi = &amp;amp;ci;
        ncpi = &amp;amp;i;

        /*
         * this is allowed
         */
        cpi = ncpi;

        /*
         * this needs a cast
         * because it is usually a big mistake,
         * see what it permits below.
         */
        ncpi = (int *)cpi;

        /*
         * now to get undefined behaviour...
         * modify a const through a pointer
         */
        *ncpi = 0;

        exit(EXIT_SUCCESS);
}&lt;/stdlib.h&gt;&lt;/stdio.h&gt;&lt;/pre&gt;&lt;cite&gt;Example &lt;/cite&gt;&lt;/div&gt;As the example shows, it is possible to take the address of a constant     object, generate a pointer to a non-constant, then use the new pointer.     This is an &lt;i&gt;error&lt;/i&gt; in your program and results in undefined     behaviour.&lt;br /&gt;
The main intention of introducing const objects was to allow them to     be put into read-only store, and to permit compilers to do extra     consistency checking in a program. Unless you defeat the intent by doing     naughty things with pointers, a compiler is able to check that     &lt;code&gt;const&lt;/code&gt; objects are not modified explicitly by the user.&lt;br /&gt;
An interesting extra feature pops up now. What does this mean?&lt;br /&gt;
&lt;pre&gt;char c;
char *const cp = &amp;amp;c;&lt;/pre&gt;It&#39;s simple really; &lt;code&gt;cp&lt;/code&gt; is a pointer to     a &lt;code&gt;char&lt;/code&gt;, which is exactly what it would be if the     &lt;code&gt;const&lt;/code&gt; weren&#39;t there. The &lt;code&gt;const&lt;/code&gt; means that     &lt;code&gt;cp&lt;/code&gt; is not to be modified, although whatever it points to     can be—the pointer is constant, not the thing that it points to.     The other way round is&lt;br /&gt;
&lt;pre&gt;const char *cp;&lt;/pre&gt;which means that now cp is an ordinary, modifiable pointer, but the     thing that it points to must not be modified. So, depending on what you     choose to do, both the pointer and the thing it points to may be     modifiable or not; just choose the appropriate declaration.&lt;br /&gt;
&lt;h2&gt;&lt;a href=&quot;http://www.blogger.com/post-create.g?blogID=5867554140238035443&quot; name=&quot;section-2&quot;&gt;&lt;/a&gt;Volatile&lt;/h2&gt;After const, we treat &lt;code&gt;volatile&lt;/code&gt;. The reason for having     this type qualifier is mainly to do with the problems that are     encountered in real-time or embedded systems programming using C.     Imagine that you are writing code that controls a hardware device by     placing appropriate values in hardware registers at known absolute     addresses.&lt;br /&gt;
Let&#39;s imagine that the device has two registers, each 16 bits long, at     ascending memory addresses; the first one is the control and status     register (csr) and the second is a data port. The traditional way of     accessing such a device is like this:&lt;br /&gt;
&lt;div class=&quot;inset-example&quot;&gt;&lt;a href=&quot;http://www.blogger.com/post-create.g?blogID=5867554140238035443&quot; name=&quot;example-4&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;pre&gt;/* Standard C example but without const or volatile */
/*
* Declare the device registers
* Whether to use int or short
* is implementation dependent
*/

struct devregs{
        unsigned short  csr;    /* control &amp;amp; status */
        unsigned short  data;   /* data port */
};

/* bit patterns in the csr */
#define ERROR   0x1
#define READY   0x2
#define RESET   0x4

/* absolute address of the device */
#define DEVADDR ((struct devregs *)0xffff0004)

/* number of such devices in system */
#define NDEVS   4

/*
* Busy-wait function to read a byte from device n.
* check range of device number.
* Wait until READY or ERROR
* if no error, read byte, return it
* otherwise reset error, return 0xffff
*/
unsigned int read_dev(unsigned devno){

        struct devregs *dvp = DEVADDR + devno;

        if(devno &amp;gt;= NDEVS)
                return(0xffff);

        while((dvp-&amp;gt;csr &amp;amp; (READY | ERROR)) == 0)
                ; /* NULL - wait till done */

        if(dvp-&amp;gt;csr &amp;amp; ERROR){
                dvp-&amp;gt;csr = RESET;
                return(0xffff);
        }

        return((dvp-&amp;gt;data) &amp;amp; 0xff);
}&lt;/pre&gt;&lt;cite&gt;Example &lt;/cite&gt;&lt;/div&gt;The technique of using a structure declaration to describe the device     register layout and names is very common practice. Notice that there     aren&#39;t actually any objects of that type defined, so the declaration     simply indicates the structure without using up any store.&lt;br /&gt;
To access the device registers, an appropriately cast constant is used     as if it were pointing to such a structure, but of course it points to     memory addresses instead.&lt;br /&gt;
However, a major problem with previous C compilers would be in the     while loop which tests the status register and waits for the     &lt;code&gt;ERROR&lt;/code&gt; or &lt;code&gt;READY&lt;/code&gt; bit to come on. Any     self-respecting optimizing compiler would notice that the loop tests the     same memory address over and over again. It would almost certainly     arrange to reference memory once only, and copy the value into     a hardware register, thus speeding up the loop. This is, of course,     exactly what we don&#39;t want; this is one of the few places where we must     look at the place where the pointer points, every time around the     loop.&lt;br /&gt;
Because of this problem, most C compilers have been unable to make     that sort of optimization in the past. To remove the problem (and other     similar ones to do with when to write to where a pointer points), the     keyword &lt;code&gt;volatile&lt;/code&gt; was introduced. It tells the compiler that     the object is subject to sudden change for reasons which cannot be     predicted from a study of the program itself, and forces every reference     to such an object to be a genuine reference.&lt;br /&gt;
Here is how you would rewrite the example, making use of     &lt;code&gt;const&lt;/code&gt; and &lt;code&gt;volatile&lt;/code&gt; to get what you want.&lt;br /&gt;
&lt;div class=&quot;inset-example&quot;&gt;&lt;a href=&quot;http://www.blogger.com/post-create.g?blogID=5867554140238035443&quot; name=&quot;example-5&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;pre&gt;/*
* Declare the device registers
* Whether to use int or short
* is implementation dependent
*/

struct devregs{
        unsigned short volatile csr;
        unsigned short const volatile data;
};

/* bit patterns in the csr */
#define ERROR   0x1
#define READY   0x2
#define RESET   0x4

/* absolute address of the device */
#define DEVADDR ((struct devregs *)0xffff0004)

/* number of such devices in system */
#define NDEVS   4

/*
* Busy-wait function to read a byte from device n.
* check range of device number.
* Wait until READY or ERROR
* if no error, read byte, return it
* otherwise reset error, return 0xffff
*/
unsigned int read_dev(unsigned devno){

        struct devregs * const dvp = DEVADDR + devno;

        if(devno &amp;gt;= NDEVS)
                return(0xffff);

        while((dvp-&amp;gt;csr &amp;amp; (READY | ERROR)) == 0)
                ; /* NULL - wait till done */

        if(dvp-&amp;gt;csr &amp;amp; ERROR){
                dvp-&amp;gt;csr = RESET;
                return(0xffff);
        }

        return((dvp-&amp;gt;data) &amp;amp; 0xff);
}&lt;/pre&gt;&lt;cite&gt;Example&amp;nbsp; &lt;/cite&gt;&lt;/div&gt;The rules about mixing &lt;code&gt;volatile&lt;/code&gt; and regular types     resemble those for &lt;code&gt;const&lt;/code&gt;. A pointer to     a &lt;code&gt;volatile&lt;/code&gt; object can be assigned the address of a regular     object with safety, but it is dangerous (and needs a cast) to take the     address of a &lt;code&gt;volatile&lt;/code&gt; object and put it into a pointer to     a regular object. Using such a derived pointer results in undefined     behaviour.&lt;br /&gt;
If an array, union or structure is declared with &lt;code&gt;const&lt;/code&gt; or     &lt;code&gt;volatile&lt;/code&gt; attributes, then all of the members take on that     attribute too. This makes sense when you think about it—how could     a member of a &lt;code&gt;const&lt;/code&gt; structure be modifiable?&lt;br /&gt;
That means that an alternative rewrite of the last example would be     possible. Instead of declaring the device registers to be     &lt;code&gt;volatile&lt;/code&gt; in the structure, the pointer could have been     declared to point to a &lt;code&gt;volatile&lt;/code&gt; structure instead, like     this:&lt;br /&gt;
&lt;pre&gt;struct devregs{
      unsigned short  csr;    /* control &amp;amp; status */
      unsigned short  data;   /* data port */
};
volatile struct devregs *const dvp=DEVADDR+devno;&lt;/pre&gt;Since &lt;code&gt;dvp&lt;/code&gt; points to a &lt;code&gt;volatile&lt;/code&gt; object, it     not permitted to optimize references through the pointer. Our feeling is     that, although this would work, it is bad style. The     &lt;code&gt;volatile&lt;/code&gt; declaration belongs in the structure: it is the     device registers which are &lt;code&gt;volatile&lt;/code&gt; and that is where the     information should be kept; it reinforces the fact for a human     reader.&lt;br /&gt;
So, for any object likely to be subject to modification either by     hardware or asynchronous interrupt service routines, the volatile type     qualifier is important.&lt;br /&gt;
Now, just when you thought that you understood all that, here comes     the final twist. A declaration like this:&lt;br /&gt;
&lt;pre&gt;volatile struct devregs{
      /* stuff */
}v_decl;&lt;/pre&gt;declares the type &lt;code&gt;struct devregs&lt;/code&gt; and also     a &lt;code&gt;volatile&lt;/code&gt;-qualified object of that type, called     &lt;code&gt;v_decl&lt;/code&gt;. A later declaration like this&lt;br /&gt;
&lt;pre&gt;struct devregs nv_decl;&lt;/pre&gt;declares &lt;code&gt;nv_decl&lt;/code&gt; which is &lt;i&gt;not&lt;/i&gt; qualified with     &lt;code&gt;volatile&lt;/code&gt;! The qualification is &lt;i&gt;not&lt;/i&gt; part of the     type of &lt;code&gt;struct devregs&lt;/code&gt; but applies only to the declaration     of &lt;code&gt;v_decl&lt;/code&gt;. Look at it this way round, which perhaps makes     the situation more clear (the two declarations are the same in their     effect):&lt;br /&gt;
&lt;pre&gt;struct devregs{
      /* stuff */
}volatile v_decl;&lt;/pre&gt;If you do want to get a shorthand way of attaching a qualifier to     another type, you can use &lt;code&gt;typedef&lt;/code&gt; to do it:&lt;br /&gt;
&lt;pre&gt;struct x{
      int a;
};
typedef const struct x csx;

csx const_sx;
struct x non_const_sx = {1};

const_sx = non_const_sx;        /* error - attempt to modify a const */&lt;/pre&gt;&lt;h3&gt;&lt;a href=&quot;http://www.blogger.com/post-create.g?blogID=5867554140238035443&quot; name=&quot;section-2.1&quot;&gt;&lt;/a&gt;Indivisible Operations&lt;/h3&gt;Those of you who are familiar with techniques that involve hardware      interrupts and other ‘real time’ aspects of programming will      recognise the need for &lt;code&gt;volatile&lt;/code&gt; types. Related to this      area is the need to ensure that accesses to data objects are      ‘atomic’, or uninterruptable. To discuss this is any depth would      take us beyond the scope of this book, but we can at least outline some      of the issues.&lt;br /&gt;
Be careful not to assume that any operations written in C are      uninterruptable. For example,&lt;br /&gt;
&lt;pre&gt;extern const volatile unsigned long realtimeclock;&lt;/pre&gt;could be a counter which is updated by a clock interrupt routine. It      is essential to make it &lt;code&gt;volatile&lt;/code&gt; because of the      asynchronous updates to it, and it is marked &lt;code&gt;const&lt;/code&gt; because      it should not be changed by anything other than the interrupt routine.      If the program accesses it like this:&lt;br /&gt;
&lt;pre&gt;unsigned long int time_of_day;

time_of_day = real_time_clock;&lt;/pre&gt;there may be a problem. What if, to copy one &lt;code&gt;long&lt;/code&gt; into      another, it takes several machine instructions to copy the two words      making up &lt;code&gt;real_time_clock&lt;/code&gt; and &lt;code&gt;time_of_day&lt;/code&gt;? It      is possible that an interrupt will occur in the middle of the      assignment and that in the worst case, when the low-order word of      &lt;code&gt;real_time_clock&lt;/code&gt; is &lt;code&gt;0xffff&lt;/code&gt; and the high-order      word is &lt;code&gt;0x0000&lt;/code&gt;, then the low-order word of      &lt;code&gt;time_of_day&lt;/code&gt; will receive &lt;code&gt;0xffff&lt;/code&gt;. The      interrupt arrives and increments the low-order word of      &lt;code&gt;real_time_clock&lt;/code&gt; to &lt;code&gt;0x0&lt;/code&gt; and then the      high-order word to &lt;code&gt;0x1&lt;/code&gt;, then returns. The rest of the      assignment then completes, with &lt;code&gt;time_of_day&lt;/code&gt; ending up      containing &lt;code&gt;0x0001ffff&lt;/code&gt; and &lt;code&gt;real_time_clock&lt;/code&gt;      containing the correct value, &lt;code&gt;0x00010000&lt;/code&gt;.&lt;br /&gt;
This whole class of problem is what is known as a critical region,      and is well understood by those who regularly work in asynchronous      environments. It should be understood that Standard C takes no special      precautions to avoid these problems, and that the usual techniques      should be employed.&lt;br /&gt;
The header &lt;code&gt;‘signal.h’&lt;/code&gt; declares a type called      &lt;code&gt;sig_atomic_t&lt;/code&gt; which is guaranteed to be modifiable safely      in the presence of asynchronous events. This means only that it can be      modified by assigning a value to it; incrementing or decrementing it,      or anything else which produces a new value depending on its previous      value, is not safe.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/5037435797277609999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://advancedc.blogspot.com/2011/08/const-and-volatile-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/5037435797277609999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/5037435797277609999'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/2011/08/const-and-volatile-in-c.html' title='const and volatile in C'/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5867554140238035443.post-4153162422993747923</id><published>2011-08-18T07:06:00.000-07:00</published><updated>2011-08-18T07:06:45.055-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Prime or not"/><title type='text'>Program to find a number is  prime or not</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div closure_uid_y34crv=&quot;112&quot;&gt;/*Program to find a number is &amp;nbsp;prime or not*/&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div closure_uid_y34crv=&quot;139&quot;&gt;#include &quot;stdio.h&quot;&lt;/div&gt;&lt;br /&gt;
&lt;div closure_uid_y34crv=&quot;140&quot;&gt;#include &quot;conio.h&quot;&lt;/div&gt;&lt;br /&gt;
void main()&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
int a,b,c=1;&lt;br /&gt;
&lt;br /&gt;
clrscr();&lt;br /&gt;
&lt;br /&gt;
&lt;div closure_uid_y34crv=&quot;143&quot;&gt;printf(&quot;enter the number : &quot;);&lt;/div&gt;&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;a);&lt;br /&gt;
&lt;br /&gt;
for(b=2;b&amp;lt;=(a/2);b++)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
if(a%b==0)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
c++;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if(c&amp;gt;1)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
printf(&quot;not prime&quot;);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
printf(&quot;prime &quot;);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div closure_uid_y34crv=&quot;142&quot;&gt;getch();&lt;/div&gt;&lt;div closure_uid_y34crv=&quot;142&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div closure_uid_y34crv=&quot;142&quot;&gt;}&lt;/div&gt;&lt;div closure_uid_y34crv=&quot;142&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div closure_uid_y34crv=&quot;142&quot;&gt;OUTPUT : -&lt;/div&gt;&lt;div closure_uid_y34crv=&quot;142&quot;&gt;enter the number : 17&lt;/div&gt;&lt;div closure_uid_y34crv=&quot;142&quot;&gt;prime&lt;/div&gt;&lt;div closure_uid_y34crv=&quot;142&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div closure_uid_y34crv=&quot;142&quot;&gt;enter the number : 15&lt;/div&gt;&lt;div closure_uid_y34crv=&quot;142&quot;&gt;not prime&lt;/div&gt;&lt;div closure_uid_y34crv=&quot;142&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div closure_uid_y34crv=&quot;142&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div closure_uid_y34crv=&quot;141&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
r u unable to understand this program??????????TRY THESE &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Email us at chelperr@gmail.com &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Post your question in the comment box. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. You can give us your email ID also. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. If you want to ask a program/topic or wanted introduce any discussion topic then just email at chelperr@gmail.com or drop a comment in the comment box.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/4153162422993747923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://advancedc.blogspot.com/2011/08/program-to-find-number-is-prime-or-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/4153162422993747923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/4153162422993747923'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/2011/08/program-to-find-number-is-prime-or-not.html' title='Program to find a number is  prime or not'/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5867554140238035443.post-1992982709753141195</id><published>2011-08-18T06:46:00.000-07:00</published><updated>2011-08-18T06:46:29.450-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Random number generation program"/><title type='text'>Random number generation program</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div closure_uid_jdnxg7=&quot;112&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
#include &quot;STDIO.H&quot;&lt;br /&gt;
&lt;br /&gt;
#include &quot;STDLIB.H&quot;&lt;br /&gt;
&lt;br /&gt;
#include &quot;TIME.H&quot;&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
int num;&lt;br /&gt;
&lt;br /&gt;
randomize();&lt;br /&gt;
&lt;br /&gt;
//Generating the random number&lt;br /&gt;
&lt;br /&gt;
num = random(99999);&lt;br /&gt;
&lt;br /&gt;
//Printing the random number&lt;br /&gt;
&lt;br /&gt;
printf(&quot;%d&quot;,num);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
return 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
r u unable to understand this program??????????TRY THESE &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Email us at chelperr@gmail.com &lt;br /&gt;
&lt;br /&gt;
2. Post your question in the comment box. &lt;br /&gt;
&lt;br /&gt;
3. You can give us your email ID also. &lt;br /&gt;
&lt;br /&gt;
4. If you want to ask a program/topic or wanted introduce any discussion topic then just email at chelperr@gmail.com or drop a comment in the comment box.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/1992982709753141195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://advancedc.blogspot.com/2011/08/random-number-generation-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/1992982709753141195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/1992982709753141195'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/2011/08/random-number-generation-program.html' title='Random number generation program'/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5867554140238035443.post-3011902463596810754</id><published>2011-08-18T06:23:00.000-07:00</published><updated>2011-09-07T10:26:34.635-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Base conversion"/><title type='text'>Decimal to binary conversion program</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div closure_uid_zhi54l=&quot;128&quot;&gt;
#include &quot;stdio.h&quot;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &quot;conio.h&quot;&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
int num[10];&lt;br /&gt;
&lt;br /&gt;
int i=0,digit;&lt;br /&gt;
&lt;br /&gt;
int n;&lt;br /&gt;
&lt;br /&gt;
clrscr();&lt;br /&gt;
&lt;br /&gt;
&lt;div closure_uid_zhi54l=&quot;129&quot;&gt;
printf(&quot;enter a decimal number\n&quot;);&lt;/div&gt;
&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;n);&lt;br /&gt;
&lt;br /&gt;
while(n!=0)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
digit=n%2;&lt;br /&gt;
&lt;br /&gt;
num[i]=digit;&lt;br /&gt;
&lt;br /&gt;
i++;&lt;br /&gt;
&lt;br /&gt;
n=n/2;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
i--;&lt;br /&gt;
&lt;br /&gt;
&lt;div closure_uid_zhi54l=&quot;131&quot;&gt;
printf(&quot;binary form: &quot;);&lt;/div&gt;
&lt;br /&gt;
while(i&amp;gt;=0)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
printf(&quot;%d&quot;,num[i]);&lt;br /&gt;
&lt;br /&gt;
i--;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
getch();&lt;br /&gt;
&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
OUTPUT : -&lt;br /&gt;
enter a number in decimal form &lt;br /&gt;
10&lt;br /&gt;
&lt;div closure_uid_zhi54l=&quot;132&quot;&gt;
binary form: 1010&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
r u unable to understand this program??????????TRY THESE &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Email us at chelperr@gmail.com &lt;br /&gt;
&lt;br /&gt;
2. Post your question in the comment box. &lt;br /&gt;
&lt;br /&gt;
&lt;div closure_uid_zhi54l=&quot;133&quot;&gt;
3. You can give us your email ID also. &lt;/div&gt;
&lt;div closure_uid_zhi54l=&quot;133&quot;&gt;
4.&amp;nbsp;&amp;nbsp;If you&amp;nbsp;want to ask a program/topic or wanted&amp;nbsp;introduce any discussion topic then &amp;nbsp;just email at&amp;nbsp;&lt;a href=&quot;mailto:chelperr@gmail.com&quot;&gt;chelperr@gmail.com&lt;/a&gt;&amp;nbsp;or drop a comment in the comment box.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/3011902463596810754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://advancedc.blogspot.com/2011/08/decimal-to-binary-conversion-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/3011902463596810754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/3011902463596810754'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/2011/08/decimal-to-binary-conversion-program.html' title='Decimal to binary conversion program'/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5867554140238035443.post-3247820178149067119</id><published>2011-08-18T05:36:00.000-07:00</published><updated>2011-08-18T05:36:10.798-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="n Digit sum"/><title type='text'>Program to add n digit number e .g 123 = 6 or 4567 = 21 etc</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div closure_uid_9jo3f0=&quot;131&quot;&gt;#include &quot;stdio.h&#39;&#39;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div closure_uid_9jo3f0=&quot;132&quot;&gt;#include &#39;&#39;conio.h&#39;&#39;&lt;/div&gt;&lt;br /&gt;
main() {&lt;br /&gt;
&lt;br /&gt;
signed long int num,sum=0,digit;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div closure_uid_9jo3f0=&quot;136&quot;&gt;printf(&quot;enter digits = &quot;);&lt;/div&gt;&lt;br /&gt;
scanf(&quot;%ld&quot;,&amp;amp;num);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
while(num%10) {&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
digit=num%10;&lt;br /&gt;
&lt;br /&gt;
sum+=digit;&lt;br /&gt;
&lt;br /&gt;
num/=10;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div closure_uid_9jo3f0=&quot;137&quot;&gt;printf(&quot;Digit sum = %ld&quot;,sum);&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
getch();&lt;br /&gt;
&lt;br /&gt;
&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;} &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;OUTPUT : - &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;enter digits = 123 &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;Digit sum = 6 &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;enter digits = 123456789 &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;Digit sum = 45 &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;r u unable to understand this program??????????TRY THESE &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;1. Email us at &lt;a href=&quot;mailto:chelperr@gmail.com&quot;&gt;chelperr@gmail.com&lt;/a&gt; &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;2. Post your question in the comment box. &lt;/div&gt;&lt;div closure_uid_9jo3f0=&quot;135&quot;&gt;3. You can give us your email ID also.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/3247820178149067119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://advancedc.blogspot.com/2011/08/program-to-add-n-digit-number-e-g-123-6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/3247820178149067119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/3247820178149067119'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/2011/08/program-to-add-n-digit-number-e-g-123-6.html' title='Program to add n digit number e .g 123 = 6 or 4567 = 21 etc'/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5867554140238035443.post-8034677456415489424</id><published>2011-08-14T13:45:00.000-07:00</published><updated>2011-08-18T07:30:06.580-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Sorting"/><title type='text'>Bubble sorting in C</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div closure_uid_flzrv2=&quot;148&quot;&gt;#include &quot;stdio.h&quot;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div closure_uid_flzrv2=&quot;149&quot;&gt;#include &quot;conio.h&quot;&lt;/div&gt;&lt;br /&gt;
void main()&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
int arr[100],temp,i,n,j;&lt;br /&gt;
&lt;br /&gt;
clrscr();&lt;br /&gt;
&lt;br /&gt;
&lt;div closure_uid_flzrv2=&quot;132&quot;&gt;printf(&quot;\nEnter number of elements in array less Than 100 : &quot;);&lt;/div&gt;&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;n);&lt;br /&gt;
&lt;br /&gt;
printf(&quot;\n\tEnter The Values into ARRAY &quot;);&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&lt;n;i++)&lt; p=&quot;&quot;&gt; &lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
printf(&quot;\n\n Enter Element no %d: &quot;,i+1);&lt;br /&gt;
&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;arr[i]);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&lt;n-1;i++)&lt; p=&quot;&quot;&gt; &lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
for(j=0;j&lt;n-i-1;j++)&lt; p=&quot;&quot;&gt; &lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
if(arr[j] &amp;gt;arr[j+1])&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
temp=arr[j];&lt;br /&gt;
&lt;br /&gt;
arr[j]=arr[j+1];&lt;br /&gt;
&lt;br /&gt;
arr[j+1]=temp;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
printf(&quot;\n\n-- Sorted Series --&quot;);&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&lt;n;i++)&lt; p=&quot;&quot;&gt; &lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
printf(&quot;\n \n \t %d&quot;,arr[i]);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
getch();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
} &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;OUTPUT : - &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;Enter number of elements in array less than 100 : 5 &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enter the values into ARRAY &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;Enter element&amp;nbsp;no&amp;nbsp;1 : 8 &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;Enter element no&amp;nbsp;2 : -6 &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;Enter element no&amp;nbsp;3 : 0 &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;Enter element no 4 : 1 &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;Enter element no 5: 9 &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;--Sorted Series-- &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -6 &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 &lt;/div&gt;&lt;div closure_uid_flzrv2=&quot;133&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9 &lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/8034677456415489424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://advancedc.blogspot.com/2011/08/bubble-sorting-in-c.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/8034677456415489424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/8034677456415489424'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/2011/08/bubble-sorting-in-c.html' title='Bubble sorting in C'/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5867554140238035443.post-4559957646253898426</id><published>2011-08-14T12:59:00.000-07:00</published><updated>2011-08-14T12:59:34.340-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Graphics in c"/><title type='text'>Program to Create A human face which smiles and cries</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;#include &quot;graphics.h&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &quot;stdlib.h&quot;&lt;br /&gt;
&lt;br /&gt;
#include &quot;stdio.h&quot;&lt;br /&gt;
&lt;br /&gt;
#include &quot;malloc.h&quot;&lt;br /&gt;
&lt;br /&gt;
#include &quot;dos.h&quot;&lt;br /&gt;
&lt;br /&gt;
#include &quot;conio.h&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int xasp,yasp,gdriver = VGA, gmode=VGAMED, errorcode;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
struct pos&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
int x;&lt;br /&gt;
&lt;br /&gt;
int y;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
struct face&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
int radius;&lt;br /&gt;
&lt;br /&gt;
struct pos position;&lt;br /&gt;
&lt;br /&gt;
int mood;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
typedef struct face face;&lt;br /&gt;
&lt;br /&gt;
face *face1;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void getposition()&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
printf(&quot;Enter X Co-ordinate:&quot;);&lt;br /&gt;
&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;face1-&amp;gt;position.x);&lt;br /&gt;
&lt;br /&gt;
printf(&quot;Enter X Co-ordinate:&quot;);&lt;br /&gt;
&lt;br /&gt;
scanf(&quot;%d&quot;,&amp;amp;face1-&amp;gt;position.y);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void drawface()&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
char ch=&#39;x&#39;;&lt;br /&gt;
&lt;br /&gt;
int i=0,x,y,color,r,imgsize,dif;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
x=face1-&amp;gt;position.x=320;&lt;br /&gt;
&lt;br /&gt;
y=face1-&amp;gt;position.y=180;&lt;br /&gt;
&lt;br /&gt;
face1-&amp;gt;radius=150;&lt;br /&gt;
&lt;br /&gt;
color=15;&lt;br /&gt;
&lt;br /&gt;
r=face1-&amp;gt;radius;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
setbkcolor(0);&lt;br /&gt;
&lt;br /&gt;
getaspectratio(&amp;amp;xasp,&amp;amp;yasp);&lt;br /&gt;
&lt;br /&gt;
setcolor(8);&lt;br /&gt;
&lt;br /&gt;
circle(x,y,face1-&amp;gt;radius);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
setfillstyle(1,color);&lt;br /&gt;
&lt;br /&gt;
floodfill(x,y,getcolor());&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
draweyes(face1);&lt;br /&gt;
&lt;br /&gt;
drawhair(face1);&lt;br /&gt;
&lt;br /&gt;
drawmouth(face1);&lt;br /&gt;
&lt;br /&gt;
drawnose(face1);&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;
drawnose()&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
int i,x,y,r;&lt;br /&gt;
&lt;br /&gt;
x=face1-&amp;gt;position.x;&lt;br /&gt;
&lt;br /&gt;
y=face1-&amp;gt;position.y;&lt;br /&gt;
&lt;br /&gt;
r=face1-&amp;gt;radius;&lt;br /&gt;
&lt;br /&gt;
setcolor(0);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&amp;lt;2;i++) r=&quot;face1-&quot;&amp;gt;radius;&lt;br /&gt;
&lt;br /&gt;
x1=face1-&amp;gt;position.x-r/2;&lt;br /&gt;
&lt;br /&gt;
y1=face1-&amp;gt;position.y-r/4;&lt;br /&gt;
&lt;br /&gt;
x2=face1-&amp;gt;position.x+r/2;&lt;br /&gt;
&lt;br /&gt;
y2=face1-&amp;gt;position.y-r/4;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
setaspectratio(xasp/2,yasp);&lt;br /&gt;
&lt;br /&gt;
arc(x1,y1-r/8,40,140,r/4);//left eyebrow&lt;br /&gt;
&lt;br /&gt;
arc(x1,y1-r/8+1,40,140,r/4);//left eyebrow&lt;br /&gt;
&lt;br /&gt;
arc(x1,y1-r/8+2,40,140,r/4);//left eyebrow&lt;br /&gt;
&lt;br /&gt;
setaspectratio(xasp,yasp);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&amp;lt;2;i++) i=&quot;0;i&amp;lt;2;i++)&quot; x=&quot;face1-&quot;&amp;gt;position.x;&lt;br /&gt;
&lt;br /&gt;
y=face1-&amp;gt;position.y+(face1-&amp;gt;radius/1.5);&lt;br /&gt;
&lt;br /&gt;
r=face1-&amp;gt;radius;&lt;br /&gt;
&lt;br /&gt;
setcolor(BLACK);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if((face1-&amp;gt;mood)==1)&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&amp;lt;4;i++)&amp;gt;mood)==0)&lt;br /&gt;
&lt;br /&gt;
for(i=0;i&amp;lt;4;i++) r=&quot;face1-&quot;&amp;gt;radius;&lt;br /&gt;
&lt;br /&gt;
x=face1-&amp;gt;position.x-r/2;&lt;br /&gt;
&lt;br /&gt;
y=face1-&amp;gt;position.y-r/3;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
arc(x,y,34,225,100);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
arc(x+r,y,314,138,100);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
setfillstyle(1,RED);&lt;br /&gt;
&lt;br /&gt;
floodfill(x,y-70,getcolor());&lt;br /&gt;
&lt;br /&gt;
floodfill(x+r,y-70,getcolor());&lt;br /&gt;
&lt;br /&gt;
setaspectratio(xasp,yasp);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
void main(void)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
int i=0;&lt;br /&gt;
&lt;br /&gt;
initgraph(&amp;amp;gdriver, &amp;amp;gmode,&quot;&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
while(!kbhit())&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
if((i%2)==1)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
setvisualpage(1);&lt;br /&gt;
&lt;br /&gt;
setactivepage(0);&lt;br /&gt;
&lt;br /&gt;
clearviewport();&lt;br /&gt;
&lt;br /&gt;
face1-&amp;gt;mood=0;&lt;br /&gt;
&lt;br /&gt;
drawface();&lt;br /&gt;
&lt;br /&gt;
delay(1000);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
setvisualpage(0);&lt;br /&gt;
&lt;br /&gt;
setactivepage(1);&lt;br /&gt;
&lt;br /&gt;
clearviewport();&lt;br /&gt;
&lt;br /&gt;
face1-&amp;gt;mood=1;&lt;br /&gt;
&lt;br /&gt;
drawface();&lt;br /&gt;
&lt;br /&gt;
delay(300);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
i++;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
getch();&lt;br /&gt;
&lt;br /&gt;
closegraph();&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/4559957646253898426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://advancedc.blogspot.com/2011/08/program-to-create-human-face-which.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/4559957646253898426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/4559957646253898426'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/2011/08/program-to-create-human-face-which.html' title='Program to Create A human face which smiles and cries'/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5867554140238035443.post-4973813350586300027</id><published>2011-01-14T09:11:00.000-08:00</published><updated>2011-08-14T13:34:38.609-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Read me (Important)"/><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Frankly speaking,a person is not able to learn/master a programming language&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
by a book/blog or by doing language classes/lectures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
He/She can only be able to master that language by theirselves.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Actually,what you want to know not book/blog trying to teach.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This blog &quot;Advanced C&quot; is developed with the motive of self exploration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
you should explore yourself that where r u finding the problem/what&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
things you are not able to understand/how much or upto which level you &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
want to know the things.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
you have nothing to do just email us your questions on chelperr@gmail.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and we are commited to answer your questions as soon as possible on our blog.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
you not need to worry at all we provide your answers to your email also.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
NOTE::::JUST BE OUR REGULAR VISITOR TO GET YOUR ANSWERS UP TO DATE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ALWAYS LEAVE COMMENTS FOR EVERY POST YOU HAVE SEEN OR FOR &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SUGGESTIONS OR IMPROVEMENTS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BE OUR FOLLOWER AND REGULAR VISITOR MAKE COMMENTS TO &lt;br /&gt;
&lt;br /&gt;
GET WHAT U WANT.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:welcome all the visitors &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::c helper:&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://advancedc.blogspot.com/feeds/4973813350586300027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://advancedc.blogspot.com/2010/06/frankly-speakinga-person-is-not-able-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/4973813350586300027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5867554140238035443/posts/default/4973813350586300027'/><link rel='alternate' type='text/html' href='http://advancedc.blogspot.com/2010/06/frankly-speakinga-person-is-not-able-to.html' title=''/><author><name>chelper</name><uri>http://www.blogger.com/profile/18266452987374654583</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>