<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EmbLogic &#187; Prachi Chhabra</title>
	<atom:link href="https://www.emblogic.com/blog/author/prachi-chhabra176/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Tue, 03 Mar 2020 13:00:06 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>Select Function in Socket.</title>
		<link>https://www.emblogic.com/blog/12/select-function-in-socket/</link>
		<comments>https://www.emblogic.com/blog/12/select-function-in-socket/#comments</comments>
		<pubDate>Wed, 16 Dec 2015 04:43:09 +0000</pubDate>
		<dc:creator><![CDATA[Prachi Chhabra]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=13014</guid>
		<description><![CDATA[Select function helps you to know  about the file descriptors which are ready for reading , writing. Basically when there is no data present in the socket during recv call it gets blocked till the data arrives so that meanwhile &#8230; <a href="https://www.emblogic.com/blog/12/select-function-in-socket/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><strong>Select function</strong> helps you to know  about the file descriptors which are ready for reading , writing. Basically when there is no data present in the socket during recv call it gets blocked till the data arrives so that meanwhile application can to further useful work.</p>
<p><strong>int select()</strong> is also useful when there are multiple sockets and an application has to recieve data from them , select solves this problem while polling all the sockets to see if they are available for reading,writing &amp; non-blocking operations.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/12/select-function-in-socket/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to read space by scanf in c?</title>
		<link>https://www.emblogic.com/blog/09/how-to-read-space-by-scanf-in-c/</link>
		<comments>https://www.emblogic.com/blog/09/how-to-read-space-by-scanf-in-c/#comments</comments>
		<pubDate>Sun, 27 Sep 2015 10:04:55 +0000</pubDate>
		<dc:creator><![CDATA[Prachi Chhabra]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12954</guid>
		<description><![CDATA[rvrs_of_string Generally scanf() ignores the spaces,backslash n,tabs etc while taking input from the user, but by using scanset specifiers we are able to deal with this problem. scanset specifiers are represented by %[]. whether we want to right a character &#8230; <a href="https://www.emblogic.com/blog/09/how-to-read-space-by-scanf-in-c/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a title="Reversing of string" href="http://www.emblogic.com/blog/wp-content/uploads/2015/09/rvrs_of_string.c">rvrs_of_string</a></p>
<p>Generally scanf() ignores the spaces,backslash n,tabs etc while taking input from the user, but by using scanset specifiers we are able to deal with this problem.<br />
scanset specifiers are represented by %[].<br />
whether we want to right a character or a string, both can be done by specifying it in these square brackets.</p>
<p>Let us take some cases:<br />
char arr[15];<br />
1. scanf(&#8220;%[a-z]c&#8221;,&amp;arr);<br />
2. scanf(&#8220;%[a-z]s&#8221;,&amp;arr);</p>
<p>According to this- %[]is a scanset specifier &amp; by writing a-z means only a-z characters can be given as input, nothing else.<br />
c is specifying that only a character can be taken at a time as an input.<br />
Whereas in 2nd case by writing s we are allowing a string to be taken as input.</p>
<p>3. scanf(&#8220;%[^\n]s&#8221;,&amp;arr);<br />
By using ^ we are telling that while writing a string, the time when we enter,scanf only takes a string upto that enter.That means it will allow all things as n input except newline. It can count spaces, tabs etc.</p>
<p>4. scanf(&#8220;%[^\t]s&#8221;, &amp;arr);<br />
this will stop taking input when it gets a tab.</p>
<p>5. scanf(&#8220;%[^24]&#8220;, &amp;arr);<br />
this would take input till 24 or 2 or 4 not encountered.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/09/how-to-read-space-by-scanf-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Binary search.</title>
		<link>https://www.emblogic.com/blog/02/binary-search-2/</link>
		<comments>https://www.emblogic.com/blog/02/binary-search-2/#comments</comments>
		<pubDate>Sat, 28 Feb 2015 09:37:35 +0000</pubDate>
		<dc:creator><![CDATA[Prachi Chhabra]]></dc:creator>
				<category><![CDATA[Data Structures with C]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12370</guid>
		<description><![CDATA[head 1.2; access; symbols; locks root:1.2; strict; comment @ * @; 1.2 date 2015.02.28.09.26.43; author root; state Exp; branches; next 1.1; 1.1 date 2015.02.27.12.00.41; author root; state Exp; branches; next ; desc @@ 1.2 log @this program is about binary &#8230; <a href="https://www.emblogic.com/blog/02/binary-search-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>head	1.2;<br />
access;<br />
symbols;<br />
locks<br />
	root:1.2; strict;<br />
comment	@ * @;</p>
<p>1.2<br />
date	2015.02.28.09.26.43;	author root;	state Exp;<br />
branches;<br />
next	1.1;</p>
<p>1.1<br />
date	2015.02.27.12.00.41;	author root;	state Exp;<br />
branches;<br />
next	;</p>
<p>desc<br />
@@</p>
<p>1.2<br />
log<br />
@this program is about binary search.<br />
@<br />
text<br />
@#include<br />
#define MAX 4</p>
<p>int main()<br />
      {<br />
		int l=0;<br />
		int h= MAX;<br />
		int i;</p>
<p>		int key;<br />
		int arr[MAX];<br />
		printf(&#8220;enter the array&#8221;);<br />
		for(i=0;i&lt;MAX;i++)<br />
		{</p>
<p>				scanf(&quot;%d&quot;, &amp;arr[i]);<br />
		}<br />
		for(i=0;i&lt;MAX;i++)<br />
		{<br />
				printf(&quot;%d=%d:\n&quot;, i,arr[i]);<br />
		}<br />
		printf(&quot;enter the key element \n&quot;);<br />
		scanf(&quot;%d&quot;, &amp;key);<br />
                 int m;<br />
		while(l&lt;=h)<br />
		{<br />
				m=(l+h)/2;</p>
<p>				if(key==arr[m])<br />
					{<br />
						printf(&quot;key element is found&quot;);<br />
						break;<br />
					}<br />
				  else if (keyarr[m]&amp;&amp; m&lt;l)<br />
					{<br />
						l=m+1;<br />
						printf(&quot;true&quot;);<br />
					}</p>
<p>					  else<br />
						{<br />
						 	printf(&quot;key element is not found&quot;);<br />
							break;	</p>
<p>						 }</p>
<p>		                 }<br />
		                         return 0;<br />
            }</p>
<p>@</p>
<p>1.1<br />
log<br />
@Initial revision<br />
@<br />
text<br />
@d2 2<br />
d6 22<br />
a27 3<br />
	int l=0;<br />
	int h=9;<br />
	int i;<br />
d29 25<br />
a53 32<br />
	int key;<br />
	int arr[10];<br />
	printf(&quot;enter the array&quot;);<br />
	for(i=0;i&lt;10;i++)<br />
	{</p>
<p>	 	scanf(&quot;%d&quot;, &amp;arr[i]);<br />
	}<br />
    for(i=0;i&lt;10;i++)<br />
	{<br />
		printf(&quot;%d=%d:\n&quot;, i,arr[i]);<br />
         }<br />
                printf(&quot;enter the key element \n&quot;);<br />
	        scanf(&quot;%d&quot;, &amp;key);<br />
	         while(l&lt;=h)<br />
	         {<br />
                        bint m=(l+h)/2;<br />
	  		if(key==arr[m])<br />
			{<br />
			    printf(&quot;key element is found&quot;);<br />
			    break;<br />
			 }<br />
			else if(keyarr[m])<br />
				l=m+1;</p>
<p>	                else if(key!=arr[m])</p>
<p>		   	  printf(&#8220;key element is not found&#8221;);<br />
	        }<br />
                  return 0;</p>
<p>a54 1</p>
<p>@</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/binary-search-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reversing of array.</title>
		<link>https://www.emblogic.com/blog/02/reversing-of-array/</link>
		<comments>https://www.emblogic.com/blog/02/reversing-of-array/#comments</comments>
		<pubDate>Sat, 28 Feb 2015 05:52:02 +0000</pubDate>
		<dc:creator><![CDATA[Prachi Chhabra]]></dc:creator>
				<category><![CDATA[Data Structures with C]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12361</guid>
		<description><![CDATA[head 1.2; access; symbols; locks root:1.2; strict; comment @ * @; 1.2 date 2002.01.01.01.04.00; author root; state Exp; branches; next 1.1; 1.1 date 2002.01.01.00.56.25; author root; state Exp; branches; next ; desc @used tem variable to interchange the position. array &#8230; <a href="https://www.emblogic.com/blog/02/reversing-of-array/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>head	1.2;<br />
access;<br />
symbols;<br />
locks<br />
	root:1.2; strict;<br />
comment	@ * @;</p>
<p>1.2<br />
date	2002.01.01.01.04.00;	author root;	state Exp;<br />
branches;<br />
next	1.1;</p>
<p>1.1<br />
date	2002.01.01.00.56.25;	author root;	state Exp;<br />
branches;<br />
next	;</p>
<p>desc<br />
@used tem variable to interchange the position.<br />
array is reversed with the help of temp variable.<br />
@</p>
<p>1.2<br />
log<br />
@initialised temp=0<br />
reversing of array is successfully completed.<br />
@<br />
text<br />
@#include<br />
int main()<br />
{<br />
  int i=0;<br />
  int arr[10];<br />
  int temp=0;</p>
<p>  printf(&#8220;enter the array elements\n&#8221;);<br />
  for(i=0;i&lt;=10;i++)<br />
  {<br />
	scanf(&quot;%d&quot;, &amp;arr[i]);<br />
   }<br />
   for(i=0;i&lt;=10;i++)<br />
   { 	printf(&quot; array is %d:%d\n&quot;, i,arr[i]);</p>
<p>    }</p>
<p>	for(i=0;i&lt;5;i++)<br />
	{<br />
		temp = arr[i];<br />
		arr[i]= arr[10-i-1];<br />
		arr[10-i-1] = temp;<br />
	}</p>
<p>		for(i=0;i&lt;=10;i++)<br />
    	printf(&quot;array is %d:%d\n&quot;, i,arr[i]);</p>
<p>       return 0;<br />
	}</p>
<p>@</p>
<p>1.1<br />
log<br />
@Initial revision<br />
@<br />
text<br />
@d4 1<br />
a4 1<br />
  int i;<br />
d6 1<br />
a6 1<br />
  int temp;<br />
@</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/reversing-of-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Program that reads until 0 is entered &amp; reports even , odd integers  &amp; their averages.</title>
		<link>https://www.emblogic.com/blog/02/program-that-reads-until-0-is-entered-reports-even-odd-integers-their-averages/</link>
		<comments>https://www.emblogic.com/blog/02/program-that-reads-until-0-is-entered-reports-even-odd-integers-their-averages/#comments</comments>
		<pubDate>Fri, 27 Feb 2015 08:45:21 +0000</pubDate>
		<dc:creator><![CDATA[Prachi Chhabra]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12319</guid>
		<description><![CDATA[#include 2 int main() 3 { 4 int num=0,evn=0,odd=0,even_sum=0,odd_sum=0; 5 6 7 for(;;) 8 { 9 printf(&#8220;enter the numbers\n&#8221;); 10 scanf(&#8220;%d&#8221;, &#38;num); 11 12 if(num==0) 13 { 14 break; 15 } 16 17 else if(num%2==0) 18 { 19 evn++; 20 &#8230; <a href="https://www.emblogic.com/blog/02/program-that-reads-until-0-is-entered-reports-even-odd-integers-their-averages/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p> #include<br />
  2 int main()<br />
  3 {<br />
  4   int num=0,evn=0,odd=0,even_sum=0,odd_sum=0;<br />
  5<br />
  6<br />
  7   for(;;)<br />
  8   {<br />
  9   printf(&#8220;enter the numbers\n&#8221;);<br />
 10   scanf(&#8220;%d&#8221;, &amp;num);<br />
 11<br />
 12    if(num==0)<br />
 13    {<br />
 14      break;<br />
 15     }<br />
 16<br />
 17     else if(num%2==0)<br />
 18     {<br />
 19         evn++;<br />
 20         even_sum+= num;<br />
 21     }<br />
 22<br />
 23     else if(num%2!=0)<br />
        {<br />
 25          odd++;<br />
 26          odd_sum+=num;<br />
 27     }<br />
 28     }<br />
 29<br />
 30         printf(&#8220;the total no. of even numbers is %d\n&#8221;, evn);<br />
 31         printf(&#8220;the total no. of odd numbers is %d\n&#8221;, odd);<br />
 32         printf(&#8220;\neven Sum:%d&#8221;,even_sum);<br />
 33         printf(&#8220;\nodd sum:%d\n&#8221;,odd_sum);<br />
 34         printf(&#8220;the average of evn numbers is %d\n&#8221;,(int)(even_sum/evn));<br />
 35         printf(&#8220;the average of odd numbers is %d\n&#8221;, (int)(odd_sum/odd));<br />
 36<br />
 37         return 0;<br />
 38   }<br />
 39 p</p>
<p>                                                              1,4           Top</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/program-that-reads-until-0-is-entered-reports-even-odd-integers-their-averages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Computing real roots of quadratic equation.</title>
		<link>https://www.emblogic.com/blog/02/computing-real-roots-of-quadratic-equation/</link>
		<comments>https://www.emblogic.com/blog/02/computing-real-roots-of-quadratic-equation/#comments</comments>
		<pubDate>Wed, 25 Feb 2015 06:27:11 +0000</pubDate>
		<dc:creator><![CDATA[Prachi Chhabra]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12271</guid>
		<description><![CDATA[RCS file: quad.c,v Working file: quad.c head: 1.1 branch: locks: strict root: 1.1 access list: symbolic names: keyword substitution: kv total revisions: 1; selected revisions: 1 description: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- revision 1.1 locked by: root; date: 2015/02/25 06:22:57; author: root; state: Exp; &#8230; <a href="https://www.emblogic.com/blog/02/computing-real-roots-of-quadratic-equation/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: quad.c,v<br />
Working file: quad.c<br />
head: 1.1<br />
branch:<br />
locks: strict<br />
	root: 1.1<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 1;	selected revisions: 1<br />
description:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1	locked by: root;<br />
date: 2015/02/25 06:22:57;  author: root;  state: Exp;<br />
Initial revision</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/computing-real-roots-of-quadratic-equation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A number can be special,larger or it can be special but not scary.</title>
		<link>https://www.emblogic.com/blog/02/a-number-can-be-speciallarger-or-it-can-be-special-but-not-scary/</link>
		<comments>https://www.emblogic.com/blog/02/a-number-can-be-speciallarger-or-it-can-be-special-but-not-scary/#comments</comments>
		<pubDate>Sat, 21 Feb 2015 07:47:23 +0000</pubDate>
		<dc:creator><![CDATA[Prachi Chhabra]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12248</guid>
		<description><![CDATA[RCS file: special.c,v Working file: special.c head: 1.1 branch: locks: strict root: 1.1 access list: symbolic names: keyword substitution: kv total revisions: 1; selected revisions: 1 description: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- revision 1.1 locked by: root; date: 2015/02/21 07:40:24; author: root; state: Exp; &#8230; <a href="https://www.emblogic.com/blog/02/a-number-can-be-speciallarger-or-it-can-be-special-but-not-scary/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: special.c,v<br />
Working file: special.c<br />
head: 1.1<br />
branch:<br />
locks: strict<br />
	root: 1.1<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 1;	selected revisions: 1<br />
description:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1	locked by: root;<br />
date: 2015/02/21 07:40:24;  author: root;  state: Exp;<br />
Initial revision</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/a-number-can-be-speciallarger-or-it-can-be-special-but-not-scary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Area of square &amp; triangle</title>
		<link>https://www.emblogic.com/blog/02/area-of-square-triangle/</link>
		<comments>https://www.emblogic.com/blog/02/area-of-square-triangle/#comments</comments>
		<pubDate>Sat, 21 Feb 2015 06:46:24 +0000</pubDate>
		<dc:creator><![CDATA[Prachi Chhabra]]></dc:creator>
				<category><![CDATA[Data Structures with C]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12243</guid>
		<description><![CDATA[RCS file: area.c,v Working file: area.c head: 1.1 branch: locks: strict root: 1.1 access list: symbolic names: keyword substitution: kv total revisions: 1; selected revisions: 1 description: &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- revision 1.1 locked by: root; date: 2015/02/21 06:35:32; author: root; state: Exp; &#8230; <a href="https://www.emblogic.com/blog/02/area-of-square-triangle/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: area.c,v<br />
Working file: area.c<br />
head: 1.1<br />
branch:<br />
locks: strict<br />
	root: 1.1<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 1;	selected revisions: 1<br />
description:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1	locked by: root;<br />
date: 2015/02/21 06:35:32;  author: root;  state: Exp;<br />
Initial revision</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/area-of-square-triangle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding out largest number &amp; the smallest number.</title>
		<link>https://www.emblogic.com/blog/02/12229/</link>
		<comments>https://www.emblogic.com/blog/02/12229/#comments</comments>
		<pubDate>Fri, 20 Feb 2015 09:14:00 +0000</pubDate>
		<dc:creator><![CDATA[Prachi Chhabra]]></dc:creator>
				<category><![CDATA[Data Structures with C]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12229</guid>
		<description><![CDATA[RCS file: largest.c,v Working file: largest.c head: 1.2 branch: locks: strict root: 1.2 access list: symbolic names: keyword substitution: kv total revisions: 2; selected revisions: 2 description: this is abt &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- revision 1.2 locked by: root; date: 2015/02/20 08:50:26; author: &#8230; <a href="https://www.emblogic.com/blog/02/12229/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: largest.c,v<br />
Working file: largest.c<br />
head: 1.2<br />
branch:<br />
locks: strict<br />
	root: 1.2<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 2;	selected revisions: 2<br />
description:<br />
this is abt<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2	locked by: root;<br />
date: 2015/02/20 08:50:26;  author: root;  state: Exp;  lines: +22 -12<br />
initialised a after scanf<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2015/02/20 07:30:12;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/12229/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
