<?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: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-8866586641689355103</id><updated>2012-01-29T00:01:56.329-08:00</updated><category term='C Aptitude'/><category term='Sorting'/><category term='C Programming'/><category term='Personality Development'/><category term='Glossary'/><category term='Embedded Developer'/><category term='Good links'/><category term='Arrays'/><category term='English learning'/><category term='Kernel'/><category term='Computer Networks'/><category term='TCP/IP'/><category term='Device Drivers'/><category term='C Library'/><title type='text'>Computer and Programming</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-6037566976947761746</id><published>2011-09-27T12:22:00.000-07:00</published><updated>2011-09-27T13:14:45.820-07:00</updated><title type='text'>Wi-Fi interview Questions and Answers</title><content type='html'>Following are the frequently asked Wi-Fi/wifi interview questions and answers. If you have any questions or answers please share with us, we create a unique page for Wi-Fi.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;what is Wi-Fi? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;WiFi refers to the Wireless connection based local network that is set up to a very restricted range. IEEE maintains the standard for the wireless connection based networks.  Wi-Fi stands for Wireless Fidelity an represents the signal transmission  mechanism over distances without physical wires.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What are the advantages of Wi-Fi?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;mobility( access data while moving) , easy to install( places where wires cannot be put), Flexibility ( helps in quick form of the connection). less cost ( with less money bridge can be created).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;what are wireless tools, why it is required?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Wireless tools are mainly added in Root File System(RFS). Wireless tools are mainly open source project. &lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable  {mso-style-name:"Table Normal";  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-parent:"";  mso-padding-alt:0in 5.4pt 0in 5.4pt;  mso-para-margin:0in;  mso-para-margin-bottom:.0001pt;  mso-pagination:widow-orphan;  font-size:10.0pt;  font-family:"Times New Roman";  mso-ansi-language:#0400;  mso-fareast-language:#0400;  mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;&lt;span style="font-size:100%;"&gt;&lt;span style=" Liberation Serif&amp;quot;;font-family:&amp;quot;;" &gt;&lt;span style="font-family:arial;"&gt;The communication between Application and Network is done through IOCTL's. IOCTL are input output control for device specific operation. &lt;/span&gt;&lt;/span&gt;&lt;span style=" ;font-family:arial;" &gt;Another advantage is device specific parameters may be changed on the fly without restarting the driver (or Linux).&lt;/span&gt;The &lt;b style="mso-bidi-font-weight:normal"&gt;Wireless Tools (WT)&lt;/b&gt; is a set of tools allowing to manipulate the Wireless Extensions.&lt;br /&gt;&lt;br /&gt;few of the tools are&lt;/span&gt;&lt;span style="font-family:Symbol; mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;font-size:100%;"  &gt;&lt;span style="mso-list:Ignore"&gt;:&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;iwconfig&lt;/b&gt; manipulate the basic wireless parameter.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;iwlist&lt;/b&gt; allow to initiate scanning and list frequencies, bit-rates, encryption keys.&lt;/span&gt;&lt;span style="font-family:Symbol; mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;font-size:100%;"  &gt;&lt;span style="mso-list:Ignore"&gt; &lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;br /&gt;iwspy&lt;/b&gt; allow to get per node link quality&lt;/span&gt;&lt;span style="font-family:Symbol; mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;font-size:100%;"  &gt;&lt;span style="mso-list:Ignore"&gt;·&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;iwpriv&lt;/b&gt; allow to manipulate the Wireless Extensions specific to a driver (private).&lt;br /&gt;&lt;br /&gt;for e.g. &lt;/span&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable  {mso-style-name:"Table Normal";  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-parent:"";  mso-padding-alt:0in 5.4pt 0in 5.4pt;  mso-para-margin:0in;  mso-para-margin-bottom:.0001pt;  mso-pagination:widow-orphan;  font-size:10.0pt;  font-family:"Times New Roman";  mso-ansi-language:#0400;  mso-fareast-language:#0400;  mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;&lt;span style="font-family:&amp;quot;Liberation Serif&amp;quot;; mso-fareast-font-family:&amp;quot;DejaVu Sans&amp;quot;;mso-hansi-font-family:&amp;quot;Liberation Serif&amp;quot;; mso-bidi-Lohit Hindi&amp;quot;;mso-font-kerning:.5pt;mso-ansi-language: EN-US;mso-fareast-language:HI;mso-bidi-language:HIfont-family:&amp;quot;;font-size:100%;"  &gt;iwpriv ra0 set AuthMode=OPEN.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How to compile Wi-Fi driver and insert?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are different ways to compile Wi-Fi driver depends on the way it implemented. Mostly third party drivers are compiled with the following steps.&lt;br /&gt;&lt;br /&gt;select the mode.&lt;br /&gt;select the appropriate toolchain.&lt;br /&gt;enable or disable certain features from the configuration file.&lt;br /&gt;compile the driver with proper kernel source in the location.&lt;br /&gt;insert the module and put the wireless tools in RFS.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;what are the steps in Wi-Fi connection establishment?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When Wi-Fi station requires connection, It will start associating with the access point using the Wi-Fi configuration information called as SSID, mode, channel no, MAC address, authentication type and key.&lt;br /&gt;   &lt;p class="ListParagraph" style="margin-left:0in"&gt;&lt;span style="font-family:Symbol; mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol"&gt;&lt;span style="mso-list:Ignore"&gt;&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Initialization:  Initialization of Wi-Fi device in particular mode named as a,b,g and n.&lt;/p&gt;&lt;span style="font-family:Symbol; mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol"&gt;&lt;span style="mso-list:Ignore"&gt;&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Scanning: Scanning the list of accesspoints with in the coverage area.  &lt;p class="ListParagraph" style="margin-left:0in"&gt;Authentication : Authenticating the station with the Access point depending on the authentication mode in Access point and the key supplied by the user.&lt;/p&gt;  &lt;p class="ListParagraph" style="margin-left:0in"&gt;&lt;span style="font-family:Symbol; mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol"&gt;&lt;span style="mso-list:Ignore"&gt;&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Association :&lt;span style="mso-tab-count:1"&gt; &lt;/span&gt;Joining with the access point to transmit data to and fro.&lt;/p&gt;  &lt;p class="ListParagraph" style="margin-left:0in;text-indent:0in;mso-list:l0 level1 lfo1; tab-stops:list 35.35pt"&gt;&lt;span style="font-family:Symbol; mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol"&gt;&lt;span style="mso-list:Ignore"&gt;&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Network configuration:&lt;span style="font-size:12.0pt;font-family:&amp;quot;Liberation Serif&amp;quot;;mso-fareast-font-family: &amp;quot;DejaVu Sans&amp;quot;;mso-hansi-font-family:&amp;quot;Liberation Serif&amp;quot;;mso-bidi-font-family: &amp;quot;Lohit Hindi&amp;quot;;mso-font-kerning:.5pt;mso-ansi-language:EN-US;mso-fareast-language: HI;mso-bidi-language:HI"&gt; &lt;span style="font-size:100%;"&gt;After successfully get associated with Accesspoint, we need to configure IP address for the transmission of data using TCP/IP layer.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:&amp;quot;Liberation Serif&amp;quot;; mso-fareast-font-family:&amp;quot;DejaVu Sans&amp;quot;;mso-hansi-font-family:&amp;quot;Liberation Serif&amp;quot;; mso-bidi-Lohit Hindi&amp;quot;;mso-font-kerning:.5pt;mso-ansi-language: EN-US;mso-fareast-language:HI;mso-bidi-language:HIfont-family:&amp;quot;;font-size:12.0pt;"  &gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-6037566976947761746?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/6037566976947761746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2011/09/wi-fi-interview-questions-and-answers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/6037566976947761746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/6037566976947761746'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2011/09/wi-fi-interview-questions-and-answers.html' title='Wi-Fi interview Questions and Answers'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-1387122082741414649</id><published>2011-04-27T12:31:00.000-07:00</published><updated>2011-04-27T13:03:17.243-07:00</updated><title type='text'>Basic Intellectual Property Rights with Questions and Answers</title><content type='html'>Intellectual property: Set of rights in the form of patents, trademarks,  copyrights, Industrial Design, IC layout design, trade secret etc.&lt;br /&gt;&lt;br /&gt;Following are the Minutes of OME Community April meet on April,2011 Christ University, Bangalore.&lt;br /&gt;&lt;br /&gt;Patent: Rights given to a inventor, Some thing Industrially applicable, Mainly to protect idea.&lt;br /&gt;Trademark: Name of company, logo of company, Name which is used to sell a product.&lt;br /&gt;Copyright: Way in which a implementation is protected.&lt;br /&gt;Industrial design: Design of any thing like "shape of a soap".&lt;br /&gt;Trade Secret: To protect company secrets, In few companies some type of agreement is made with employees. presently no law is there.&lt;br /&gt;Plant Varieties: making changes in the existing things.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Registration of trademark&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Website for Registration is : www.ipindia.nic.in:&lt;br /&gt;This website contains a database for maintaining all trademarks, patents etc.&lt;br /&gt;&lt;br /&gt;Trademark registration comes under a particular class: There are 45 Classes.&lt;br /&gt;&lt;br /&gt;1 to 34 are comes in Goods. 35 to 45 comes in Services.&lt;br /&gt;&lt;br /&gt;Class 1  : Chemicals.&lt;br /&gt;Class 2  : paints.&lt;br /&gt;Class 3  : bleaching preparation.&lt;br /&gt;Class 4  : Industrial oils.&lt;br /&gt;Class 5  : Pharmaceutical and veterinary preparations.&lt;br /&gt;Class 6  : Common metals and alloys.&lt;br /&gt;Class 7  : Machines and machine tools.&lt;br /&gt;Class 8  : Hand tools.&lt;br /&gt;Class 9  : Digital.&lt;br /&gt;Class 10 : Surgical, medical, dental etc.&lt;br /&gt;Class 11 : lighting.&lt;br /&gt;Class 12 : Vehicles.&lt;br /&gt;Class 13 : firearms.&lt;br /&gt;Class 14 : precious metals and alloys.&lt;br /&gt;Class 15 : Musical Instruments.&lt;br /&gt;&lt;br /&gt;------------------------&lt;br /&gt;------------------------&lt;br /&gt;Class 34  : tobacco.&lt;br /&gt;Class 35  : Advertising.&lt;br /&gt;Class 36  : Insurance.&lt;br /&gt;Class 37  : Building construction.&lt;br /&gt;Class 38  : telecommunication.&lt;br /&gt;Class 39  : transport packaging.&lt;br /&gt;Class 40  : Treatment of materials.&lt;br /&gt;Class 41  : Scientific and technological services.&lt;br /&gt;Class 42  : Education.&lt;br /&gt;Class 43  : Food and drink etc.&lt;br /&gt;Class 44  : Medical services.&lt;br /&gt;Class 45 : Personal and social service.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Registration of Domain Name&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1) Domain name registrant.&lt;br /&gt;2) Agent provides domain name registration.&lt;br /&gt;3) owner or registrant of trademark.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Question and Answers:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1) what will happen any body registers a domain name with my company name?&lt;br /&gt;Answer: The registrar will send a mail regarding that.&lt;br /&gt;&lt;br /&gt;2) what is cyber Squatting?&lt;br /&gt;Answer: They allocate all the domain names earlier and they sell at higher price.&lt;br /&gt;&lt;br /&gt;3) What will happen if i register a trademark and don't use it?&lt;br /&gt;Answer: It gets deactivated automatically after a certain time.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Some facts about Intellectual property&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1) Agency need to notify owner for any changes.&lt;br /&gt;2) Before starting any business we must register a trademark.&lt;br /&gt;3) TM means: Application received, TM(R): Registered.&lt;br /&gt;4) In INDIA Copyright registration is done in DELHI, In America it is done online.&lt;br /&gt;5) If we file any case, you should be affordable to pay any losses.&lt;br /&gt;6) Before posting other content, we should take permission.&lt;br /&gt;7) while creating a copyright we should specify names of all authors.&lt;br /&gt;8) Don't publish any information before filing a patent.&lt;br /&gt;9) Write your own content for long term benefits.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Do's/ Don'ts of Social Media&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1) protect your Intellectual property.&lt;br /&gt;2) Aware of copyright, license and agreements.&lt;br /&gt;3) place appropriate Intellectual property Notices.&lt;br /&gt;4) Never use third party IP without permission.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Book:&lt;/span&gt; Intellectual Property rights by Narayanan.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Powertip&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1) focus.com&lt;br /&gt;2) Quixey is the Application search engine.&lt;br /&gt;3) Google panda.&lt;br /&gt;4) about.me similar to online business card.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-1387122082741414649?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/1387122082741414649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2011/04/basic-intellectual-property-rights-with.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/1387122082741414649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/1387122082741414649'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2011/04/basic-intellectual-property-rights-with.html' title='Basic Intellectual Property Rights with Questions and Answers'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-266842998398459419</id><published>2009-10-22T10:46:00.000-07:00</published><updated>2011-04-22T13:08:56.797-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personality Development'/><title type='text'>Good skills for people</title><content type='html'>All of us want good communication skills, interpersonal skills, social skills, leadership skills and soft skills. Success in any business, occupation or profession depends on 85% of people skills. Lot of people fail in life because they haven't mastered the skills with people. All your personality depends on relation with other people. To be more happy we should not be more intelligent.&lt;br /&gt;&lt;br /&gt;Following are important points in dealing with people.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1) Understanding the human ego.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the heart of everyone there is some thing which demands respect. We are more interested in ourselves. Every person wants to feel important. If you like yourself then you will like others. We should fulfill others ego by giving respect and approval. To get good from people, their basic needs should be fulfilled. For e.g. if a person is hungry, we should give him food first because they cannot give attention to other things. when the ego-hunger is satisfied and when they are in high self esteem they are cheerful, generous, tolerant and willing to listen to others. when self esteem is low they think negative, they talk a lot, they show-off ( deliberately behave to attract attention) and they become aggressive. With genuine compliments and real praise you can feed the ego of low esteem people. create the habit of giving five sincere compliments each day. Every person help or may not help depends on own ego. Help others like themselves better. Satisfy their hunger for self-esteem.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2) The importance of making others feel important.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It is within your power to make them like themselves better. It is within your power to make them feel appreciated and accepted. Always give respect and nice with people makes them feel important. You must recognize the other person. Give credit for suggestions. Encourage others. Don't criticize employees in front of others. Ask employees for their opinions. Inform employees for their progress. Think other people are important. when you are trying to deal with a group try to acknowledge everyone in group. Notice people when you get time. Don't try to compete with any one. If you want to impress any one let them know that you are impressed by them. when some body insults you, ask yourself  does it make any real difference. Don't try to win battles if it is related to ego.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3) Controlling the Actions and Attitudes of others:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   You have to adopt the attitude you want others to express. When you want to get out of an explosive situation keep your voice as soft as possible don't wait until other person gets angry. Always act confidently. To get confidence you have to believe in yourself and act confidently to get others belief in you. Moderate your tone of voice. smile from within.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4) Creating a good impression:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When you are dealing with others set the stage depends on situation. Before going to any kind of discussion ask yourself what do i really want from this. what mood i should have. create the tone according to that. Don't worry what others think because the world forms its opinion of us largely from the opinion we have of ourselves. If some body asks you in which company you are working, if u can't say the name of company say the quality of the company which you like. For e.g: I work in one of top five IT companies. Never go for competition with any one. If you want to make a good impression boost your own product. If you want others should yes to you, Good rule is ask some preliminary questions for which they must say yes. Then ask big question for which they say yes.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5) Acceptance, Approval and Appreciation:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Attracting people with Acceptance, Approval and Appreciation.&lt;br /&gt;Acceptance: Accept others as they are,&lt;br /&gt;Approval: See the things which are good in others.&lt;br /&gt;Appreciation: show their good values in them. some ways of appreciation are&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Don't keep them waiting.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If there is someone you cannot see immediately, acknowledge their presence.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Thank people.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Treat them as special.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;6) Communicate Effectively:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Get people talking about themselves.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Ask questions like Where are you from? what do you think of our weather? What business are you in? If any body says I work in a software company near to majestic. Don't ask directly about software company, ask first where is majestic. then ask which software company. Always show you are interested in themselves. If some body tells lets talk about yourself. what do u think about my working domain. topic is related to you but he is talking.&lt;/li&gt;&lt;li&gt;Talk about yourself when you are invited and asked. Talk little bit about yourself but don't overdo it. use me too technique. If someone says I was raised on a farm and you say "I was too". Any thing about you or your past that is similar to others will help them to like you. Always  use happy talk. If any thought disturbs you write it in a paper burn it, repeat it three times.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;7) Listening&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;when you are listening what they are saying, then they think that you are smart. Listening makes you clever. People will tell you what they want if you will listen. Listening helps overcome self-consciousness. You should know what people want, what they need and who they are in order to deal them effectively. Practice the art of listening:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;look at the person who is talking.&lt;/li&gt;&lt;li&gt;Nod your head&lt;/li&gt;&lt;li&gt;Lean forward&lt;/li&gt;&lt;li&gt;Ask questions.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Don't interrupt.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Stick to the speakers subject.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;8) Getting people to Agree:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Listen to them completely, pause before answering, Don't try to win 100%, State your idea moderately and accurately, Speak through third parties like Statistics, records, history and quotes. To say others are wrong say like this " I felt the same way about it at first, After getting more information it changed my complete picture.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Giving Praise: Thank people with their names by looking at them. If you want to be happy look good things in people. praise must be sincere, praise the act or attribute rather than the person.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;9) Criticizing others without offending them:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Criticism must be made in absolute privacy. Preface criticism with kind word or compliment, criticize the act, not the person. If you do any mistake say, I don't know what is expected of me. Ask for cooperation, don't demand it for e.g. Will you make these corrections?. One criticism to an offense ( don't criticize again and again) , Finish in a friendly fashion ( I know i can count on you).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-266842998398459419?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/266842998398459419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2011/04/good-skills-for-people.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/266842998398459419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/266842998398459419'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2011/04/good-skills-for-people.html' title='Good skills for people'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-790168994832015576</id><published>2009-09-23T00:35:00.000-07:00</published><updated>2010-05-27T12:16:36.288-07:00</updated><title type='text'>Networking Interview Questions and Answers</title><content type='html'>&lt;span style="color: rgb(153, 0, 0);"&gt;what is Socket? how it is created?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A socket is one end of a two-way communications link between two programs running on the network.&lt;br /&gt;&lt;br /&gt;Creation of sockets is done using the socket() system call.&lt;br /&gt;&lt;br /&gt;int socket(int address_family, int socket_type, int proto_family);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;address_family defines the type of addresses we want this socket to use.&lt;br /&gt;&lt;br /&gt;socket_type could be the type of interaction (and type or protocol) we want to use.&lt;br /&gt;&lt;br /&gt;proto_family selects which protocol we want to socket to use. We will usually leave this value as 0 (or the constant PF_UNSPEC on some systems), and let the system choose the most suitable protocol for us. As for the protocol itself, In the Internet address family, a socket type of SOCK_STREAM will cause the protocol type to be set to TCP. A socket type of SOCK_DGRAM (Datagram socket) will cause the protocol type to be set to UDP.&lt;br /&gt;&lt;br /&gt;The socket system call returns a file descriptor which will be used to reference the socket in later requests by the application program. If the call fails, however (due to lack of resources) the value returned will be negative (note that file descriptors have to be non-negative integers).&lt;br /&gt;&lt;br /&gt;As an example, suppose that we want to write a TCP application. This application needs at least one socket in order to communicate across the Internet, so it will contain a call such as this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int s;    /* descriptor of socket */&lt;br /&gt;s = socket(AF_INET, SOCK_STREAM, 0);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;How to Associate a connection with Socket?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After a socket is created, it still needs to be told between which two end points it will communicate. It needs to be bound to a connection. There are two steps to this binding. The first is binding the socket to a local address. The second is binding it to a remote (foreign) address.&lt;br /&gt;&lt;br /&gt;Binding to a local address could be done either explicitly, using the bind() system call, or implicitly, when a connecting is established. Binding to the remote address is done only when a connection is established. To bind a socket to a local address, we use the bind() system call, which is defined as follows:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int bind(int socket, struct sockaddr *address, int addrlen);&lt;br /&gt;&lt;br /&gt;There are 4 possible variations of address binding that might be used when binding a socket in the Internet address family.&lt;br /&gt;&lt;br /&gt;The first is binding the socket to a specific address, i.e. a specific IP number and a specific port. This is done when we know exactly where we want to receive messages. Actually this form is not used in simple servers, since usually these servers wish to accept connections to the machine, no matter which IP interface it came from.&lt;br /&gt;&lt;br /&gt;The second form is binding the socket to a specific IP number, but letting the system choose an unused port number. This could be done when we don't need to use a well-known port.&lt;br /&gt;&lt;br /&gt;The third form is binding the socket to a wild-card address called INADDR_ANY (by assigning it to the sockaddr_in variable), and to a specific port number. This is used in servers that are supposed to accept packets sent to this port on the local host, regardless of through which physical network interface the packet has arrived (remember that a host might have more than one IP address).&lt;br /&gt;&lt;br /&gt;The last form is letting the system bind the socket to any local IP address and to pick a port number by itself. This is done by not using the bind() system call on the socket. The system will make the local bind when a connection through the socket is established, i.e. along with the remote address binding. This form of binding is usually used by clients, which care only about the remote address (where they connect to) and don't need any specific local port or local IP address. However, there are exceptions here too.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;How to send and receive data from sockets?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;int read(int socket, char *buffer, int buflen);&lt;br /&gt;int write(int socket, char *buffer, int buflen);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The return value may be:&lt;br /&gt;&lt;br /&gt;0 - The connection was closed by the remote host.&lt;br /&gt;-1 - The read system call was interrupted, or failed for some reason.&lt;br /&gt;n - The read system call put 'n' bytes into the buffer we supplied it with.  &lt;span style="font-size:100%;"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;what are different types of Socket?&lt;/span&gt;&lt;br /&gt;Stream Sockets, Datagram Sockets, Raw Sockets, Packet Socket.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;what is ICMP?&lt;/span&gt;&lt;br /&gt;Internet control message protocol is used by hosts and gateway to send notifications of datagram problems to sender. It uses echo test to check whether it is responding or not.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;what is Router? How to Design a router?&lt;/span&gt;&lt;br /&gt;Router is used to route packets from one network to other.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;what is Gateway? How to Design a gateway?&lt;/span&gt;&lt;br /&gt;Conversion from one protocol to another.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;what is network protocol time?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Network Time Protocol (NTP) is a protocol for synchronising the clocks of computer systems over packet-switched, variable-latency data networks. NTP uses UDP as its transport layer. It is designed particularly to resist the effects of variable latency.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;what situation packet goes into infinite loop?&lt;/span&gt;&lt;br /&gt;If ttl value in IP header is not properly decremented at every router.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;what protocol is used to retrieve mails?&lt;/span&gt;&lt;br /&gt;POP3 and IMAP4 are used to retrieve mails.&lt;br /&gt;IMAP4 stores a copy of message on the server whereas POP3 does not.&lt;br /&gt;&lt;br /&gt;what is IP tunneling? how it works?&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;IP tunneling (IP encapsulation) is a technique to encapsulate IP datagram within IP datagrams, which allows datagrams destined for one IP address to be wrapped and redirected to another IP address. IP encapsulation is now commonly used in Extranet, Mobile-IP, IP-Multicast, tunneled host or network.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;what is tcp 3 way handshaking?&lt;/span&gt;&lt;br /&gt;Client starts active open after passive open in server side in TCP. The client sends SYNC, then the  server send SYNC+ACK, last client send ACK.&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;What are the different type of networking working devices?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;Repeater:&lt;br /&gt;Also called a regenerator, it is an electronic device that operates only at physical layer. It receives the signal in the network before it becomes weak, regenerates the original bit pattern and puts the refreshed copy back in to the link.&lt;br /&gt;&lt;br /&gt;Bridges:&lt;br /&gt;These operate both in the physical and data link layers of LANs of same type. They divide a larger network in to smaller segments. They contain logic that allow them to keep the traffic for each segment separate and thus are repeaters that relay a frame only the side of the segment containing the intended recipent and control congestion.&lt;br /&gt;&lt;br /&gt;Routers:&lt;br /&gt;They relay packets among multiple interconnected networks (i.e. LANs of different type). They operate in the physical, data link and network layers. They contain software that enable them to determine which of the several possible paths is the best for a particular transmission.&lt;br /&gt;&lt;br /&gt;Gateways:&lt;br /&gt;They relay packets among networks that have different protocols (e.g. between a LAN and a WAN). They accept a packet formatted for one protocol and convert it to a packet formatted for another protocol before forwarding it. They operate in all seven layers of the OSI model.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;what is frame relay? which layer it comes?&lt;/span&gt;&lt;br /&gt;Frame relay is a packet switching technology, it comes in data link layer.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;what are the names of PDU in higher layers?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Transport layer: segment.&lt;br /&gt;Network Layer: packet.&lt;br /&gt;Data link layer: frames.&lt;br /&gt;Physical layer: bits/ bytes.&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-790168994832015576?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/790168994832015576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2010/05/networking-interview-question-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/790168994832015576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/790168994832015576'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2010/05/networking-interview-question-and.html' title='Networking Interview Questions and Answers'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-4529011016243576994</id><published>2009-09-10T10:11:00.000-07:00</published><updated>2009-09-19T07:59:01.784-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Embedded Developer'/><title type='text'>How to Debug Using gdb</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Debugger&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;After executing the binary executable we some times get unexpected results. The errors may be of dangling pointers, Stack over flow, Divide by zero etc, Which are very difficult to debug by looking at the Source code. GDB is a tool to debug the program it supports various languages like c,c++ etc.&lt;br /&gt;&lt;br /&gt;gdb can take core dump file or executable file. Here executable is executed in the context of gdb. To debug using gdb at compilation time we have to give -g option.&lt;br /&gt;&lt;br /&gt;gcc -g source.c -o source&lt;br /&gt;&lt;br /&gt;Note: Electrical fence is used to check boundary errors. like size of array is 30 and we are storing value at 40 th location.&lt;br /&gt;gcc source.c -lefence&lt;br /&gt;&lt;br /&gt;After allocating memory using malloc, Always allign the memory using memalign. To avoid type casting.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Running&lt;/span&gt; a executable in gdb: gdb a.out&lt;br /&gt;The you will get a gdb prompt.&lt;br /&gt;The following commands has to be typed at gdb prompt.&lt;br /&gt;&lt;br /&gt;run or r is used to run the program.&lt;br /&gt;step is used to step by step execution, it also oes inside the function.&lt;br /&gt;next is used to avoid function debug.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;passing parameters: set args fastrevision blogspot&lt;br /&gt;showing the arguments: show args&lt;br /&gt;debug a already running program: attach process-id.&lt;br /&gt;To get information about threads: info threads&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Checkpoint&lt;/span&gt;:  Setting a book mark to return that place easily.&lt;br /&gt;checkpoint [lineno][function name]&lt;br /&gt;during creation of checkpoint it saves all register, Stack values , Variables etc.&lt;br /&gt;&lt;br /&gt;After executing some code.&lt;br /&gt;&lt;br /&gt;To return back to check point: restart checkpoint-ID.&lt;br /&gt;To know information about checkpoints: info checkpoints.&lt;br /&gt;To delete checkpoint: delete checkpoint checkpoint-ID.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Listing of Program&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;To know your program where it is currently Running.&lt;br /&gt;gdb&gt; list&lt;br /&gt;&lt;br /&gt;Note: To know the return value of previously executed program.&lt;br /&gt;echo $?&lt;br /&gt;Successful execution returns 0. Abnormal termination of program returns more than 0.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Breakpoint&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To break the progrm after executing for some time. break command is used. For eg:&lt;br /&gt;break lineno, function Name, Address.&lt;br /&gt;while giving line numbers it always takes the first default file. To specify the file.&lt;br /&gt;break file.c:&lt;lineno&gt;&lt;br /&gt;&lt;br /&gt;To add some condition: break 14 if ptr==0&lt;br /&gt;To break the program only once: tbreak lineno&lt;br /&gt;To get information about breakpoints: info breakpoints.&lt;br /&gt;To ignore break point for some time: ignore breakpoint_no count.&lt;br /&gt;To clear the breakpoint: clear [location][function name].&lt;br /&gt;To disable break points: disable [breakpoints] [1..10]&lt;br /&gt;To enable break points: enaable [breakpoints] [1..10]&lt;br /&gt;We can execute some commands when it reaches a break point. By giving commands and end.&lt;br /&gt;Commands is used to give commands which are in between commands and end to shell prompt.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Watch Points&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/lineno&gt;To know what are the values. expression may be location,variable etc.&lt;br /&gt;watch expression&lt;br /&gt;rwatch expression&lt;br /&gt;awatch expression&lt;br /&gt;info watchpoints&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;To get information&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;ptype a: display what is the type of a.&lt;br /&gt;info main&lt;br /&gt;info source.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-4529011016243576994?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/4529011016243576994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/09/how-to-debug-using-gdb.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/4529011016243576994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/4529011016243576994'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/09/how-to-debug-using-gdb.html' title='How to Debug Using gdb'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-8315548529512972425</id><published>2009-09-05T09:51:00.000-07:00</published><updated>2010-05-23T11:34:05.108-07:00</updated><title type='text'>Internet Protocol of TCP/IP</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Internet Protocol&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;IP packets are send by the help of TCP, UDP, ICMP etc. The IP packets are connection less and unreliable. if any problem occurs in network( like router is not responding ) it simply sends ICMP packet to the source. The reliability is provided by upper layers i.e TCP.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The IP header&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_hVN2cfw3Hzo/SqKcMc5y32I/AAAAAAAAAA8/KejVL2mVq4M/s1600-h/IP-Header.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_hVN2cfw3Hzo/SqKcMc5y32I/AAAAAAAAAA8/KejVL2mVq4M/s400/IP-Header.gif" alt="" id="BLOGGER_PHOTO_ID_5378032642764758882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The most significant is at 0 and least significant bit at 31. Hence it is called big-endian byte order.&lt;br /&gt;Data is transmitted from left to right i.e from 0 to 31.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Vers&lt;/span&gt;: It tells what version of IP packet it may be 4 or 6 according to the requirement.&lt;br /&gt;IHL: The no of 32 bit words used in the header including any options. Normal value for this field is 5.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;TOS&lt;/span&gt;: This tells the type of service of the packet. It tells minimum delay, maximum throughput, maximum reliability, minimize monetary cost. XXXUUUU0.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Total Length&lt;/span&gt;: This is the total length of IP Datagram in bytes. It is possible to send 65535 size packets, but the link layer divides in into small packets using fragmentation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Indentification&lt;/span&gt;: This value is increased while sending packets continuously. This is mainly used in fragmentation. Reassembly program at the other end is used to combine the fragmented packets.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Time to live&lt;/span&gt;:A no which tells the no of routers through which this IP datagram is passed. When ii reaches to zero. The send is informed with an ICMP message indicating destination is not reachable.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Protocol&lt;/span&gt;: Which protocol gave the data to IP to send.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Option Field&lt;/span&gt;: This field is defined for&lt;br /&gt;Security and handling restrictions.&lt;br /&gt;Record route: Each router record its IP Address.&lt;br /&gt;Time stamp: ( how long the router will keep the recorded IP Address).&lt;br /&gt;loose Source routing : Specifies list of IP Address that must be traversed by datagram.&lt;br /&gt;strict source routing : Specifies the list of fixed ip Address to be traversed. ( It is rarely used, All router may or may not use this feature).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Subnetting&lt;/span&gt;: The process of dividing hostid into small subnets is called subnetting.&lt;br /&gt;&lt;br /&gt;eg:&lt;br /&gt;IP Address: 192.168.40.33, subnet Mask: 255.255.255.224 this means each subnet network is in the gap of 32 Addresses.&lt;br /&gt;therefore subnet ID is : 192.168.40.32 and host ID is: 1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-8315548529512972425?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/8315548529512972425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/09/internet-protocol-of-tcpip.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/8315548529512972425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/8315548529512972425'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/09/internet-protocol-of-tcpip.html' title='Internet Protocol of TCP/IP'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_hVN2cfw3Hzo/SqKcMc5y32I/AAAAAAAAAA8/KejVL2mVq4M/s72-c/IP-Header.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-6894371376919850161</id><published>2009-09-05T01:35:00.000-07:00</published><updated>2011-04-22T13:08:56.798-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personality Development'/><title type='text'>How to Achieve Success in Life</title><content type='html'>Success can be many things, Success means better life, Success means finding real happiness, Remember one thing size of success is limited to size of thinking. If you think small your success is also small or if you think big and believe in yourself your success will be big.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Belief : Always think positive, Person belief is known by the way he talks,walks and acts. you grows small in the group of people if you don't have belief what you do. Always generate positive thoughts from your mind. you can't sell a product if you can't believe in yourself. All discoveries are made because they have self belief in themselves. Successful people are ordinary people they believe in themselves what they do.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;This is some thing which takes time, No body going to help you, you have to work hard and achieve it. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Three components are important in life. What you are going to do. How you accomplish your goal and the results will be greater respects from your friends and family,  greater status, Increase in income and standard of living is higher.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;The place you work is a laboratory, It includes the people you work, you talk and yourself. This place is for you to work to achieve your goal. See the difference in successful and unsuccessful persons.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;The more successful the person is, The more less excuses he makes. Every unsuccessful person says I don't have time I am fully busy. Every body has got 24 hours it mainly depends how they utilize it effectively. In a year you have got 8760 hours.Total hours sleeping in a year= &lt;img src="file:///C:/DOCUME%7E1/robot/LOCALS%7E1/Temp/moz-screenshot.jpg" alt="" /&gt;2738.Total hours eating in a year= 730. Total hours in phone and chatting = 900. Total hours in traveling = 730. If a person is spending this much of time in all these activities, why they are saying I don't have time. Successful people don't say i don't have time. Successful people always like to face challenges. A successful person knows success is a extra effort and hard work.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Successful people never tell any health excuses. No body is interested to know about your health. If you say i feel great you get more confidence in yourself.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Always be happy with what you have. For example if you are getting less pay, you can say at least i have job for living.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Never give age excuses like i am too old to do this or I am too young to do this. There are lot of people who got success after lot of age. Age is not a barrier it is an excuse. Believe that you can handle any kind of responsibility.The productive age is from 20 to 70. Invest your future time in really what you want to do.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;The only thing you should have interest and enthusiasm. Its not important how much intelligence you have.It is most important how you use your intelligence. Attitude is more important than intelligence. Always think the better ways of doing things. Always use your mind to get solution.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;People are measured not by their money, family support, friends or job he is doing. People are measured the way they think. Clearing all obstacles which stop you to think big. Think what are your major attributes that helps you in getting success. For example if anybody else is getting promotion compare with him what are the qualities you are lacking. Try to improve those qualities for e.g. if your colleague has good communication skills and try to improve that one to add in yours assets for getting success. you create a kind of your image in others with the words you speak. So always use positive words.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Practicing give value to things around you. If you give value to these things then you can also give value to peoples. Small things matters for a Successful person.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Also think creative. new, better and improved ways of doing things. Success at home, work and society are important.They are many creative ways of doing things.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Before you begin your work think how can i do better work today. Improve quality and quantity of your work.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Eliminate the word impossible from your thinking and speaking vocabulary. Take a task which is difficult and write down the reasons you can't do it. Try to work out on the reasons. Man goes where he wants to go. Take risk in doing the things. There is no one best way to do things. Always welcome new ideas. Expose yourself to new restaurants, New books, new friends. Do some thing different in weekends. Be progressive. Get up a hour earlier for planning the daily activities.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Achieving high level of success requires support of others. To achieve support of others: See things from their eyes, think as if your in the other side. Always handle the things as a human way.&lt;/li&gt;&lt;li&gt;Being a good listener is very important in life. Listening gives us more information to make important decisions. To practice listening encourage others to talk in personal or group meetings. Ask about tell me about your experiences, what you think to done about this and what you think the key point here. Do information research. Concentrate in others what they said. Always ask yourself how you can I do this better, how can i do more.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Fear is biggest enemy. It decreases our mental ability. It makes people sick. It closes your mouth when you want to speak in public. No one is born with confidence. Action cures fear. Before taking action think that is it correct and human way of doing things. When ever you feel fear think that what kind of action I should take to avoid fear. There are some fears which can't be avoidable in such time play with small kids, go for a movie, Put some extra work in some special project. Biggest fear is that what other people say and think about you.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Give value to your ideas by acting in it. Action improves your confidence. Before thinking of task. Go and do that task. for e.g. Going for a Movie. Doing exercise etc. Be active not passive. Be a doer. Don't wait until the conditions are perfect to act. Get more ideas but these ideas are valid when you act on it.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Successful people meets the problems and work out on difficulties when they do arise. Cross bridge when you come on it.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Always store positive thoughts in mind. Always think about positive things that happened with you through out the day before you go to bed. Always think positive if you get negative thoughts try to divert you mind from that.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Fear on other people is a big fear. To overcome that fear you have to keep the people in proper prospective. Other people are basically like you so there is no reason to fear. Other person is important as much as you are. Every person as his own problems, desires etc. Understanding attitude is very important in life if some body insults you and scolds you simply think that this person is having a bad day. Control your fire. We can change our attitude by changing our physical attitude.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Always sit in front seat. Always maintain eye contact. walk 25% faster. practicing speaking up. Speak up at every opportunity. Every open meeting you attend speak up. Every family gathering speak up. Make a contribution. Make a suggestion. Ask a question. Speak slowly and clearly. Smile big to improve your confidence.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-6894371376919850161?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/6894371376919850161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/09/how-to-achieve-success-in-life.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/6894371376919850161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/6894371376919850161'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/09/how-to-achieve-success-in-life.html' title='How to Achieve Success in Life'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-4932894286385576769</id><published>2009-08-27T11:06:00.000-07:00</published><updated>2009-09-11T11:33:27.502-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Embedded Developer'/><title type='text'>Static and Dynamic Linker</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Linker&lt;/span&gt;: A program that links one or more object or relocatable files and results in binary executable. Linking done in two forms.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Static linking&lt;/span&gt;:&lt;br /&gt;Executable built with libraries at build time. Every time we create a new executable depending on platform.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Dynamic linking&lt;/span&gt;:&lt;br /&gt;Linking with libraries at run time. Easy designing, change of code, update etc. These files are first loaded in memory and then linked. Dynamic code is shared between multiple applications.&lt;br /&gt;&lt;br /&gt;Important library for C programming is libc.&lt;br /&gt;&lt;br /&gt;The library file created with extension .a or .so .&lt;br /&gt;In UNIX environment file name having .a extension called as static library and for .so as dynamic library.&lt;br /&gt;&lt;br /&gt;In windows environment dynamic library as .dll extension and static as .libs extension.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Creating a Static and dynamic library in LINUX:&lt;br /&gt;&lt;/span&gt;Tool for creating library is ar (library compressed tool).&lt;br /&gt;&lt;br /&gt;create source files like first.c and second.c&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;create relocatable executable files like&lt;br /&gt;gcc -c first.c -o first.o&lt;br /&gt;gcc -c second.c -o second.o&lt;br /&gt;ar rcs lmine.a first.o second.o&lt;br /&gt;&lt;br /&gt;Note: rcs stands replace create symbol(variable,function name etc).&lt;br /&gt;&lt;br /&gt;Relocatable binary is created in two forms.&lt;br /&gt;position dependent.&lt;br /&gt;position independent.&lt;br /&gt;&lt;br /&gt;Above created static library is position dependent.&lt;br /&gt;Position independent code can be created using&lt;br /&gt;gcc -c -fpic first.c -o first.o&lt;br /&gt;gcc -c -fpic second.c -o second.o&lt;br /&gt;&lt;br /&gt;gcc -shared -o libmine.so first.o second.o&lt;br /&gt;&lt;br /&gt;files which showed in green color required permision for load.&lt;br /&gt;&lt;br /&gt;/usr/lib is a default libary repository.&lt;br /&gt;/usr/include is a default header repository.&lt;br /&gt;&lt;br /&gt;while using the static or dynamic library we have to create a header file which contains the function prototype.&lt;br /&gt;&lt;br /&gt;gcc -I./ app.c -o app&lt;br /&gt;&lt;br /&gt;search for include files in current directory.&lt;br /&gt;for using library&lt;br /&gt;gcc app.o -o app -lmine.a&lt;br /&gt;it search in default directory /usr/lib&lt;br /&gt;for  searching in current directory.&lt;br /&gt;gcc -c app.o -o app ./mine.a&lt;br /&gt;&lt;br /&gt;here we can see, it is having static library but it is also linking some dynamic library called libc etc.&lt;br /&gt;&lt;br /&gt;for linking statically give -static option during creation of binary executable.&lt;br /&gt;when we find the object dump we get more information how it linked.&lt;br /&gt;&lt;br /&gt;objdump -D app | more&lt;br /&gt;&lt;br /&gt;linker creates procedure address table, It contains dynamically linked function and address of it.&lt;br /&gt;&lt;br /&gt;Dynamic or Shared libraries can be used by an application as a load time library or run time library. Load time library mainly loaded during init.&lt;br /&gt;&lt;br /&gt;load time libraries are those which are loaded during process initialization and remains resident through out the process execution time.&lt;br /&gt;&lt;br /&gt;libraries are called as run time when they are loaded by functionality.&lt;br /&gt;it mainly avoid direct reference to library.&lt;br /&gt;&lt;br /&gt;for example the source is in mandl.c&lt;br /&gt;&lt;br /&gt;void (*ptr) ( void);&lt;br /&gt;&lt;br /&gt;void *libptr=dlopen("./mylib.so",RTLD_NOW);&lt;br /&gt;ptr=dlsym(libptr,"func");&lt;br /&gt;ptr(void);&lt;br /&gt;dlclose(libptr);&lt;br /&gt;gcc mandl.c -o mandl -ldl&lt;br /&gt;&lt;br /&gt;RTLD_LAZY is used when it takes much time in execution.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Binary Image&lt;/span&gt;:&lt;br /&gt;Binary image are of 3 types.&lt;br /&gt;&lt;br /&gt;1) Linkable( relocatable).&lt;br /&gt;2) Loadable( shared library with position independent).&lt;br /&gt;3) Executable( functionality + runtime ).&lt;br /&gt;&lt;br /&gt;functionality further divided into instruction and data.&lt;br /&gt;each part of binary image is loaded into each block of memory(stack, BSS, Code and data).&lt;br /&gt;To read the header information of binary file objdump or readelf is used.&lt;br /&gt;&lt;br /&gt;.text contains all instructions.&lt;br /&gt;.data contains only initialized global variable, static variables etc.&lt;br /&gt;.bss uninitialized global data.&lt;br /&gt;.rodata contains read only data. No write operation performed in this.&lt;br /&gt;other sections are linker specific.&lt;br /&gt;each .o file has section header table.&lt;br /&gt;linker combines all section header table into single program header table with matching the same flags.&lt;br /&gt;&lt;br /&gt;The header table in executable binary is called program header table.&lt;br /&gt;loader mainly use this header table to load into process address space.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Various flags in sections.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;PROGBITS: code,data,debug information.&lt;br /&gt;SYMTAB and DYNSYM: Symbol table.&lt;br /&gt;STRTAB: String table.&lt;br /&gt;etc.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How a binary executable loaded into memory.&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Think that we want to execute program1.For execution we have to write ./program1&lt;/li&gt;&lt;li&gt;The shell receives this request to run a program, Checks for the existence of file.&lt;/li&gt;&lt;li&gt;It verifies the Application Binary Interface(ABI). To know ABI type readelf -a&lt;/li&gt;&lt;li&gt;It every thing is fine it call loader to load the program.&lt;/li&gt;&lt;li&gt;Loader checks the program header table part of elf header.&lt;/li&gt;&lt;li&gt;Using the kernel memory allocator it allocates memory block in user space and maps the segments in executable image.&lt;/li&gt;&lt;li&gt;Calls the kernel process manager to carry process registration.&lt;/li&gt;&lt;li&gt;It allocates structures to keep track of information i.e TCB ( task control block)  named as task_struct.&lt;/li&gt;&lt;li&gt;A valid process id is given.&lt;/li&gt;&lt;li&gt;The process control block is en queued to run queue. ( depends on different queue different run queues are used).&lt;/li&gt;&lt;li&gt;Depending on the scheduler it selects PCB from run queue.&lt;/li&gt;&lt;li&gt;During runtime it adds a section named as stack.&lt;/li&gt;&lt;/ul&gt;Application Booting up Procedure:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Booting of application starts with an init routine. Initializer is responsible for intilising of stack segment and loading of shared objects or libraries. Link loader is resposible for loading all shared libraries.&lt;/li&gt;&lt;li&gt;Before loading it resolves all symbols of program header table. During loading of shared libraries symbol entries in PL table are updated with absolute address.&lt;/li&gt;&lt;li&gt;after initialization it calls main program.&lt;/li&gt;&lt;li&gt;Process detach is responsible for detaching shared libraries from process. It also releases the stack segment assigned to it.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-4932894286385576769?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/4932894286385576769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/08/static-and-dynamic-linker.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/4932894286385576769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/4932894286385576769'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/08/static-and-dynamic-linker.html' title='Static and Dynamic Linker'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-1774349618914171481</id><published>2009-08-26T11:20:00.000-07:00</published><updated>2009-09-26T11:08:07.928-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Embedded Developer'/><title type='text'>Stages of Compilation in Linux</title><content type='html'>A Source file is compiled and linked to form a executable binary file for execution in a architecture.Understanding the various stages of compilation helps in cross compilation of code.&lt;br /&gt;for e.g. below steps shows compilation process using GCC compiler.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Source file&lt;/span&gt;:&lt;br /&gt;It contains the Source program in text format. it can be of any langaue c,c++ etc.&lt;br /&gt;for e.g. first.c is a C Source code.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Preprocessing&lt;/span&gt;:&lt;br /&gt;it helps in creating fast and efficient code.&lt;br /&gt;It reads from header files for creating a preprocessed source file.&lt;br /&gt;All macros and constant symbols are replaced.&lt;br /&gt;All conditional preprocessor directives are processed by preprocessor.&lt;br /&gt;It provides conditional compilation.&lt;br /&gt;&lt;br /&gt;gcc  -E first.c -o first.i&lt;br /&gt;&lt;br /&gt;The know the steps of preprocessing in console. compile using&lt;br /&gt;gcc  -v -E first.c  -o first.i&lt;br /&gt;v stands for verbose.  &lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;Assembler&lt;/span&gt;: Takes preprocessed file and creates .s file called as assembly file.&lt;br /&gt;it is mainly required for optimization(speed and space) of code.&lt;br /&gt;for e.g. gcc -v -S  first.i -o first.s&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Relocatable Binary&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;gcc -c first.s -o first.o&lt;br /&gt;Contains offset address of the assembly code, it is assigned at compile time.&lt;br /&gt;object dump of first.o shows offset address.&lt;br /&gt;for eg: A relocatable code contains call 19 &lt;&gt; .Its position depends on main position.&lt;br /&gt;This file contains source in assembly and library routines.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Executable Binary&lt;/span&gt;:&lt;br /&gt;gcc first.o by default it creates a.out else we can give as gcc first.o -o first&lt;br /&gt;&lt;br /&gt;This loadable file contains loadable address in the form of segment and offset called as absolute address.Function calls entries present in PLT called as procedure linkage table.&lt;br /&gt;executable file contains some run time library. This file is mainly created by linker which is OS dependent.&lt;br /&gt;&lt;br /&gt;From executable binary to loadable binary code is created by&lt;br /&gt;objdump -D first&lt;br /&gt;for seeing in page wise- objdump -D first | more&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;File Format&lt;/span&gt;: To know the format of file, file command is used.&lt;br /&gt;&lt;br /&gt;for e.g.&lt;br /&gt;file first.c&lt;br /&gt;it shows as text file.&lt;br /&gt;&lt;br /&gt;file first.i&lt;br /&gt;it shows as text file.&lt;br /&gt;&lt;br /&gt;file first.s&lt;br /&gt;it shows as Assembly file.&lt;br /&gt;&lt;br /&gt;file first.o&lt;br /&gt;it shows as binary file.&lt;br /&gt;&lt;br /&gt;These set of tools are called tool chain. Cross compilers mainly required for executing the code in different architectures. The object dump of binary executable contains the loadable address.&lt;br /&gt;&lt;br /&gt;The creation of files from .c to .o is can be used in any architecture.&lt;br /&gt;.exe or binary executable is platform and architecture specific.&lt;br /&gt;&lt;br /&gt;The executable has three flags:&lt;br /&gt;suid: process keeps information about uid. if this flag is set.&lt;br /&gt;sgid: process keeps information about gid. if this flag is set.&lt;br /&gt;sticky: if this flag is set means requesting kernel to keep in memory after execution.&lt;br /&gt;&lt;br /&gt;during execution of executable binary it is stored in process address space.&lt;br /&gt;process address space contains different segments of memory like data,code,stack etc.&lt;br /&gt;&lt;br /&gt;During runtime three key functions are performed.&lt;br /&gt;--&lt;span style="font-weight: bold;"&gt;init&lt;/span&gt;&lt;br /&gt;  Resource allocation is done here.it calls different resource allocation routines.it calls specific kernel system calls.&lt;br /&gt;&lt;br /&gt;--&lt;span style="font-weight: bold;"&gt;start&lt;br /&gt; &lt;/span&gt;make a call to main and handover the control to functionality.&lt;br /&gt;&lt;br /&gt;--&lt;span style="font-weight: bold;"&gt;fini&lt;/span&gt;&lt;br /&gt;release of all resources allocated by init.&lt;br /&gt;&lt;br /&gt;if system is crashed due to some bug in the kernel modules. The --fini routine is not called and resources are not deallocated. The parent will become a zombie process and performs all cleanup.&lt;br /&gt;&lt;br /&gt;relocatable code is executed in various platform by a interface called as Runtime.&lt;br /&gt;(Relocatable code .o file) functionality-&gt;unix runtime-&gt;binary(elf format with no extension)-&gt; unix OS.&lt;br /&gt;(Relocatable code .obj file) functionality-&gt;windows runtime-&gt;binary(coff format with .exe  extension)-&gt;Windows OS.&lt;br /&gt;&lt;br /&gt;Runtime layer also called as Application Binary Interface.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-1774349618914171481?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/1774349618914171481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/08/stages-of-compilation-in-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/1774349618914171481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/1774349618914171481'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/08/stages-of-compilation-in-linux.html' title='Stages of Compilation in Linux'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-4888206878383654991</id><published>2009-07-07T12:03:00.000-07:00</published><updated>2009-09-19T08:21:59.649-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Embedded Developer'/><title type='text'>Linux Device Drivers Introduction</title><content type='html'>Linux started as the hobby of a Finnish college student named as Linus Torvalds in 1991. Early it supported 386 processor later it is metamorphed to support multiple architectures some of the major supported architecture are X86, IA64, ARM, PowerPC, Alpha, SPARC etc.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Linux Kernel&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;Linux is an open source kernel maintained by a set of software volunteers called kernel hackers.&lt;br /&gt;It is developed by different open source developers across the world.&lt;br /&gt;&lt;a href="http://www.kernel.org/"&gt;www.kernel.org&lt;/a&gt; is a official website for  kernel source code under a license called GPL(general public license).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Advantages of Linux&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Free of cost, Fully customizable in all its components, Linux is powerful, It has low failure rate, We can reduce kernel image to a small size, highly compatible to many operating systems, well supported.&lt;br /&gt;The linux source code has one folder named as arch. Which contains names of all platforms. for e.g. alpha, arm, cris, i386 etc.&lt;br /&gt;&lt;br /&gt;e.g. of linux source having version 2.6.10.1 means,&lt;br /&gt;first number 2 rarely change.&lt;br /&gt;second number 6 shows stable.&lt;br /&gt;third no shows added new code.&lt;br /&gt;fourth no shows solution to bugs by putting patches.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Types of Kernel&lt;/span&gt;:&lt;br /&gt;&lt;p&gt; Kernels can be classified into four broad categories: &lt;i&gt;monolithic kernels&lt;/i&gt;, &lt;i&gt;microkernels&lt;/i&gt;, &lt;i&gt;hybrid kernels&lt;/i&gt; and &lt;i&gt;exokernels&lt;/i&gt;.&lt;br /&gt;&lt;/p&gt;  &lt;p&gt; &lt;span style="font-weight: bold;"&gt;Monolithic kernels:&lt;/span&gt; Which have traditionally been used by Unix-like operating systems, contain all the operating system core functions and the &lt;i&gt;device drivers.&lt;/i&gt; Modern monolithic kernels, such as those of Linux and FreeBSD, both of which fall into the category of Unix-like operating systems, feature the ability to load &lt;i&gt;modules&lt;/i&gt; at runtime, thereby allowing easy extension of the kernel's capabilities as required, while helping to minimize the amount of code running in kernel space. &lt;/p&gt;  &lt;p&gt;A &lt;span style="font-weight: bold;"&gt;microkernel&lt;/span&gt; usually provides only minimal services, such as defining memory address spaces, interprocess communication (IPC) and process management. All other functions, such as hardware management, are implemented as processes running independently of the kernel. Examples of microkernel operating systems are AIX, BeOS, Hurd, Mach, Mac OS X&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt; and MINIX. Applications cannot access other memory address space without API's. Accessing a device require many context switches.&lt;br /&gt;&lt;/p&gt;    &lt;p&gt; &lt;span style="font-weight: bold;"&gt;Hybrid kernels&lt;/span&gt; include additional code in kernel space to share common data in single address space. It mainly avoid context swithes. Most modern operating systems use hybrid kernels, including Microsoft Windows NT, 2000 and XP.&lt;br /&gt;&lt;/p&gt;    &lt;p&gt; &lt;span style="font-weight: bold;"&gt;Exokernels&lt;/span&gt; are a still experimental approach to operating system design. They provide no hardware abstractions on top of which applications can be constructed. This separation of hardware protection from hardware management enables application developers to determine how to make the most efficient use of the available hardware for each specific program. Exokernels in themselves they are extremely small. However, they are accompanied by &lt;i&gt;library operating systems&lt;/i&gt;, which provide application developers with the conventional functionalities of a complete operating system. A major advantage of exokernel-based systems is that they can incorporate multiple library operating systems, each exporting a different API (application programming interface), such as one for Linux and one for Microsoft Windows, thus making it possible to simultaneously run both Linux and Windows applications. &lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Platform virtualization&lt;/span&gt; :&lt;/p&gt;&lt;p&gt;It hides the physical characteristics of operating system from the users,&lt;sup id="cite_ref-0" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Platform_virtualization#cite_note-0"&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;it shows aother platform for running other platforms.&lt;/p&gt;&lt;p&gt;types :&lt;/p&gt;&lt;p&gt;Full virtualization: without modifying of OS.&lt;/p&gt;&lt;p&gt;Hardware Assisted virtualization: separate Hardware support is needed.&lt;/p&gt;&lt;p&gt;Partial virtualization: Address space virtualization.&lt;/p&gt;&lt;p&gt;Para virtualization : API's are provided between virtual machine and hardware.&lt;/p&gt;&lt;p&gt;Operating system level virtualization: OS is modified to run various paltforms.&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Linux Vendors(Distributors)&lt;/span&gt;:&lt;/p&gt;&lt;p&gt;kernel source is modified to create different operating systems.&lt;/p&gt;&lt;p&gt;1) Server OS: RHEL(Red Hat Enterprise Linux).&lt;/p&gt;&lt;p&gt;2) Desktop Distribution: Fedora, General Ubuntu, Suse linux, Centos.&lt;/p&gt;&lt;p&gt;3) Multimedia OS: Debian linux, Qlinux.&lt;/p&gt;&lt;p&gt;4) Embedded Distribution: monto Vista, Bluecat linux.&lt;/p&gt;&lt;p&gt;5) Real time linux: timesys,linco,Vxworks,uClinux,Windriver.&lt;/p&gt;&lt;p&gt;6) Mobilisation : Android OS.&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Evaluation Assurance Level&lt;/span&gt;:&lt;/p&gt;&lt;p&gt;At what level the system was testing to meet the goal. It has EAL1 to EAL7 levels.&lt;/p&gt;&lt;p&gt;     EAL1: Functionally Tested.&lt;br /&gt;    EAL2: Structurally Tested.&lt;br /&gt;    EAL3: Methodically Tested and Checked.&lt;br /&gt;    EAL4: Methodically Designed, Tested, and Reviewed.&lt;br /&gt;    EAL5: Semiformally Designed and Tested.&lt;br /&gt;    EAL6: Semiformally Verified Design and Tested.&lt;br /&gt;    EAL7: Formally Verified Design and Tested.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-4888206878383654991?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/4888206878383654991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/07/linux-device-drivers-introduction.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/4888206878383654991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/4888206878383654991'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/07/linux-device-drivers-introduction.html' title='Linux Device Drivers Introduction'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-3995273386919883832</id><published>2009-07-07T11:47:00.000-07:00</published><updated>2009-08-27T12:01:15.521-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Glossary'/><title type='text'>Glossary</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Absolute Path: &lt;/span&gt;&lt;span&gt;Path from root or drive is called Absolute path or Complete path. In Linux it started as / .&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Device Driver&lt;/span&gt;: Small programs that allow the operating system to interact with hardware devices, such as disk drives, video cards and printers.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PCMCIA&lt;/span&gt;&lt;b&gt;:&lt;/b&gt; Personal Computer Memory Card International Association is a small card attached with PC for wireless connectivity and other features.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Relative Path&lt;/span&gt;:&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;/span&gt;A path from current directory. for e.g. in linux it is showed as ./ .&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Router&lt;/span&gt;: A device which connects two networks.IP packets are sent to one network, if the destination not present in that network than it is passed to other network.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;IETF&lt;/span&gt;: Internet Engineering task force tells about the requirements in protocol.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;TIMERS&lt;/span&gt;: Timers are mainly required to invoke specific periodic functions called restransmissions, Delayed acknowledgement or round trip time.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Round Trip Time&lt;/span&gt;: After sending packet the sender times how much time it take to get acked.if failed to get ack. Stack increses RTO( Retransmission time out).further after increasing RTO if we won't get any ack,RTO is increased again this process of increasing RTO for retransmission is called back-off.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;VSSC&lt;/span&gt;: Vikram Sarabhai Space Center at Tiruvanthapuram is responsible for the launch vehicles.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-3995273386919883832?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/3995273386919883832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/07/glossary.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/3995273386919883832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/3995273386919883832'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/07/glossary.html' title='Glossary'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-3056328186776849924</id><published>2009-07-05T11:55:00.000-07:00</published><updated>2009-08-25T11:58:26.850-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='English learning'/><title type='text'>Common English Sentences for Speaking</title><content type='html'>I sleep late.&lt;br /&gt;Early evening i like to have snacks.&lt;br /&gt;while working i took siesta some times.&lt;br /&gt;Sometimes people scoff at me when i talk.&lt;br /&gt;Maximum all americans are blondes.&lt;br /&gt;all our friends are in congregation in lunch time.&lt;br /&gt;I was a copycat in the age of 17.&lt;br /&gt;A mental person was taken to asylum.&lt;br /&gt;I beg your pardon.&lt;br /&gt;Excuse me for disturbing you at home.&lt;br /&gt;I'm sorry to disturb you again,but I need some details.&lt;br /&gt;Sorry to interrupt.&lt;br /&gt;I'm Sorry, if I have distressed you by asking all this questions.&lt;br /&gt;Sorry,I'm late.&lt;br /&gt;Don't talk rubbish.&lt;br /&gt;Don't talk nonsense.&lt;br /&gt;that's ridiculous.&lt;br /&gt;you must be joking.&lt;br /&gt;Don't talk ambiguous.&lt;br /&gt;Life is not money making.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-3056328186776849924?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/3056328186776849924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/07/common-english-sentences-for-speaking.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/3056328186776849924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/3056328186776849924'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/07/common-english-sentences-for-speaking.html' title='Common English Sentences for Speaking'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-8501599341656169766</id><published>2009-07-05T11:48:00.000-07:00</published><updated>2009-07-07T11:46:22.117-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='English learning'/><title type='text'>Word Meaning</title><content type='html'>pier: A platform built by vertical pillars near sea shore for docking of ships and boats.&lt;br /&gt;siesta: A nap in the early afternoon.(while working i took siesta).&lt;br /&gt;scoff: laugh with disregard.&lt;br /&gt;cannery: A place where food is canned(packed).&lt;br /&gt;preacher: A person who is preaching to gospel(unquestionable truth).&lt;br /&gt;congregation: A group of people.&lt;br /&gt;jigsaw puzzle (puzzle in box to get some figure).&lt;br /&gt;copycat: person who copies habit and behavior of others.&lt;br /&gt;blonde: a person with fair skin and hair.&lt;br /&gt;ramson: money demanded for a return of a captured person.&lt;br /&gt;asylum: A hospital for unbalanced person.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-8501599341656169766?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/8501599341656169766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/07/word-meaning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/8501599341656169766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/8501599341656169766'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/07/word-meaning.html' title='Word Meaning'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-2253157261530423051</id><published>2009-04-05T11:33:00.000-07:00</published><updated>2009-09-05T09:50:02.704-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TCP/IP'/><title type='text'>Link Layer of TCP/IP Protocol</title><content type='html'>&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;Link Layer&lt;/li&gt;&lt;/ul&gt;Link layer mainly concerned with the sending and receiving the IP packets of IP module,ARP request an reply for ARP module,RARP request and reply for RARP module.Link layer varies depends on the type of network we are using for eg: Ethernet,TokenRing,FDDI,Serial etc.&lt;br /&gt;&lt;br /&gt;Ethernet Frame&lt;br /&gt;Description :&lt;br /&gt;It is an encapsulation of Ethernet header to various packets such as IP packet,ARP,RARP,DATA etc.&lt;br /&gt;Destination Address : 6 bytes MAC Address.&lt;br /&gt;Source Address : 6 bytes Source MAC Address.&lt;br /&gt;Length field follows address if it is 802 packet else it contains type follows data.&lt;br /&gt;for Ethernet 802 packet minimum data size is 38 and for 803 it is 46.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_hVN2cfw3Hzo/SqKGy-m78DI/AAAAAAAAAA0/iur7phf4cLw/s1600-h/802_802.3+encapsulation.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 353px;" src="http://3.bp.blogspot.com/_hVN2cfw3Hzo/SqKGy-m78DI/AAAAAAAAAA0/iur7phf4cLw/s400/802_802.3+encapsulation.gif" alt="" id="BLOGGER_PHOTO_ID_5378009115391684658" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SLIP (Serial Line Internet Protocol)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It is a Encapsulation of IP packet,data etc. SLIP is mainly used to connect with internet through RS232 serial port cable almost present in all types of PCS.&lt;br /&gt;SLIP is terminated with special SLIP_END character that is 0xC0. If 0xC0 character is present in actual data it is replaced with 0xdb, 0xdc. If db is present in actual data it is replaced with 0xdb, 0xdd.&lt;br /&gt;&lt;br /&gt;Deficiencies of SLIP&lt;br /&gt;-&gt; Each end must know others IP Address.&lt;br /&gt;-&gt;SLIP packet can be transmitted in any protocol because we are not using any type field.&lt;br /&gt;-&gt;There is no Checksum.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PPP (Point to Point Protocol)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The format of PPP looks like&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_hVN2cfw3Hzo/Seojgwl-KfI/AAAAAAAAAAk/mWg522TECTw/s1600-h/point+to+point+protocol+format.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 145px;" src="http://2.bp.blogspot.com/_hVN2cfw3Hzo/Seojgwl-KfI/AAAAAAAAAAk/mWg522TECTw/s320/point+to+point+protocol+format.gif" alt="" id="BLOGGER_PHOTO_ID_5326108555025983986" border="0" /&gt;&lt;/a&gt;The frame begins and end with a flag whose value is 0x7e, address whose value is always 0xFF and a control byte with a value of 0x03. protocol field tells the type of data it can store.&lt;br /&gt;&lt;br /&gt;if protocol equals to 0x0021 means information field of an IP datagram.&lt;br /&gt;if protocol equals to 0xc021 than it is link control data.&lt;br /&gt;if protocol equals to 0x8021 than it is Network control data.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Maximum Transfer Unit&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;There is a limit on the size of frame for both Ethernet encapsulation(1500) and 802.3 (1492) encapsulation.&lt;br /&gt;&lt;br /&gt;FDDI- 4352.&lt;br /&gt;Ethernet- 1500 .&lt;br /&gt;IEEE 802.3/802.2 - 1492.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;path MTU&lt;/span&gt; : It is the maximum transfer unit between two hosts at short interval. It always change depends on the different network.&lt;br /&gt;if one is Ethernet and other is 802.3.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-2253157261530423051?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/2253157261530423051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/04/link-layer-of-tcpip-protocol.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/2253157261530423051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/2253157261530423051'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/04/link-layer-of-tcpip-protocol.html' title='Link Layer of TCP/IP Protocol'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_hVN2cfw3Hzo/SqKGy-m78DI/AAAAAAAAAA0/iur7phf4cLw/s72-c/802_802.3+encapsulation.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-669965953587279773</id><published>2009-04-02T11:18:00.000-07:00</published><updated>2009-09-05T07:53:36.155-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TCP/IP'/><title type='text'>TCP/IP Tutorial and Technical Overview</title><content type='html'>&lt;ul&gt;&lt;li&gt;Introduction&lt;/li&gt;&lt;/ul&gt;This tutorial is helpful for understanding TCP/IP stack,Writing Network programs,Network System administration, Writing TCP/IP applications. TCP/IP is a collection of layers.Each layer contains some list of protocols which perform specific function. Generally TCP/IP contains 4 layers.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Application Layer : mail,telnet&lt;/li&gt;&lt;li&gt;Transport Layer   : UDP,TCP&lt;/li&gt;&lt;li&gt;Network Layer     : IP,ICMP,IGMP&lt;/li&gt;&lt;li&gt;Link Layer            : Drivers&lt;/li&gt;&lt;/ol&gt;Link layer sometimes called as data link layer or network interface layer.They handles all types of hardware details.&lt;br /&gt;&lt;br /&gt;Network layer(internet layer) is used for routing of packets between various networks.&lt;br /&gt;&lt;br /&gt;Transport layer provides data transmission between hosts.In transport layer two protocols are used&lt;br /&gt;transmission control protocol and User Datagram protocol.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt; TCP : Reliable transmission of data between two hosts,Exchange of acknowledge takes place for reliable transmission. We can easily set the timeout for the transmission.Application should not have to put any effort to check data reliability.&lt;/li&gt;&lt;li&gt;UDP : Unreliable flow of data.Some mechanism in application layer has to be implemented to check reliability.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;Application layer is mainly at user level and other three layers are at kernel layer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;when one or more computers connected together it forms LAN. When two or more networks are connected together it is called as Inter Network or Internet. The hardware which is used to connect two networks is called as Router. Example of network are Ethernet, Token ring, FDDI ( Fiber distributed data Interface). Router connects Network at Network layer but Bridge connect different networks at datalink layer.Bridges makes appearance of multiple network to upper layer as same Network.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Internet Address&lt;/li&gt;&lt;/ul&gt;Internet address contains 4 bytes. Internet address is divided into 5 classes.&lt;br /&gt;Easy way to remember is shift one bit from the left to right by adding 1's.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_hVN2cfw3Hzo/SdZPmgjUt5I/AAAAAAAAAAU/BUylKF61hRs/s1600-h/Internet+Address+Class+A,B,C,D,E.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 216px;" src="http://3.bp.blogspot.com/_hVN2cfw3Hzo/SdZPmgjUt5I/AAAAAAAAAAU/BUylKF61hRs/s320/Internet+Address+Class+A,B,C,D,E.png" alt="" id="BLOGGER_PHOTO_ID_5320527532776535954" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Class A : Range  : 0.0.0.0 to 127.255.255.255&lt;br /&gt;&lt;br /&gt;Class B: Range  :128.0.0.0 to 191.255.255.255&lt;br /&gt;&lt;br /&gt;Class C: Range : 192.0.0.0 to 223.255.255.255&lt;br /&gt;&lt;br /&gt;Class D: Range : 224.0.0.0 to 239.255.255.255&lt;br /&gt;(Multicast Group Id)&lt;br /&gt;&lt;br /&gt;Class E:Range : 240.0.0.0 to 247.255.255.255 ( Reserved for future use)&lt;br /&gt;&lt;br /&gt;The Internet Network interface Center is responsible for assigning the IP Address to Various Networks.&lt;br /&gt;&lt;br /&gt;IP Address is divided into three parts:&lt;br /&gt;1) Unicast : Only for single host in a Network.&lt;br /&gt;2) Multicast : set of hosts in a Multicast Group.&lt;br /&gt;3) Broadcast: All the hosts in a given Network.&lt;br /&gt;&lt;br /&gt;DNS: Domain Name System is a Distributed database that provides the mapping between IpAddress and hostname. For remembering of Hostname Easily.&lt;br /&gt;&lt;br /&gt;Adding headers to the data is called Encapsulation and removing headers is c&lt;br /&gt;Application to transport layer :  Plain Data.&lt;br /&gt;Transport to IP layer : TCP Segment.&lt;br /&gt;IP layer to Network layer : IP segment&lt;br /&gt;Network layer to link layer: frames.&lt;br /&gt;&lt;br /&gt;Network always contains one Client and one Server.&lt;br /&gt;Client send request and server process the request in 2 ways either iterative or concurrent way.&lt;br /&gt;&lt;br /&gt;Iterative one request at a time.Concurrent Many request at a time.&lt;br /&gt;&lt;br /&gt;Port Numbers are mainly used to identify the type application we are working. The well known port numbers are from 0 to 1023. for eg : ftp on port 21, telnet 23,tftp on 69 etc.The well known port numbers of TCP/IP are managed by Internet Assigned numbers Authority.&lt;br /&gt;&lt;br /&gt;Epemeral ports: These are port numbers which can be used by Applications in their hosts. Every Application port must be unique.Most TCP/IP applications use epemeral ports in the range from 1024 to 5000.&lt;br /&gt;Some examples of reserved ports are:&lt;br /&gt;echo = 7  ( server sends whatever client sends).&lt;br /&gt;discard = 9 ( Server discards whatever client sends).&lt;br /&gt;daytime = 13 (server sends date and time to client in human readable form).&lt;br /&gt;&lt;br /&gt;Internet = collection of hosts around the world that communicate using TCP/IP&lt;br /&gt;internet = multiple networks connected together using common protocol suite.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-669965953587279773?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/669965953587279773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/04/tcpip-tutorial-and-technical-overview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/669965953587279773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/669965953587279773'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/04/tcpip-tutorial-and-technical-overview.html' title='TCP/IP Tutorial and Technical Overview'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_hVN2cfw3Hzo/SdZPmgjUt5I/AAAAAAAAAAU/BUylKF61hRs/s72-c/Internet+Address+Class+A,B,C,D,E.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-4063354367374596075</id><published>2009-03-29T10:08:00.000-07:00</published><updated>2010-05-27T12:40:35.083-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>C Programs with Solution Logic</title><content type='html'>&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;Transpose of a Matrix&lt;/li&gt;&lt;/ul&gt;Interchanging the Rows with Columns or Vice-Verse&lt;br /&gt;for(i=0;i&amp;amp;k;i++)&lt;br /&gt;for(j=i+1;j&amp;amp;l;j++)&lt;br /&gt;{&lt;br /&gt;temp=mat[i][j];&lt;br /&gt;mat[i][j]=mat[j][i];&lt;br /&gt;mat[j][i]=temp;&lt;br /&gt;}&lt;br /&gt;&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;Finding the Saddle point of a Matrix&lt;/li&gt;&lt;/ul&gt;A matrix &lt;tt&gt;a&lt;/tt&gt; is said to have a &lt;i class="emphasis"&gt;saddle point&lt;/i&gt; if some entry &lt;tt&gt;a[I][j]&lt;/tt&gt; is the smallest  value in the &lt;tt&gt;i&lt;/tt&gt;th row and the largest value in the &lt;tt&gt;j&lt;/tt&gt;th column.  A matrix may have more than one saddle point.&lt;br /&gt;&lt;br /&gt;for Eg:&lt;br /&gt;7 6 5&lt;br /&gt;1 8 1&lt;br /&gt;2 9 2&lt;br /&gt;&lt;br /&gt;Here saddle Point value is 5.&lt;br /&gt;&lt;br /&gt;&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;How to find year is leap year.&lt;/li&gt;&lt;/ul&gt;if a year is divisible by 4 and not by 100 is called leap year.&lt;br /&gt;if a year is divisible by 400 is called leap year.&lt;br /&gt;&lt;br /&gt;&lt;ul style="font-weight: bold;"&gt;&lt;li&gt;How to swap two variables without using temporary variable?&lt;/li&gt;&lt;/ul&gt;a^=b^=a^=b&lt;br /&gt;&lt;br /&gt;How to know system is using little Endian or Big Endain?&lt;br /&gt;int i=1;&lt;br /&gt;if( * (char *)&amp;amp;i ==  1)&lt;br /&gt;  printf("Little Endian");&lt;br /&gt;else&lt;br /&gt;  printf("Big Endian");&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-4063354367374596075?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/4063354367374596075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/c-programs-with-solution-logic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/4063354367374596075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/4063354367374596075'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/c-programs-with-solution-logic.html' title='C Programs with Solution Logic'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-7149298149226910824</id><published>2009-03-29T07:04:00.000-07:00</published><updated>2009-04-12T11:15:41.705-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sorting'/><category scheme='http://www.blogger.com/atom/ns#' term='Arrays'/><title type='text'>Introduction to Arrays Sorting</title><content type='html'>&lt;ul&gt;&lt;li&gt;Introduction about Array&lt;/li&gt;&lt;/ul&gt;Array is a sequence collection of elements are of same type.The elements of array are accessed by index.&lt;br /&gt;Array can be 1 dimensional or n dimensional.&lt;br /&gt;&lt;br /&gt;In C Array declaration is in the form:&lt;br /&gt;char name[100];&lt;br /&gt;&lt;br /&gt;Here char is the data type and name is the base pointer of array.&lt;br /&gt;The Base pointer of array cannot be changed.The Compiler treats it has constant pointer.&lt;br /&gt;&lt;br /&gt;Array is used in application like storing list of records. etc&lt;br /&gt;Arrays are used to implement various types of programs and algorithms like sorting,tress,Graphs etc.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Merging two sorted list&lt;/li&gt;&lt;/ul&gt;Algorithm&lt;br /&gt;1) Take three Arrays A1,A2 and C1.&lt;br /&gt;2)Compare each elements of A1 with A2,During comparing of elements,if 1st less than 2nd one,Then insert the 1st one C1 else 2nd one into C1. The Array from which the element is taken for insertion in third list,Increment the index of that Array.&lt;br /&gt;3)Repeat step 2 for all the elements in the Array.If you get Nth index in any of the Array then go to step 4.&lt;br /&gt;4) Insert the non finished Array directly in the Third array.&lt;br /&gt;4) The third Array contains the list of sorted elements.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Bubble Sort&lt;/li&gt;&lt;/ul&gt;1) take a array and Compare first two elements,If greater swap with other element.So at last we get largest element in nth location.&lt;br /&gt;So no of Comparisons required is n-1 first time.&lt;br /&gt;&lt;br /&gt;Like that total comparisons are (n-1)+(n-2)+--------1= n(n-1)/2.&lt;br /&gt;Order = O(n^2);&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Quick Sort&lt;/li&gt;&lt;/ul&gt;1)Quick sort is the fastest sorting algorithm.&lt;br /&gt;2)Take a Array of elements.Consider the first element as pivot.&lt;br /&gt;3) traverse from left if the current element is greater than pivot,stop there.&lt;br /&gt;4) traverse the list from right,if no is less than pivot,wait there.&lt;br /&gt;4)Swap the two wait locations elements.&lt;br /&gt;5) traverse the list again until their traverse won't cross with each other.&lt;br /&gt;6) always traverse from left first.&lt;br /&gt;7) if they cross with each other,swap the right location value with pivot.&lt;br /&gt;8) two lists are formed now.&lt;br /&gt;8) 0 to right and left to n-1.&lt;br /&gt;9) perform quick sort again on two lists.&lt;br /&gt;&lt;br /&gt;Average time complexity of Quick sort is O(nlogn).&lt;br /&gt;worst case time complexity = O(n^2). ( always one of list is empty).&lt;br /&gt;worst case space complexity =O(n). ( every time list splits into two).&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Selection Sort&lt;/li&gt;&lt;/ul&gt; &lt;ol&gt;&lt;li&gt;Find the minimum value in the list&lt;/li&gt;&lt;li&gt;Swap it with the value in the first position&lt;/li&gt;&lt;li&gt;Repeat the steps above for remainder of the list.&lt;/li&gt;&lt;/ol&gt;Timing Complexity: worst=best=average=O(n^2).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-7149298149226910824?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/7149298149226910824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/introduction-to-array-sorting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/7149298149226910824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/7149298149226910824'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/introduction-to-array-sorting.html' title='Introduction to Arrays Sorting'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-8596283893907251995</id><published>2009-03-24T10:36:00.000-07:00</published><updated>2011-04-15T11:27:58.118-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Aptitude'/><title type='text'>C Aptitude Multiple Choice Questions and Answers</title><content type='html'>Q1. What will be the output of the following arithmetic expression ?&lt;br /&gt;&lt;br /&gt;5+3*2%10-8*6&lt;br /&gt;&lt;br /&gt;a) -37&lt;br /&gt;b) -42&lt;br /&gt;c) -32&lt;br /&gt;d) -28&lt;br /&gt;&lt;br /&gt;Q2. What will be the output of the following statement ?&lt;br /&gt;&lt;br /&gt;int a=10; printf("%d &amp;amp;i",a,10);&lt;br /&gt;&lt;br /&gt;a) error&lt;br /&gt;b) 10&lt;br /&gt;c) 10 10&lt;br /&gt;d) none of these&lt;br /&gt;&lt;br /&gt;Q3. What will be the output of the following statement ?&lt;br /&gt;&lt;br /&gt;printf("%X%x%ci%x",11,10,'s',12);&lt;br /&gt;&lt;br /&gt;a) error&lt;br /&gt;b) basc&lt;br /&gt;c) Bas94c&lt;br /&gt;d) none of these&lt;br /&gt;&lt;br /&gt;Q4. What will be the output of the following statements ?&lt;br /&gt;&lt;br /&gt;int a = 4, b = 7,c; c = a = = b; printf("%i",c);&lt;br /&gt;&lt;br /&gt;a) 0&lt;br /&gt;b) error&lt;br /&gt;c) 1&lt;br /&gt;d) garbage value&lt;br /&gt;&lt;br /&gt;Q 5. What will be the output of the following statements ?&lt;br /&gt;&lt;br /&gt;int a = 5, b = 2, c = 10, i = a&amp;gt;b&lt;c; d="" error="" 1="" garbage="" value="" 5="" q="" what="" will="" be="" output="" of="" the="" following="" statements="" include=""&gt;&lt;stdio.h&gt;&lt;br /&gt;void main()&lt;br /&gt;{ printf("hello"); main(); }&lt;br /&gt;&lt;br /&gt;a) 1&lt;br /&gt;b) 2&lt;br /&gt;c) infinite number of times&lt;br /&gt;d) none of these&lt;br /&gt;&lt;br /&gt;Q7. What will be the output of the following statements ?&lt;br /&gt;&lt;br /&gt;int x[4] = {1,2,3}; printf("%d %d %D",x[3],x[2],x[1]);&lt;br /&gt;&lt;br /&gt;a) 03%D&lt;br /&gt;b) 000&lt;br /&gt;c) 032&lt;br /&gt;d) 321&lt;br /&gt;&lt;br /&gt;Q8. What will be the output of the following statement ?&lt;br /&gt;&lt;br /&gt;printf( 3 + "goodbye");&lt;br /&gt;&lt;br /&gt;a) goodbye&lt;br /&gt;b) odbye&lt;br /&gt;c) bye&lt;br /&gt;d) dbye&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q9. What will be the output of the following statements ?&lt;br /&gt;&lt;br /&gt;long int a = scanf("%ld%ld",&amp;amp;a,&amp;amp;a); printf("%ld",a);&lt;br /&gt;&lt;br /&gt;a) error&lt;br /&gt;b) garbage value&lt;br /&gt;c) 0&lt;br /&gt;d) 2&lt;br /&gt;&lt;br /&gt;Q10. What will be the output of the following program ?&lt;br /&gt;&lt;br /&gt;#include&lt;stdio.h&gt;&lt;br /&gt;void main()&lt;br /&gt;{ int a = 2;&lt;br /&gt;switch(a)&lt;br /&gt;{ case 1:&lt;br /&gt;printf("goodbye"); break;&lt;br /&gt;case 2:&lt;br /&gt;continue;&lt;br /&gt;case 3:&lt;br /&gt;printf("bye");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a) error&lt;br /&gt;b) goodbye&lt;br /&gt;c) bye&lt;br /&gt;d) byegoodbye&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q11. What will be the output of the following statements ?&lt;br /&gt;&lt;br /&gt;int i = 1,j; j=i--- -2; printf("%d",j);&lt;br /&gt;&lt;br /&gt;a) error&lt;br /&gt;b) 2&lt;br /&gt;c) 3&lt;br /&gt;d) -3&lt;br /&gt;&lt;br /&gt;Q12. What will be the output of following program ?&lt;br /&gt;&lt;br /&gt;#include&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int x,y = 10;&lt;br /&gt;x = y * NULL;&lt;br /&gt;printf("%d",x);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a) error&lt;br /&gt;b) 0&lt;br /&gt;c) 10&lt;br /&gt;d) garbage value&lt;br /&gt;&lt;br /&gt;Q13. What will be the output of following statements ?&lt;br /&gt;&lt;br /&gt;char x[ ] = "hello hi"; printf("%d%d",sizeof(*x),sizeof(x));&lt;br /&gt;&lt;br /&gt;a) 88&lt;br /&gt;b) 18&lt;br /&gt;c) 29&lt;br /&gt;d) 19&lt;br /&gt;&lt;br /&gt;Q14. What will be the output of the following statements&lt;br /&gt;?&lt;br /&gt;int a=5,b=6,c=9,d; d=(a&lt;b?(a&gt;c?1:2):(c&amp;gt;b?6:8)); printf("%d",d);&lt;br /&gt;&lt;br /&gt;a) 1&lt;br /&gt;b) 2&lt;br /&gt;c) 6&lt;br /&gt;d) 8&lt;br /&gt;&lt;br /&gt;Q15. What will be the output of the following statements ?&lt;br /&gt;&lt;br /&gt;int i = 3;&lt;br /&gt;printf("%d%d",i,i++);&lt;br /&gt;&lt;br /&gt;a) 34&lt;br /&gt;b) 43&lt;br /&gt;c) 44&lt;br /&gt;d) 33&lt;br /&gt;&lt;br /&gt;Q16. What will be the output of the following program ?&lt;br /&gt;&lt;br /&gt;#include&lt;stdio.h&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int a = 36, b = 9;&lt;br /&gt;printf("%d",a&amp;gt;&amp;gt;a/b-2);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;a) 9&lt;br /&gt;b) 7&lt;br /&gt;c) 5&lt;br /&gt;d) none of these&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q17)&lt;br /&gt;int testarray[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};&lt;br /&gt;What value does testarray[2][1][0] in the sample code above contain?&lt;br /&gt;&lt;br /&gt;a) 11&lt;br /&gt;b) 7&lt;br /&gt;c) 5&lt;br /&gt;d) 9&lt;br /&gt;&lt;br /&gt;Q18)&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int a=10,b=20;&lt;br /&gt;char x=1,y=0;&lt;br /&gt;if(a,b,x,y)&lt;br /&gt;{&lt;br /&gt;   printf("EXAM");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;What is the output?&lt;br /&gt;&lt;br /&gt;1) XAM is printed&lt;br /&gt;2) exam is printed&lt;br /&gt;3) Compiler Error&lt;br /&gt;4) Nothing is printed&lt;br /&gt;&lt;br /&gt;Q19)&lt;br /&gt;&lt;br /&gt;What is the output of the following code?&lt;br /&gt;#include&lt;stdio.h&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int s=0;&lt;br /&gt;while(s++&amp;lt;10)&amp;gt;&lt;br /&gt;# define a 10&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;printf("%d..",a);&lt;br /&gt;foo();&lt;br /&gt;printf("%d",a);&lt;br /&gt;}&lt;br /&gt;void foo()&lt;br /&gt;{&lt;br /&gt;#undef a&lt;br /&gt;#define a 50&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;1) 10..10&lt;br /&gt;2) 10..50&lt;br /&gt;3) Error&lt;br /&gt;4) 0&lt;br /&gt;&lt;br /&gt;Q21)&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;struct&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;}xyz;&lt;br /&gt;(*xyz)-&amp;gt;i=10;&lt;br /&gt;printf("%d",xyz.i);&lt;br /&gt;}&lt;br /&gt;What is the output of this program?&lt;br /&gt;&lt;br /&gt;1) program will not compile&lt;br /&gt;2) 10&lt;br /&gt;3) god only knows&lt;br /&gt;4) address of I&lt;br /&gt;&lt;br /&gt;Q22)&lt;br /&gt;What would be the output of the following program?&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char str[]="S\065AB";&lt;br /&gt;printf("\n%d", sizeof(str));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1) 7&lt;br /&gt;2) 6&lt;br /&gt;3) 5&lt;br /&gt;4) error&lt;br /&gt;&lt;br /&gt;Q23)&lt;br /&gt;What will be the value of `a` after the following code is executed&lt;br /&gt;#define square(x) x*x&lt;br /&gt;a = square(2+3)&lt;br /&gt;1) 25&lt;br /&gt;2) 13&lt;br /&gt;3) 11&lt;br /&gt;4) 10&lt;br /&gt;&lt;br /&gt;Q24)&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;void func()&lt;br /&gt;{&lt;br /&gt;int x = 0;&lt;br /&gt;static int y = 0;&lt;br /&gt;x++; y++;&lt;br /&gt;printf( "%d -- %d\n", x, y );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;func();&lt;br /&gt;func();&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;What will the code above print when it is executed?&lt;br /&gt;1)&lt;br /&gt;1 -- 1&lt;br /&gt;1 -- 1&lt;br /&gt;2)&lt;br /&gt;1 -- 1&lt;br /&gt;2 -- 1&lt;br /&gt;3)&lt;br /&gt;1 -- 1&lt;br /&gt;2 -- 2&lt;br /&gt;4)&lt;br /&gt;1 -- 1&lt;br /&gt;1 -- 2&lt;br /&gt;&lt;br /&gt;Q25)&lt;br /&gt;&lt;br /&gt;long factorial (long x)&lt;br /&gt;{&lt;br /&gt;????&lt;br /&gt;return x * factorial(x - 1);&lt;br /&gt;}&lt;br /&gt;With what do you replace the ???? to make the function shown above return the correct answer?&lt;br /&gt;1)&lt;br /&gt;if (x == 0) return 0;&lt;br /&gt;2)&lt;br /&gt;return 1;&lt;br /&gt;3)&lt;br /&gt;if (x &amp;gt;= 2) return 2;&lt;br /&gt;4)&lt;br /&gt;if (x &amp;lt;= 1) return 1;&lt;br /&gt;&lt;br /&gt;Q 26)&lt;br /&gt;&lt;br /&gt; int y[4] = {6, 7, 8, 9};&lt;br /&gt; int *ptr = y + 2; printf("%d\n", ptr[ 1 ] );&lt;br /&gt;&lt;br /&gt;What is printed when the sample code above is executed?&lt;br /&gt;&lt;br /&gt; 1) 6&lt;br /&gt;2) 7&lt;br /&gt;3) 8&lt;br /&gt;4) 9 .&lt;br /&gt;&lt;br /&gt;Q27)&lt;br /&gt;&lt;br /&gt;int i = 4;&lt;br /&gt;&lt;br /&gt;switch (i)&lt;br /&gt; {&lt;br /&gt;&lt;br /&gt;default:      ;&lt;br /&gt; case 3:&lt;br /&gt; i += 5;&lt;br /&gt; if ( i == 8)     &lt;br /&gt;{&lt;br /&gt; i++;&lt;br /&gt; if (i == 9) break;&lt;br /&gt; i *= 2;     &lt;br /&gt;}     &lt;br /&gt;i -= 4;     &lt;br /&gt;break;  &lt;br /&gt;&lt;br /&gt;case 8:&lt;br /&gt; i += 5;&lt;br /&gt; break;&lt;br /&gt; }&lt;br /&gt;printf("i = %d\n", i);&lt;br /&gt;&lt;br /&gt;What will the output of the sample code above be?&lt;br /&gt;&lt;br /&gt;1) i = 5&lt;br /&gt; 2) i = 8&lt;br /&gt; 3) i = 9&lt;br /&gt;4) i = 10&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Answers:&lt;br /&gt;&lt;br /&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/b?(a&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/c;&gt;1.(a)-37&lt;br /&gt;2.(d)none of them&lt;br /&gt;3.(b)basc&lt;br /&gt;4.(a)0&lt;br /&gt;5.(c)infinite number of time&lt;br /&gt;7.(c)032&lt;br /&gt;8.(d)dbye&lt;br /&gt;9.(b)garbage value&lt;br /&gt;10.(a) error&lt;br /&gt;11.(c) 3&lt;br /&gt;12.(b)0&lt;br /&gt;13.(d) 1 9&lt;br /&gt;14.Error&lt;br /&gt;15.(b)4 3&lt;br /&gt;16.(a) 9&lt;br /&gt;17.(a) 11&lt;br /&gt;18.(d) nothing will be print&lt;br /&gt;19.(3) Error&lt;br /&gt;21.(2)10&lt;br /&gt;22.(2) 6&lt;br /&gt;23.(3) 11&lt;br /&gt;24.(4)1..1,1..2&lt;br /&gt;25.(4)if(x&amp;lt;=1)return 1;&lt;br /&gt;26. (4) 9&lt;br /&gt;27.(1) i=5&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-8596283893907251995?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/8596283893907251995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/c-aptitude-multiple-choice-questions.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/8596283893907251995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/8596283893907251995'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/c-aptitude-multiple-choice-questions.html' title='C Aptitude Multiple Choice Questions and Answers'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-8228519754157016831</id><published>2009-03-24T09:54:00.000-07:00</published><updated>2009-04-08T12:37:27.896-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Aptitude'/><title type='text'>C Aptitude Questions and Answers</title><content type='html'>Predict the output or error(s) for the following:&lt;br /&gt;&lt;br /&gt;1.&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int  const * p=5;&lt;br /&gt;printf("%d",++(*p));&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler error: Cannot modify a constant value.&lt;br /&gt;Explanation:&lt;br /&gt;p is a pointer to a "constant integer".&lt;br /&gt;&lt;br /&gt;2.&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char s[ ]="man";&lt;br /&gt;int i;&lt;br /&gt;for(i=0;s[ i ];i++)&lt;br /&gt;printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;   mmmm&lt;br /&gt;      aaaa&lt;br /&gt;      nnnn&lt;br /&gt;Explanation:&lt;br /&gt;s[i], *(i+s), *(s+i), i[s] are all different ways of expressing the same idea.&lt;br /&gt;&lt;br /&gt;3.&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;float me = 1.1;&lt;br /&gt;double you = 1.1;&lt;br /&gt;if(me==you)&lt;br /&gt;printf("I love U");&lt;br /&gt;else&lt;br /&gt;printf("I hate U");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;I hate U&lt;br /&gt;Explanation:&lt;br /&gt;For floating point numbers (float, double, long double) the values cannot be predicted exactly.&lt;br /&gt;&lt;br /&gt;4.&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;static int var = 5;&lt;br /&gt;printf("%d ",var--);&lt;br /&gt;if(var)&lt;br /&gt;main();&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;5 4 3 2 1&lt;br /&gt;Explanation:&lt;br /&gt;When static storage class is given, it is initialized once. The change in the value of a static variable is retained even between the function calls. Main is also treated like any other ordinary function, which can be called recursively.&lt;br /&gt;&lt;stdio.h&gt;&lt;br /&gt;5.&lt;br /&gt;&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int a[2][2][2] = { {10,2,3,4}, {5,6,7,8}  };&lt;br /&gt;int *p,*q;&lt;br /&gt;p=&amp;amp;a[2][2][2];&lt;br /&gt;*q=***a;&lt;br /&gt;printf("%d----%d",*p,*q);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;SomeGarbageValue---1&lt;br /&gt;Explanation:&lt;br /&gt;p=&amp;amp;a[2][2][2]  you declare only two 2D arrays, but you are trying to access the third 2D(which you are not declared) it will print garbage values. *q=***a starting address of a is assigned integer pointer. Now q is pointing to starting address of a. If you print *q, it will print first element of 3D array.&lt;br /&gt;&lt;br /&gt;6.&lt;br /&gt;&lt;br /&gt;&lt;stdio.h&gt;main()&lt;br /&gt;{&lt;br /&gt;struct xx&lt;br /&gt;{&lt;br /&gt;int x=3;&lt;br /&gt;char name[]="hello";&lt;br /&gt;};&lt;br /&gt;struct xx *s;&lt;br /&gt;printf("%d",s-&gt;x);&lt;br /&gt;printf("%s",s-&gt;name);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error&lt;br /&gt;Explanation:&lt;br /&gt;You should not initialize structure variables in declaration.&lt;br /&gt;&lt;br /&gt;7.&lt;br /&gt;&lt;br /&gt;&lt;stdio.h&gt;main()&lt;br /&gt;{&lt;br /&gt;struct xx&lt;br /&gt;{&lt;br /&gt;int x;&lt;br /&gt;struct yy&lt;br /&gt;{&lt;br /&gt;char s;&lt;br /&gt;struct xx *p;&lt;br /&gt;};&lt;br /&gt;struct yy *q;&lt;br /&gt;};&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error&lt;br /&gt;Explanation:&lt;br /&gt;The structure yy is nested within structure xx. Hence, the elements are of yy are to be accessed through the instance of structure xx, which needs an instance of yy to be known. If the instance is created after defining the structure the compiler will  not know about the instance relative to xx. Hence for nested structure yy you have to declare member.&lt;br /&gt;&lt;br /&gt;8.&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;printf("\nab");&lt;br /&gt;printf("\bsi");&lt;br /&gt;printf("\rha");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;hai&lt;br /&gt;Explanation:&lt;br /&gt;\n  - newline&lt;br /&gt;\b  - backspace&lt;br /&gt;\r  - linefeed&lt;br /&gt;&lt;br /&gt;9.&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=5;&lt;br /&gt;printf("%d%d%d%d%d%d",i++,i--,++i,--i,i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;45545&lt;br /&gt;Explanation:&lt;br /&gt;The arguments in a function call are pushed into the stack from left to right. The evaluation is by popping out from the stack. and the  evaluation is from right to left, hence the result.&lt;br /&gt;&lt;br /&gt;10.&lt;br /&gt;#define square(x) x*x&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;i = 64/square(4);&lt;br /&gt;printf("%d",i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;64&lt;br /&gt;Explanation:&lt;br /&gt;the macro call square(4) will substituted by 4*4 so the expression becomes i = 64/4*4 . Since / and * has equal priority the expression will be evaluated as (64/4)*4 i.e. 16*4 = 64&lt;br /&gt;&lt;br /&gt;11.&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char *p="hai friends",*p1;&lt;br /&gt;p1=p;&lt;br /&gt;while(*p!='\0') ++*p++;&lt;br /&gt;printf("%s   %s",p,p1);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;ibj!gsjfoet&lt;br /&gt;Explanation:&lt;br /&gt;During the execution of printf p points to last null character and all the content also got incremented.&lt;br /&gt;p1 prints the incremented content.&lt;br /&gt;&lt;br /&gt;12.&lt;br /&gt;&lt;br /&gt;&lt;stdio.h&gt;#define a 10&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;#define a 50&lt;br /&gt;printf("%d",a);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;50&lt;br /&gt;Explanation:&lt;br /&gt;The preprocessor directives can be redefined anywhere in the program. So the most recently assigned value will be taken.&lt;br /&gt;&lt;br /&gt;13.&lt;br /&gt;&lt;br /&gt;#define clrscr() 100&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;clrscr();&lt;br /&gt;printf("%d\n",clrscr());&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;100&lt;br /&gt;Explanation:&lt;br /&gt;Preprocessor executes as a seperate pass before the execution of the compiler. So textual replacement of clrscr() to 100 occurs.The input  program to compiler looks like this :&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;    100;&lt;br /&gt;    printf("%d\n",100);&lt;br /&gt;}&lt;br /&gt;Note:&lt;br /&gt;100; is an executable statement but with no action. So it doesn't give any problem&lt;br /&gt;&lt;br /&gt;14.&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;printf("%p",main);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Some address will be printed.&lt;br /&gt;Explanation:&lt;br /&gt;Function names are just addresses,main() is also a function. So the address of function main will be printed. %p in printf specifies that the argument is an address. They are printed as hexadecimal numbers.&lt;br /&gt;&lt;br /&gt;15.&lt;br /&gt;&lt;br /&gt;char *someFun1()&lt;br /&gt;{&lt;br /&gt;char temp[ ] = “string";&lt;br /&gt;return temp;&lt;br /&gt;}&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;puts(someFun1());&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Garbage values.&lt;br /&gt;&lt;br /&gt;16.&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;char far *farther,*farthest;&lt;br /&gt;printf("%d..%d",sizeof(farther),sizeof(farthest));&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;4..2&lt;br /&gt;Explanation:&lt;br /&gt;the second pointer is of char type and not a far pointer&lt;br /&gt;&lt;br /&gt;17.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=400,j=300;&lt;br /&gt;printf("%d..%d");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;400..300&lt;br /&gt;Explanation:&lt;br /&gt;printf takes the values of the first two assignments of the program. Any number of printf's may be given. All of them take only the first two values. If more number of assignments given in the program,then printf will take garbage values.&lt;br /&gt;&lt;br /&gt;18.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char *p;&lt;br /&gt;p="Hello";&lt;br /&gt;printf("%c\n",*&amp;amp;*p);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;H&lt;br /&gt;&lt;br /&gt;19.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=1;&lt;br /&gt;while (i&lt;=5)     {        printf("%d",i);        if (i&gt;2)&lt;br /&gt;goto here;&lt;br /&gt;i++;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;fun()&lt;br /&gt;{&lt;br /&gt;here:&lt;br /&gt;printf("PP");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler error: Undefined label 'here' in function main&lt;br /&gt;Explanation:&lt;br /&gt;Labels have functions scope, in other words The scope of the labels is limited to functions. The label 'here' is available in function fun () Hence it is not visible in function main.&lt;br /&gt;&lt;br /&gt;20.&lt;br /&gt;&lt;stdio.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=1,j=2;&lt;br /&gt;switch(i)&lt;br /&gt;{&lt;br /&gt;case 1:  printf("GOOD");&lt;br /&gt;break;&lt;br /&gt;case j:  printf("BAD");&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error: Constant expression required in function main.&lt;br /&gt;Explanation:&lt;br /&gt;The case statement can have only constant expressions .Enumerated types can be used in case statements.&lt;br /&gt;&lt;br /&gt;21.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;printf("%d",scanf("%d",&amp;amp;i));  // value 10 is given as input here&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;1&lt;br /&gt;Explanation:&lt;br /&gt;Scanf returns number of items successfully read and not 1/0.  Here 10 is given as input which should have been scanned successfully. So number of items read is 1.&lt;br /&gt;&lt;br /&gt;22.&lt;br /&gt;&lt;br /&gt;#define f(g,g2) g##g2&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int var12=100;&lt;br /&gt;printf("%d",f(var,12));&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;100&lt;br /&gt;&lt;br /&gt;23.&lt;br /&gt;&lt;br /&gt;&lt;stdio.h&gt;main()&lt;br /&gt;{&lt;br /&gt;char s[]={'a','b','c','\n','c','\0'};&lt;br /&gt;char *p,*str,*str1;&lt;br /&gt;p=&amp;amp;s[3];&lt;br /&gt;str=p;&lt;br /&gt;str1=s;&lt;br /&gt;printf("%d",++*p + ++*str1-32);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;M&lt;br /&gt;Explanation:&lt;br /&gt;p is pointing to character '\n'.str1 is pointing to character 'a' ++*p meAnswer:"p is pointing to '\n' and that is incremented by one." the ASCII value of '\n' is 10. then it is incremented to 11. the value of ++*p is 11. ++*str1 meAnswer:"str1 is pointing to 'a' that is incremented by 1 and it becomes 'b'. ASCII value of 'b' is 98. both 11 and 98 is added and result is subtracted from 32.&lt;br /&gt;i.e. (11+98-32)=77("M");&lt;br /&gt;&lt;br /&gt;24.&lt;br /&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;main()&lt;br /&gt;{&lt;br /&gt;extern int i;&lt;br /&gt;i=20;&lt;br /&gt;printf("%d",sizeof(i));&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Linker error: undefined symbol '_i'.&lt;br /&gt;Explanation:&lt;br /&gt;extern declaration specifies that the variable i is defined somewhere else. The compiler passes the external variable to be resolved by the linker. So compiler doesn't find an error. During linking the linker searches for the definition of i. Since it is not found the linker shows an error.&lt;br /&gt;&lt;br /&gt;25.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;printf("%d", out);&lt;br /&gt;}&lt;br /&gt;int out=100;&lt;br /&gt;Answer:&lt;br /&gt;Compiler error: undefined symbol out in function main.&lt;br /&gt;Explanation:&lt;br /&gt;The rule is that a variable is available for use from the point of declaration. Even though a is a global variable, it is not available for main. Hence an error.&lt;br /&gt;&lt;br /&gt;26.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;extern out;&lt;br /&gt;printf("%d", out);&lt;br /&gt;}&lt;br /&gt;int out=100;&lt;br /&gt;Answer:&lt;br /&gt;100&lt;br /&gt;Explanation:&lt;br /&gt;This is the correct way of writing the previous program.&lt;br /&gt;&lt;br /&gt;27.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;show();&lt;br /&gt;}&lt;br /&gt;void show()&lt;br /&gt;{&lt;br /&gt;printf("I'm the greatest");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compier error: Type mismatch in redeclaration of show.&lt;br /&gt;Explanation:&lt;br /&gt;When the compiler sees the function show it doesn't know anything about it. So the default return type (ie, int) is assumed. But when compiler sees the actual definition of show mismatch occurs since it is declared as void. Hence the error.&lt;br /&gt;&lt;br /&gt;28.&lt;br /&gt;&lt;line number=""&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=-1;&lt;br /&gt;+i;&lt;br /&gt;printf("i = %d, +i = %d \n",i,+i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;i = -1, +i = -1&lt;br /&gt;Explanation:&lt;br /&gt;Unary + is the only dummy operator in C. Where-ever it comes you can just ignore it just because it has no effect in the expressions (hence the name dummy operator).&lt;br /&gt;&lt;br /&gt;29.&lt;br /&gt;&lt;br /&gt;What are the files which are automatically opened when a C file is executed?&lt;br /&gt;Answer:&lt;br /&gt;stdin, stdout, stderr (standard input,standard output,standard error).&lt;br /&gt;&lt;br /&gt;30.&lt;br /&gt;&lt;br /&gt;what will be the position of the file marker?&lt;br /&gt;a: fseek(ptr,0,SEEK_SET);&lt;br /&gt;b: fseek(ptr,0,SEEK_CUR);&lt;br /&gt;&lt;br /&gt;Answer :&lt;br /&gt;a: The SEEK_SET sets the file position marker to the starting of the file.&lt;br /&gt;b: The SEEK_CUR sets the file position marker to the current position  of the file.&lt;br /&gt;&lt;br /&gt;31.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char name[10],s[12];&lt;br /&gt;scanf(" \"%[^\"]\"",s);&lt;br /&gt;}&lt;br /&gt;How scanf will execute?&lt;br /&gt;Answer:&lt;br /&gt;First it checks for the leading white space and discards it.Then it matches with a quotation mark and then it  reads all character upto another quotation mark.&lt;br /&gt;&lt;br /&gt;32.&lt;br /&gt;&lt;br /&gt;What is the problem with the following code segment?&lt;br /&gt;while ((fgets(receiving array,50,file_ptr)) != EOF);&lt;br /&gt;Answer &amp;amp; Explanation:&lt;br /&gt;fgets returns a pointer. So the correct end of file check is checking for != NULL.&lt;br /&gt;&lt;br /&gt;33.&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char *cptr,c;&lt;br /&gt;void *vptr,v;&lt;br /&gt;c=10;  v=0;&lt;br /&gt;cptr=&amp;c; vptr=&amp;v;&lt;br /&gt;printf("%c%v",c,v);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler error (at line number 4): size of v is Unknown.&lt;br /&gt;Explanation:&lt;br /&gt;You can create a variable of type void * but not of type void, since void is an empty type. In the second line you are creating variable vptr of type void * and v of type void hence an error.&lt;br /&gt;&lt;br /&gt;34.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char *str1="abcd";&lt;br /&gt;char str2[]="abcd";&lt;br /&gt;printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd"));&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;2 5 5&lt;br /&gt;&lt;br /&gt;35.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char not;&lt;br /&gt;not=!2;&lt;br /&gt;printf("%d",not);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;0&lt;br /&gt;&lt;br /&gt;36.&lt;br /&gt;&lt;br /&gt;#define FALSE -1&lt;br /&gt;#define TRUE   1&lt;br /&gt;#define NULL   0&lt;br /&gt;main() {&lt;br /&gt;if(NULL)&lt;br /&gt;puts("NULL");&lt;br /&gt;else if(FALSE)&lt;br /&gt;puts("TRUE");&lt;br /&gt;else&lt;br /&gt;puts("FALSE");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;TRUE&lt;br /&gt;Explanation:&lt;br /&gt;Preprocessor doesn't replace the values given inside the double quotes. The check by if condition is boolean value false so it goes to else. In second if -1 is boolean value true hence "TRUE" is printed.&lt;br /&gt;&lt;br /&gt;37.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int k=1;&lt;br /&gt;printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;1==1 is TRUE&lt;br /&gt;Explanation:&lt;br /&gt;When two strings are placed together (or separated by white-space) they are concatenated (this is called as "stringization" operation). So the string is as if it is given as "%d==1 is %s". The conditional operator( ?: ) evaluates to "TRUE".&lt;br /&gt;&lt;br /&gt;38.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int *j;&lt;br /&gt;{&lt;br /&gt;int i=10;&lt;br /&gt;j=&amp;i;&lt;br /&gt;}&lt;br /&gt;printf("%d",*j);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;10&lt;br /&gt;Explanation:&lt;br /&gt;The variable i is a block level variable and the visibility is inside that block only. But the lifetime of i is lifetime of the function so it lives upto the exit of main function. Since the i is still allocated space, *j prints the value stored in i since j points i.&lt;br /&gt;&lt;br /&gt;39.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=-1;&lt;br /&gt;-i;&lt;br /&gt;printf("i = %d, -i = %d \n",i,-i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;i = -1, -i = 1&lt;br /&gt;Explanation:&lt;br /&gt;-i is executed and this execution doesn't affect the value of i. In printf first you just print the value of i. After that the value of the expression -i = -(-1) is printed.&lt;br /&gt;&lt;br /&gt;40.&lt;br /&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;main()&lt;br /&gt;{&lt;br /&gt;register i=5;&lt;br /&gt;char j[]= "hello";           &lt;br /&gt;printf("%s  %d",j,i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;hello 5&lt;br /&gt;Explanation:&lt;br /&gt;if you declare i as register  compiler will treat it as ordinary integer and it will take integer value. i value may be  stored  either in register  or in memory.&lt;br /&gt;&lt;br /&gt;41.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=5,j=6,z;&lt;br /&gt;printf("%d",i+++j);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;11&lt;br /&gt;Explanation:&lt;br /&gt;the expression i+++j is treated as (i++ + j)&lt;br /&gt;&lt;br /&gt;42.&lt;br /&gt;&lt;br /&gt;struct aaa{&lt;br /&gt;struct aaa *prev;&lt;br /&gt;int i;&lt;br /&gt;struct aaa *next;&lt;br /&gt;};&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;struct aaa abc,def,ghi,jkl;&lt;br /&gt;int x=100;&lt;br /&gt;abc.i=0;abc.prev=&amp;jkl;&lt;br /&gt;abc.next=&amp;def;&lt;br /&gt;def.i=1;def.prev=&amp;abc;def.next=&amp;ghi;&lt;br /&gt;ghi.i=2;ghi.prev=&amp;def;&lt;br /&gt;ghi.next=&amp;jkl;&lt;br /&gt;jkl.i=3;jkl.prev=&amp;ghi;jkl.next=&amp;abc;&lt;br /&gt;x=abc.next-&gt;next-&gt;prev-&gt;next-&gt;i;&lt;br /&gt;printf("%d",x);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;2&lt;br /&gt;Explanation:&lt;br /&gt;above all statements form a double circular linked list;&lt;br /&gt;abc.next-&gt;next-&gt;prev-&gt;next-&gt;i&lt;br /&gt;this one points to "ghi" node the value of at particular node is 2.&lt;br /&gt;&lt;br /&gt;43.&lt;br /&gt;&lt;br /&gt;struct point&lt;br /&gt;{&lt;br /&gt;int x;&lt;br /&gt;int y;&lt;br /&gt;};&lt;br /&gt;struct point origin,*pp;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;pp=&amp;origin;&lt;br /&gt;printf("origin is(%d%d)\n",(*pp).x,(*pp).y);&lt;br /&gt;printf("origin is (%d%d)\n",pp-&gt;x,pp-&gt;y);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;origin is(0,0)&lt;br /&gt;origin is(0,0)&lt;br /&gt;Explanation:&lt;br /&gt;pp is a pointer to structure. we can access the elements of the structure either with arrow mark or with indirection operator.&lt;br /&gt;Note:&lt;br /&gt;Since structure pointer  is globally declared x &amp;amp; y are initialized as zeroes&lt;br /&gt;&lt;br /&gt;44.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char *p;&lt;br /&gt;int *q;&lt;br /&gt;long *r;&lt;br /&gt;p=q=r=0;&lt;br /&gt;p++;&lt;br /&gt;q++;&lt;br /&gt;r++;&lt;br /&gt;printf("%p...%p...%p",p,q,r);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;0001...0002...0004&lt;br /&gt;Explanation:&lt;br /&gt;++ operator  when applied to pointers increments address according to their corresponding data-types.&lt;br /&gt;&lt;br /&gt;45.&lt;br /&gt;&lt;br /&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;aaa()&lt;br /&gt;{&lt;br /&gt;printf("hi");&lt;br /&gt;}&lt;br /&gt;bbb(){&lt;br /&gt;printf("hello");&lt;br /&gt;}&lt;br /&gt;ccc(){&lt;br /&gt;printf("bye");&lt;br /&gt;}&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int (*ptr[3])();&lt;br /&gt;ptr[0]=aaa;&lt;br /&gt;ptr[1]=bbb;&lt;br /&gt;ptr[2]=ccc;&lt;br /&gt;ptr[2]();&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;bye&lt;br /&gt;Explanation:&lt;br /&gt;ptr is array of pointers to functions of return type int.ptr[0] is assigned to address of the function aaa. Similarly ptr[1] and ptr[2] for bbb and ccc respectively. ptr[2]() is in effect of writing ccc(), since ptr[2] points to ccc.&lt;br /&gt;&lt;br /&gt;46.&lt;br /&gt;&lt;br /&gt;&lt;stdio.h&gt;main()&lt;br /&gt;{&lt;br /&gt;int i =0;j=0;&lt;br /&gt;if(i &amp;amp;&amp;amp; j++)&lt;br /&gt;printf("%d..%d",i++,j);&lt;br /&gt;printf("%d..%d,i,j);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;0..0&lt;br /&gt;Explanation:&lt;br /&gt;The value of i is 0. Since this information is enough to determine the truth value of the boolean expression. So the statement following the if statement is not executed.  The values of i and j remain unchanged and get printed.&lt;br /&gt;&lt;br /&gt;47.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;i = abc();&lt;br /&gt;printf("%d",i);&lt;br /&gt;}&lt;br /&gt;abc()&lt;br /&gt;{&lt;br /&gt;_AX = 1000;&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;1000&lt;br /&gt;Explanation:&lt;br /&gt;Normally the return value from the function is through the information from the accumulator. Here _AH is the pseudo global variable denoting the accumulator. Hence, the value of the accumulator is set 1000 so the function returns value 1000.&lt;br /&gt;&lt;br /&gt;48.&lt;br /&gt;&lt;br /&gt;int i;&lt;br /&gt;   main()&lt;br /&gt;{&lt;br /&gt;int t;&lt;br /&gt;for ( t=4;scanf("%d",&amp;amp;i)-t;printf("%d\n",i))&lt;br /&gt;        printf("%d--",t--);&lt;br /&gt;       }&lt;br /&gt;// If the inputs are 0,1,2,3 find the o/p&lt;br /&gt;Answer:&lt;br /&gt;4--0&lt;br /&gt;3--1&lt;br /&gt;2--2&lt;br /&gt;Explanation:&lt;br /&gt;Let us assume some x= scanf("%d",&amp;amp;i)-t the values during execution&lt;br /&gt;         will be,&lt;br /&gt; t        i       x&lt;br /&gt; 4       0      -4&lt;br /&gt; 3       1      -2&lt;br /&gt; 2       2       0&lt;br /&gt;&lt;br /&gt;49.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int a= 0;int b = 20;char x =1;char y =10;&lt;br /&gt;if(a,b,x,y)&lt;br /&gt;printf("hello");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;hello&lt;br /&gt;Explanation:&lt;br /&gt;The comma operator has associativity from left to right. Only the rightmost value is returned and the other values are evaluated and ignored. Thus the value of last variable y is returned to check in if. Since it is a non zero value if becomes true so, "hello" will be printed.&lt;br /&gt;&lt;br /&gt;50.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;unsigned int i;&lt;br /&gt;for(i=1;i&gt;-2;i--)&lt;br /&gt;       printf("c aptitude");&lt;br /&gt;}&lt;br /&gt;Explanation:&lt;br /&gt;i is an unsigned integer. It is compared with a signed value. Since the both types doesn't match, signed is promoted to unsigned value. The unsigned equivalent of -2 is a huge value so condition becomes false and control comes out of the loop.&lt;br /&gt;&lt;br /&gt;51.&lt;br /&gt;&lt;br /&gt;What are the following notations of defining functions known as?&lt;br /&gt;i.      int abc(int a,float b)&lt;br /&gt;       {&lt;br /&gt;           /* some code */&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ii.    int abc(a,b)&lt;br /&gt;int a; float b;&lt;br /&gt;       {&lt;br /&gt;         /* some code*/&lt;br /&gt;       }&lt;br /&gt;Answer:&lt;br /&gt;i.  ANSI C notation&lt;br /&gt;ii. Kernighan &amp;amp; Ritche notation&lt;br /&gt;&lt;br /&gt;52.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char *p;&lt;br /&gt;p="%d\n";&lt;br /&gt;      p++;&lt;br /&gt;      p++;&lt;br /&gt;      printf(p-2,300);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;300&lt;br /&gt;Explanation:&lt;br /&gt;The pointer points to % since it is incremented twice and again decremented by 2, it points to '%d\n' and 300 is printed.&lt;br /&gt;&lt;br /&gt;53.&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int k=ret(sizeof(float));&lt;br /&gt;printf("\n here value is %d",++k);&lt;br /&gt;}&lt;br /&gt;int ret(int ret)&lt;br /&gt;{&lt;br /&gt;ret += 2.5;&lt;br /&gt;return(ret);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Here value is 7&lt;br /&gt;&lt;br /&gt;54.&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;unsigned giveit=-1;&lt;br /&gt;int gotit;&lt;br /&gt;printf("%u ",++giveit);&lt;br /&gt;printf("%u \n",gotit=--giveit);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;0 65535&lt;br /&gt;&lt;br /&gt;55.&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;char a[]="\0";&lt;br /&gt;if(printf("%s\n",a))&lt;br /&gt;printf("Ok here \n");&lt;br /&gt;else&lt;br /&gt;printf("Forget it\n");&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Ok here&lt;br /&gt;Explanation:&lt;br /&gt;Printf will return how many characters does it print. Hence printing a null character returns 1 which makes the if statement true, thus "Ok here" is printed.&lt;br /&gt;&lt;br /&gt;56.&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;void *v;&lt;br /&gt;int integer=2;&lt;br /&gt;int *i=&amp;integer;&lt;br /&gt;v=i;&lt;br /&gt;printf("%d",(int*)*v);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error. We cannot apply indirection on type void*.&lt;br /&gt;Explanation:&lt;br /&gt;Void pointer is a generic pointer type. No pointer arithmetic can be done on it. Void pointers are normally used for,&lt;br /&gt;1.    Passing generic pointers to functions and returning such pointers.&lt;br /&gt;2.    As a intermediate pointer type.&lt;br /&gt;3.    Used when the exact pointer type will be known at a later point of time.&lt;br /&gt;&lt;br /&gt;57.&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int i=i++,j=j++,k=k++;&lt;br /&gt;printf(“%d%d%d”,i,j,k);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Garbage values.&lt;br /&gt;Explanation:&lt;br /&gt;An identifier is available to use in program code from the point of its declaration.&lt;br /&gt;So expressions such as  i = i++ are valid statements. The i, j and k are automatic variables and so they contain some garbage value. Garbage in is garbage out (GIGO).&lt;br /&gt;&lt;br /&gt;58.&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;static int i=i++, j=j++, k=k++;&lt;br /&gt;printf(“i = %d j = %d k = %d”, i, j, k);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;i = 1 j = 1 k = 1&lt;br /&gt;Explanation:&lt;br /&gt;Since static variables are initialized to zero by default.&lt;br /&gt;&lt;br /&gt;59.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;while(1)&lt;br /&gt;{&lt;br /&gt;if(printf("%d",printf("%d")))&lt;br /&gt;   break;&lt;br /&gt;else&lt;br /&gt;   continue;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Garbage values&lt;br /&gt;Explanation:&lt;br /&gt;The inner printf executes first to print some garbage value. The printf returns no of characters printed and this value also cannot be predicted. Still the outer printf  prints something and so returns a non-zero value. So it encounters the break statement and comes out of the while statement.&lt;br /&gt;&lt;br /&gt;60.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;unsigned int i=10;&lt;br /&gt;while(i--&gt;=0)&lt;br /&gt;printf("%u ",i);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;10 9 8 7 6 5 4 3 2 1 0 65535 65534…..&lt;br /&gt;Explanation:&lt;br /&gt;Since i is an unsigned integer it can never become negative. So the expression i-- &gt;=0  will always be true, leading to an infinite loop.&lt;br /&gt;&lt;br /&gt;61.&lt;br /&gt;&lt;br /&gt;&lt;conio.h&gt;main()&lt;br /&gt;{&lt;br /&gt;int x,y=2,z,a;&lt;br /&gt;if(x=y%2) z=2;&lt;br /&gt;a=2;&lt;br /&gt;printf("%d %d ",z,x);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Garbage-value 0&lt;br /&gt;Explanation:&lt;br /&gt;The value of y%2 is 0. This value is assigned to x. The condition reduces to if (x) or in other words if(0) and so z goes uninitialized.&lt;br /&gt;&lt;br /&gt;62.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int a[10];&lt;br /&gt;printf("%d",*a+1-*a+3);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;4&lt;br /&gt;Explanation:&lt;br /&gt;*a and -*a cancels out. The result is as simple as 1 + 3 = 4 !&lt;br /&gt;&lt;br /&gt;63.&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;unsigned int i=65000;&lt;br /&gt;while(i++!=0);&lt;br /&gt;printf("%d",i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;1&lt;br /&gt;Explanation:&lt;br /&gt;Note the semicolon after the while statement. When the value of i becomes 0 it comes out of while loop. Due to post-increment on i the value of i while printing is 1.&lt;br /&gt;&lt;br /&gt;64.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=0;&lt;br /&gt;while(+(+i--)!=0)&lt;br /&gt;i-=i++;&lt;br /&gt;printf("%d",i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;-1&lt;br /&gt;Explanation:&lt;br /&gt;Unary + is the only dummy operator in C. So it has no effect on the expression and now the while loop is,     while(i--!=0) which is false and so breaks out of while loop. The value –1 is printed due to the post-decrement operator.&lt;br /&gt;&lt;br /&gt;65.&lt;br /&gt;&lt;br /&gt;Is the following statement a declaration/definition. Find what does it mean?&lt;br /&gt;int (*x)[10];&lt;br /&gt;Answer&lt;br /&gt;Definition.&lt;br /&gt;x is a pointer to array of(size 10) integers.&lt;br /&gt;&lt;br /&gt;66.&lt;br /&gt;&lt;br /&gt;#ifdef something&lt;br /&gt;int some=0;&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int thing = 0;&lt;br /&gt;printf("%d %d\n", some ,thing);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;Compiler error : undefined symbol some&lt;br /&gt;Explanation:&lt;br /&gt;This is a very simple example for conditional compilation. The name something is not already known to the compiler making the declaration  int some = 0; effectively removed from the source code.&lt;br /&gt;&lt;br /&gt;67.&lt;br /&gt;&lt;br /&gt;#if something == 0&lt;br /&gt;int some=0;&lt;br /&gt;#endif&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int thing = 0;&lt;br /&gt;printf("%d %d\n", some ,thing);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer&lt;br /&gt;0 0&lt;br /&gt;Explanation&lt;br /&gt;This code is to show that preprocessor expressions are not the same as the ordinary expressions. If a name is not known the preprocessor treats it to be equal to zero.&lt;br /&gt;&lt;br /&gt;68.&lt;br /&gt;int swap(int *a,int *b)&lt;br /&gt;{&lt;br /&gt;*a=*a+*b;*b=*a-*b;*a=*a-*b;&lt;br /&gt;}&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int x=10,y=20;&lt;br /&gt;swap(&amp;amp;x,&amp;amp;y);&lt;br /&gt;printf("x= %d y = %d\n",x,y);&lt;br /&gt;}&lt;br /&gt;Answer&lt;br /&gt;x = 20 y = 10&lt;br /&gt;Explanation&lt;br /&gt;This is one way of swapping two values. Simple checking will help understand this.&lt;br /&gt;&lt;br /&gt;69.&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=5;&lt;br /&gt;printf("%d",++i++);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler error: Lvalue required in function main&lt;br /&gt;Explanation:&lt;br /&gt;++i yields an rvalue.  For postfix ++ to operate an lvalue is required.&lt;br /&gt;&lt;br /&gt;70.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char *p = “ayqm”;&lt;br /&gt;char c;&lt;br /&gt;c = ++*p++;&lt;br /&gt;printf(“%c”,c);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;b&lt;br /&gt;Explanation:&lt;br /&gt;There is no difference between the expression ++*(p++) and ++*p++. Parenthesis just works as a visual clue for the reader to see which expression is first evaluated.&lt;br /&gt;&lt;br /&gt;71.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=5;&lt;br /&gt;printf(“%d”,i=++i ==6);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;1&lt;br /&gt;Explanation:&lt;br /&gt;The expression can be treated as i = (++i==6), because == is of higher precedence than = operator. In the inner expression, ++i is equal to 6 yielding true(1). Hence the result.&lt;br /&gt;&lt;br /&gt;72.&lt;br /&gt;void ( * abc( int, void ( *def) () ) ) ();&lt;br /&gt;&lt;br /&gt;Answer::&lt;br /&gt;abc is a  ptr to a  function which takes 2 parameters .(a). an integer variable.(b).        a ptr to a funtion which returns void. the return type of the function is  void.&lt;br /&gt;&lt;br /&gt;73.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;while (strcmp(“some”,”some\0”))&lt;br /&gt;printf(“Strings are not equal\n”);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;No output&lt;br /&gt;Explanation:&lt;br /&gt;Ending the string constant with \0 explicitly makes no difference. So “some” and “some\0” are equivalent. So, strcmp returns 0 (false) hence breaking out of the while loop.&lt;br /&gt;&lt;br /&gt;74.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char str1[] = {‘s’,’o’,’m’,’e’};&lt;br /&gt;char str2[] = {‘s’,’o’,’m’,’e’,’\0’};&lt;br /&gt;while (strcmp(str1,str2))&lt;br /&gt;printf(“Strings are not equal\n”);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;“Strings are not equal”&lt;br /&gt;“Strings are not equal”&lt;br /&gt;….&lt;br /&gt;Explanation:&lt;br /&gt;If a string constant is initialized explicitly with characters, ‘\0’ is not appended automatically to the string. Since str1 doesn’t have null termination.&lt;br /&gt;&lt;br /&gt;75.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i = 3;&lt;br /&gt;for (;i++=0;) printf(“%d”,i);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error: Lvalue required.&lt;br /&gt;&lt;br /&gt;76.&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int *mptr, *cptr;&lt;br /&gt;mptr = (int*)malloc(sizeof(int));&lt;br /&gt;printf(“%d”,*mptr);&lt;br /&gt;int *cptr = (int*)calloc(sizeof(int),1);&lt;br /&gt;printf(“%d”,*cptr);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;garbage-value 0&lt;br /&gt;Explanation:&lt;br /&gt;The memory space allocated by malloc is uninitialized, whereas calloc returns the allocated memory space initialized to zeros.&lt;br /&gt;&lt;br /&gt;77.&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;static int i;&lt;br /&gt;while(i&lt;=10) (i&gt;2)?i++:i--;&lt;br /&gt;printf(“%d”, i);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;32767&lt;br /&gt;Explanation:&lt;br /&gt;Since i is static it is initialized to 0. Inside the while loop the conditional operator evaluates to false, executing i--. This continues till the integer value rotates to positive value (32767). The while condition becomes false and hence, comes out of the while loop, printing the i value.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!-- &lt;br /&gt;78.&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=10,j=20;&lt;br /&gt;j = i, j?(i,j)?i:j:j;&lt;br /&gt;printf("%d %d",i,j);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;10 10&lt;br /&gt;Explanation:&lt;br /&gt;The Ternary operator ( ? : ) is equivalent for if-then-else statement. So the question can be written as:&lt;br /&gt;if(i,j)&lt;br /&gt;       {&lt;br /&gt;if(i,j)&lt;br /&gt;    j = i;&lt;br /&gt;else&lt;br /&gt;   j = j;  &lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;j = j;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;136)&lt;br /&gt;1. const char *a;&lt;br /&gt;2. char* const a;&lt;br /&gt;3. char const *a;&lt;br /&gt;-Differentiate the above declarations.&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;1. 'const' applies to char * rather than 'a' ( pointer to a constant char )&lt;br /&gt;*a='F'       : illegal&lt;br /&gt;   a="Hi"       : legal&lt;br /&gt;&lt;br /&gt;2. 'const' applies to 'a'  rather than to the value of a (constant pointer to char )&lt;br /&gt;*a='F'       : legal&lt;br /&gt;a="Hi"       : illegal&lt;br /&gt;&lt;br /&gt;3. Same as 1.&lt;br /&gt;&lt;br /&gt;137)&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=5,j=10;&lt;br /&gt;i=i&amp;amp;=j&amp;amp;&amp;10;&lt;br /&gt;printf("%d %d",i,j);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;1 10&lt;br /&gt;Explanation:&lt;br /&gt;The expression can be written as i=(i&amp;amp;=(j&amp;amp;&amp;amp;10)); The inner expression (j&amp;amp;&amp;amp;10) evaluates to 1 because j==10. i is 5. i = 5&amp;amp;1 is 1. Hence the result.&lt;br /&gt;&lt;br /&gt;138)&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int i=4,j=7;&lt;br /&gt;j = j || i++ &amp;amp;&amp;amp; printf("YOU CAN");&lt;br /&gt;printf("%d %d", i, j);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;4 1&lt;br /&gt;Explanation:&lt;br /&gt;The boolean expression needs to be evaluated only till the truth value of the expression is not known. j is not equal to zero itself means that the expression’s truth value is 1. Because it is followed by || and true || (anything) =&gt; true where (anything) will not be evaluated. So the remaining expression is not evaluated and so the value of i remains the same.&lt;br /&gt;Similarly when &amp;amp;&amp;amp; operator is involved in an expression, when any of the operands become false, the whole expression’s truth value becomes false and hence the remaining expression will not be evaluated.&lt;br /&gt;false &amp;amp;&amp;amp; (anything) =&gt; false where (anything) will not be evaluated.&lt;br /&gt;&lt;br /&gt;139)&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;register int a=2;&lt;br /&gt;printf("Address of a = %d",&amp;amp;a);&lt;br /&gt;printf("Value of a   = %d",a);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compier Error: '&amp;amp;' on register variable&lt;br /&gt;Rule to Remember:&lt;br /&gt;&amp;amp; (address of ) operator cannot be applied on register variables.&lt;br /&gt;&lt;br /&gt;140)&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;float i=1.5;&lt;br /&gt;switch(i)&lt;br /&gt;{&lt;br /&gt;case 1: printf("1");&lt;br /&gt;   case 2: printf("2");&lt;br /&gt;   default : printf("0");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error: switch expression not integral&lt;br /&gt;Explanation:&lt;br /&gt;Switch statements can be applied only to integral types.&lt;br /&gt;&lt;br /&gt;141)&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;extern i;&lt;br /&gt;printf("%d\n",i);&lt;br /&gt;{&lt;br /&gt;   int i=20;&lt;br /&gt;printf("%d\n",i);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Linker Error : Unresolved external symbol i&lt;br /&gt;Explanation:&lt;br /&gt;The identifier i is available in the inner block and so using extern has no use in resolving it.&lt;br /&gt;&lt;br /&gt;142)&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int a=2,*f1,*f2;&lt;br /&gt;f1=f2=&amp;a;&lt;br /&gt;*f2+=*f2+=a+=2.5;&lt;br /&gt;printf("\n%d %d %d",a,*f1,*f2);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;16 16 16&lt;br /&gt;Explanation:&lt;br /&gt;f1 and f2 both refer to the same memory location a. So changes through f1 and f2 ultimately affects only the value of a.&lt;br /&gt;&lt;br /&gt;143)&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char *p="GOOD";&lt;br /&gt;char a[ ]="GOOD";&lt;br /&gt;printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d", sizeof(p), sizeof(*p), strlen(p));&lt;br /&gt;printf("\n sizeof(a) = %d, strlen(a) = %d", sizeof(a), strlen(a));&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;sizeof(p) = 2, sizeof(*p) = 1, strlen(p) = 4&lt;br /&gt;sizeof(a) = 5, strlen(a) = 4&lt;br /&gt;Explanation:&lt;br /&gt;sizeof(p) =&gt; sizeof(char*) =&gt; 2&lt;br /&gt;sizeof(*p) =&gt; sizeof(char) =&gt; 1&lt;br /&gt;Similarly,&lt;br /&gt;sizeof(a) =&gt; size of the character array =&gt; 5&lt;br /&gt;When sizeof operator is applied to an array it returns the sizeof the array and it is not the same as the sizeof the pointer variable. Here the sizeof(a) where a is the character array and the size of the array is 5 because the space necessary for the terminating NULL character should also be taken into account.&lt;br /&gt;&lt;br /&gt;144)&lt;br /&gt;#define DIM( array, type) sizeof(array)/sizeof(type)&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int arr[10];&lt;br /&gt;printf(“The dimension of the array is %d”, DIM(arr, int));&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;10&lt;br /&gt;Explanation:&lt;br /&gt;The size  of integer array of 10 elements is 10 * sizeof(int). The macro expands to sizeof(arr)/sizeof(int) =&gt; 10 * sizeof(int) / sizeof(int) =&gt; 10.&lt;br /&gt;&lt;br /&gt;145)&lt;br /&gt;int DIM(int array[])&lt;br /&gt;{&lt;br /&gt;return sizeof(array)/sizeof(int );&lt;br /&gt;}&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int arr[10];&lt;br /&gt;printf(“The dimension of the array is %d”, DIM(arr));&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;1&lt;br /&gt;Explanation:&lt;br /&gt;Arrays cannot be passed to functions as arguments and only the pointers can be passed. So the argument is equivalent to int * array (this is one of the very few places where [] and * usage are equivalent). The return statement becomes, sizeof(int *)/ sizeof(int) that happens to be equal in this case.&lt;br /&gt;&lt;br /&gt;146)&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;static int a[3][3]={1,2,3,4,5,6,7,8,9};&lt;br /&gt;int i,j;&lt;br /&gt;static *p[]={a,a+1,a+2};&lt;br /&gt;for(i=0;i&lt;3;i++) j="0;j&lt;3;j++)" x="10,y=" x="%d" y="%d" x="10" y="8" i =" 257;" iptr =" &amp;i;" i =" 258;" iptr =" &amp;i;" i="300;" ptr =" &amp;i;" ptr="2;" ptr =" 2" 00101100 =""&gt; 556.&lt;br /&gt;&lt;br /&gt;151).&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char a[4]="HELL";&lt;br /&gt;printf("%s",a);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;HELL%@!~@!@???@~~!&lt;br /&gt;Explanation:&lt;br /&gt;The character array has the memory just enough to hold the string “HELL” and doesnt have enough space to store the terminating null character. So it prints the HELL correctly and continues to print garbage values till it     accidentally comes across a NULL character.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;152)    Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?&lt;br /&gt;Answer:&lt;br /&gt;(char*(*)( )) (*ptr[N])( );&lt;br /&gt;&lt;br /&gt;153)&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;struct student&lt;br /&gt;{&lt;br /&gt;char name[30];&lt;br /&gt;struct date dob;&lt;br /&gt;}stud;&lt;br /&gt;struct date&lt;br /&gt;{&lt;br /&gt;int day,month,year;&lt;br /&gt;};&lt;br /&gt;scanf("%s%d%d%d", stud.rollno, &amp;amp;student.dob.day, &amp;amp;student.dob.month,      &amp;amp;student.dob.year);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error: Undefined structure date&lt;br /&gt;Explanation:&lt;br /&gt;Inside the struct definition of ‘student’ the member of type struct date is given. The compiler doesn’t have the definition of date structure (forward  reference is not allowed in C in this case) so it issues an error.&lt;br /&gt;&lt;br /&gt;154)&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;struct date;&lt;br /&gt;struct student&lt;br /&gt;{&lt;br /&gt;char name[30];&lt;br /&gt;struct date dob;&lt;br /&gt;}stud;&lt;br /&gt;struct date&lt;br /&gt;   {&lt;br /&gt;int day,month,year;&lt;br /&gt;};&lt;br /&gt;scanf("%s%d%d%d", stud.rollno, &amp;amp;student.dob.day, &amp;amp;student.dob.month, &amp;amp;student.dob.year);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error: Undefined structure date&lt;br /&gt;Explanation:&lt;br /&gt;Only declaration of struct date is available inside the structure definition of ‘student’ but to have a variable of type struct date the definition of the structure is required.&lt;br /&gt;&lt;br /&gt;155)&lt;br /&gt;There were 10 records stored in “somefile.dat” but the following program printed 11 names. What went wrong?&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;struct student&lt;br /&gt;{&lt;br /&gt;char name[30], rollno[6];&lt;br /&gt;}stud;&lt;br /&gt;FILE *fp = fopen(“somefile.dat”,”r”);&lt;br /&gt;while(!feof(fp))&lt;br /&gt;{&lt;br /&gt;    fread(&amp;amp;stud, sizeof(stud), 1 , fp);&lt;br /&gt;puts(stud.name);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Explanation:&lt;br /&gt;fread reads 10 records and prints the names successfully. It will return EOF only when fread tries to read another record and fails reading EOF (and returning EOF). So it prints the last record again. After this only the condition feof(fp) becomes false, hence comes out of the while loop.&lt;br /&gt;&lt;br /&gt;156)&lt;br /&gt;Is there any difference between the two declarations,&lt;br /&gt;1.    int foo(int *arr[]) and&lt;br /&gt;2.    int foo(int *arr[2])&lt;br /&gt;Answer:&lt;br /&gt;No&lt;br /&gt;Explanation:&lt;br /&gt;Functions can only pass pointers and not arrays. The numbers that are allowed inside the [] is just for more readability. So there is no difference between the two declarations.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;157)&lt;br /&gt;What is the subtle error in the following code segment?&lt;br /&gt;void fun(int n, int arr[])&lt;br /&gt;{&lt;br /&gt;int *p=0;&lt;br /&gt;int i=0;&lt;br /&gt;while(i++&amp;lt;n)&lt;br /&gt;p = &amp;amp;arr[i];&lt;br /&gt;*p = 0;&lt;br /&gt;}&lt;br /&gt;Answer &amp;amp; Explanation:&lt;br /&gt;If the body of the loop never executes p is assigned no address. So p remains NULL where *p =0 may result in problem (may rise to runtime error “NULL pointer assignment” and terminate the program).&lt;br /&gt;&lt;br /&gt;158)&lt;br /&gt;What is wrong with the following code?&lt;br /&gt;int *foo()&lt;br /&gt;{&lt;br /&gt;int *s = malloc(sizeof(int)100);&lt;br /&gt;assert(s != NULL);&lt;br /&gt;return s;&lt;br /&gt;}&lt;br /&gt;Answer &amp;amp; Explanation:&lt;br /&gt;assert macro should be used for debugging and finding out bugs. The check s != NULL is for error/exception handling and for that assert shouldn’t be used. A plain if and the corresponding remedy statement has to be given.&lt;br /&gt;&lt;br /&gt;159)&lt;br /&gt;What is the hidden bug with the following  statement?&lt;br /&gt;assert(val++ != 0);&lt;br /&gt;Answer &amp;amp; Explanation:&lt;br /&gt;Assert macro is used for debugging and removed in release version. In assert, the experssion involves side-effects. So the behavior of the code becomes different in case of debug version and the release version thus leading to a subtle bug.&lt;br /&gt;Rule to Remember:&lt;br /&gt;Don’t use expressions that have side-effects in assert statements.&lt;br /&gt;&lt;br /&gt;160)&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int *i = 0x400;  // i points to the address 400&lt;br /&gt;*i = 0;        // set the value of memory location pointed by i;&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Undefined behavior&lt;br /&gt;Explanation:&lt;br /&gt;The second statement results in undefined behavior because it points to some location whose value may not be available for modification.  This type of pointer in which the non-availability of the implementation of the referenced location is known as 'incomplete type'.&lt;br /&gt;&lt;br /&gt;161)&lt;br /&gt;#define assert(cond) if(!(cond)) \&lt;br /&gt;(fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\&lt;br /&gt;__FILE__,__LINE__), abort())&lt;br /&gt;&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;int i = 10;&lt;br /&gt;if(i==0)&lt;br /&gt;assert(i &lt;&gt;&lt;/conio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/line&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;Is this code legal?&lt;br /&gt;int *ptr;&lt;br /&gt;ptr = (int *) 0x400;&lt;br /&gt;Answer:&lt;br /&gt;Yes&lt;br /&gt;Explanation:&lt;br /&gt;The pointer ptr will point at the integer in the memory location 0x400.&lt;br /&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;file name=""&gt;&lt;line number=""&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;conio.h&gt;&lt;br /&gt;170) &lt;/conio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/line&gt;&lt;/file&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;    main()&lt;br /&gt;{&lt;br /&gt;char a[4]="HELLO";&lt;br /&gt;printf("%s",a);&lt;br /&gt;}&lt;br /&gt;Answer:&lt;br /&gt;Compiler error: Too many initializers&lt;br /&gt;Explanation:&lt;br /&gt;The array a is of size 4 but the string constant requires 6 bytes to get stored.&lt;br /&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;file name=""&gt;&lt;line number=""&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;stdio.h&gt;&lt;conio.h&gt;&lt;br /&gt;171)    What is the Output?&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;char ch;&lt;br /&gt;for(ch=0;ch&lt;=127;ch++) printf(“%c   %d \n“, ch, ch); } Answer:    Implementaion dependent Explanation: The char type may be signed or unsigned by default. If it is signed then ch++ is executed after ch reaches 127 and rotates back to -128. Thus ch is always smaller than 127.  172) &lt;/conio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/line&gt;&lt;/file&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/stdio.h&gt; --&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-8228519754157016831?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/8228519754157016831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/c-aptitude-questions-and-answers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/8228519754157016831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/8228519754157016831'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/c-aptitude-questions-and-answers.html' title='C Aptitude Questions and Answers'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-3614695056970578479</id><published>2009-03-22T03:55:00.000-07:00</published><updated>2009-09-06T00:36:48.373-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computer Networks'/><category scheme='http://www.blogger.com/atom/ns#' term='TCP/IP'/><title type='text'>The OSI Reference Model</title><content type='html'>Connecting open systems that are open for communication with other system.&lt;br /&gt;Seven layers.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Physical layer:&lt;/li&gt;&lt;/ul&gt;Transmit raw bits from one system to another.&lt;br /&gt;Amount of volts needed to represent 0 or 1.&lt;br /&gt;Type of transmission medium whether Guided or Unguided&lt;br /&gt;Guided(copper wire, fiber optics) and Unguided(laser or radio waves).&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Data link layer&lt;/li&gt;&lt;/ul&gt;Accepts the raw bits which are received from the physical layer.Divides the sequence of bit stream received in parts called as frames and recompute the check sum for checking errors.for detecting errors it uses the CRC or Polynomial is used and for error correcting hamming distance is used.&lt;br /&gt;it also performs flow control.&lt;br /&gt;Node to Node transmission takes place.&lt;br /&gt;ARP(Address Resolution Protocol),RARP(Reverse Address Resolution Protocol),&lt;br /&gt;Frame relay(x.25),ISDN,PPP,LLC etc.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Network layer&lt;/li&gt;&lt;/ul&gt;This layer deals with the end to end transmission.&lt;br /&gt;This layer mainly adds source and destination address in the header.&lt;br /&gt;Route the data to different LANs and WANs depending on network Address.&lt;br /&gt;Example : IP,ICMP.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Transport layer&lt;/li&gt;&lt;/ul&gt;This provides efficient reliable and cost effective service to the users.&lt;br /&gt;This ensures the transmission of data to the correct process.&lt;br /&gt;TCP and UDP packets comes under this.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Session Layer&lt;/li&gt;&lt;/ul&gt;This layers allows users on different machines to establish session between them.&lt;br /&gt;This checks two stations do not attempt the same operation at same time.&lt;br /&gt;Critical operation functionality also present here(synchronization).&lt;br /&gt;Starts and stops session and maintains order.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Presentation layer&lt;/li&gt;&lt;/ul&gt;This layer deals with the syntax and semantics of the information to be transmitted.&lt;br /&gt;It encode data in a format so that receiver can easily understand.&lt;br /&gt;This layer also deals with the encryption and compression of the data.&lt;br /&gt;eg: ASCII to EBCDID , Binary to BCD.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Application layer&lt;/li&gt;&lt;/ul&gt;Deals with the protocols that are need for the transfer file,mail etc.&lt;br /&gt;Examples are : SMPT/IMAP4(E-MAIL),Telenet,HTTP(WWW),FTP(File Transfer),&lt;br /&gt;RIP(Route Information Protocol),OSPF(Open Shortest Path First),TFTP (Trivial File Transfer Protocol),DHCP(Dynamic Host Configuration Protocol),BOOTP(Bootstrap protocol).&lt;br /&gt;&lt;br /&gt;Names of various PDU in each layer.&lt;br /&gt;Application Protocol: APDU&lt;br /&gt;Presentation Protocol:PPDU&lt;br /&gt;Session protocol:SPDU&lt;br /&gt;Transport Protocol:TPDU&lt;br /&gt;Network : Packet&lt;br /&gt;Datalink: frame&lt;br /&gt;Physical: bit&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-3614695056970578479?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/3614695056970578479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/osi-reference-model.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/3614695056970578479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/3614695056970578479'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/osi-reference-model.html' title='The OSI Reference Model'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-8470584955410763683</id><published>2009-03-20T11:10:00.000-07:00</published><updated>2009-03-22T04:27:45.517-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>Preprocessing in C</title><content type='html'>C's preprocessor provides a facility for defining constant and substitution,  which are commonly called macros.&lt;ul&gt;&lt;li&gt;#include&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;The &lt;tt&gt;include&lt;/tt&gt; directive tells the compiler to include  all the contents of a specified file in the source file before giving the source  file for compiling.&lt;br /&gt;&lt;br /&gt;eg: #define TRUE 1&lt;br /&gt;&lt;ul&gt;&lt;li&gt;#undef&lt;/li&gt;&lt;/ul&gt;Nullify the effect of define directive.&lt;br /&gt;eg: #undef TRUE&lt;br /&gt;#define TRUE correct&lt;br /&gt;&lt;br /&gt;#include &lt;sample.h&gt;&lt;br /&gt;Angle brackets Searches in the default directories of include files.&lt;br /&gt;&lt;br /&gt;Quotes specifies search in current directory.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;#ifdef&lt;/li&gt;&lt;/ul&gt;&lt;tt&gt;ifdef&lt;/tt&gt; is used to make a substitution depending on whether a certain  identifier is defined. If defined returns true else false.&lt;br /&gt;&lt;br /&gt;e.g: #ifdef TRUE&lt;br /&gt;       #define FALSE 0&lt;br /&gt;       #endif&lt;br /&gt;Note: we can easily add multiple macros in between the two macros.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;#ifndef&lt;/li&gt;&lt;/ul&gt;eg: #ifndef FALSE&lt;br /&gt;      #define WRONG 0&lt;br /&gt;&lt;ul&gt;&lt;li&gt;#if&lt;/li&gt;&lt;/ul&gt;&lt;tt&gt;#if&lt;/tt&gt; allows you to define more generalized  conditions. Multiple conditions, which are connected by relational operators  such as &lt;tt&gt;AND(&amp;amp;&amp;amp;)&lt;/tt&gt;, &lt;tt&gt;OR(||)&lt;/tt&gt;, are allowed.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;#error&lt;/li&gt;&lt;/ul&gt;Used to display error message by preprocessor.&lt;br /&gt;&lt;br /&gt;#if !define FALSE&lt;br /&gt;#error "Specify FALSE condition"&lt;br /&gt;&lt;ul&gt;&lt;li&gt;#line&lt;/li&gt;&lt;/ul&gt;Mainly used for debugging purpose.&lt;br /&gt;eg: #line100 indicates it is in line 100&lt;br /&gt;&lt;br /&gt;C has provided two special identifiers: __FILE__ and  __LINE__, which indicate the file name of the source file and the current line  number, respectively.&lt;br /&gt;&lt;br /&gt;&lt;i class="emphasis"&gt;Macros&lt;/i&gt; allow replacement of the identifier by using a  statement or expression.&lt;br /&gt;eg: #define CUBE(x)   x*x*x&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-8470584955410763683?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/8470584955410763683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/preprocessing-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/8470584955410763683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/8470584955410763683'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/preprocessing-in-c.html' title='Preprocessing in C'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-4069147609954854299</id><published>2009-03-20T10:56:00.000-07:00</published><updated>2009-03-20T11:10:32.435-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>Placeholders for Scanf</title><content type='html'>&lt;div class="section"&gt; &lt;h2 style="font-weight: normal;" class="first-section-title"&gt;&lt;span style="font-size:100%;"&gt;&lt;a name="175"&gt;&lt;/a&gt;&lt;a name="ch07lev1sec2"&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;THE scanf PLACEHOLDERS&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt; &lt;div class="section"&gt; &lt;h3 class="sect3-title"&gt;&lt;a name="176"&gt;&lt;/a&gt;&lt;a name="ch07lev2sec2"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;p class="first-para"&gt;The &lt;tt&gt;scanf&lt;/tt&gt; placeholder consists of % at the  beginning and a type indicator at the end. Apart from that it can have *, a  maximum field-width indicator, and a type indicator modifier, for example,&lt;/p&gt;&lt;pre class="programlisting"&gt;%10.2f,%10d&lt;br /&gt;&lt;/pre&gt; &lt;div class="section"&gt;&lt;div class="section"&gt;&lt;ul class="simple-list"&gt;&lt;li class="first-listitem"&gt;&lt;p class="first-para"&gt;&lt;tt&gt;d, i&lt;/tt&gt; Used for signed integers; the expected  argument should be a pointer to &lt;tt&gt;int&lt;/tt&gt;.&lt;a name="177"&gt;&lt;/a&gt;&lt;a name="page69"&gt;&lt;/a&gt;  &lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;o&lt;/tt&gt; Used for unsigned &lt;tt&gt;int&lt;/tt&gt; expected's value.  It should be an integer in octal form.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;U&lt;/tt&gt; Unsigned integer in decimal form.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;X, &lt;/tt&gt;Unsigned integer in hexadecimal form.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;E, f, g, G&lt;/tt&gt; Floating-point values.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;S&lt;/tt&gt; Character string. It matches a sequence of  non-whitespace characters terminated by an end-of-line or end-of-file character.  The additional argument should be a pointer to &lt;tt&gt;char&lt;/tt&gt; and should point to  an area that is large enough to hold the input string as well as the  &lt;tt&gt;NULL&lt;/tt&gt; terminator.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;C&lt;/tt&gt; Matches the number of characters according to a  specified field-width. If no width is specified then a single character is  assumed. The additional argument must be a pointer to &lt;tt&gt;char&lt;/tt&gt;; the area  pointed to should be large enough to hold the specified number of  characters.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;N&lt;/tt&gt; Does not read any input but writes the number of  characters so far in the target variable.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt; &lt;div class="section"&gt;  &lt;p class="first-para"&gt;The * is used to suppress input. For example, with %*d, if  your input consists of 5 values and you want to ignore the middle 3 values, you  can write:&lt;/p&gt;&lt;pre class="programlisting"&gt;scanf(" %d %*d %*d%*d %d ", &amp;amp;i, &amp;amp;j)&lt;br /&gt;&lt;/pre&gt; &lt;p class="para"&gt;So, if your input is&lt;/p&gt; &lt;p class="para"&gt;10 20 30 40 50&lt;/p&gt; &lt;p class="last-para"&gt;it will get the value 10 and &lt;tt&gt;j&lt;/tt&gt; will get the value  50. This is useful when you are getting the input from a file.&lt;/p&gt;&lt;/div&gt; &lt;div style="font-weight: bold;" class="section"&gt; &lt;h5 class="sect5-title"&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/h5&gt;Field-width&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;It indicates the maximum number of characters that are read  into the variables.&lt;/span&gt;&lt;h5 style="font-weight: normal;" class="sect5-title"&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;/h5&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="section"&gt; &lt;h4 class="sect4-title"&gt;Explanation&lt;/h4&gt; &lt;ol class="orderedlist"&gt;&lt;li class="first-listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;scanf&lt;/tt&gt; requires two inputs: the first is a string  argument and the second is a set of additional arguments.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;You can define how the input is to be taken by using  placeholders.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-4069147609954854299?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/4069147609954854299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/placeholders-in-scanf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/4069147609954854299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/4069147609954854299'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/placeholders-in-scanf.html' title='Placeholders for Scanf'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-2780590779713010439</id><published>2009-03-19T11:43:00.000-07:00</published><updated>2009-03-19T11:50:01.349-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Good links'/><title type='text'>Other Best Links</title><content type='html'>&lt;dl&gt;&lt;p&gt;     &lt;/p&gt;&lt;dt&gt;&lt;a href="http://code.google.com/apis/customsearch/docs/dev_guide.html" add_date="1224595782" last_charset="UTF-8" id="rdf:#$96OFW2"&gt;Introduction - Google Custom Search API - Google Code&lt;/a&gt;&lt;/dt&gt;&lt;dt&gt;&lt;a href="http://ammasajan.wordpress.com/2008/07/22/how-to-get-free-linux-cds-dvds-from-home/" add_date="1225703191" last_visit="1225787412" last_charset="UTF-8" id="rdf:#$KGk2s3"&gt;How to get Free Linux CD’s DVD’s from Home « Ammasajan’s Weblog&lt;/a&gt;&lt;/dt&gt;&lt;dt&gt;&lt;a href="http://computer.howstuffworks.com/framed.htm?parent=serial-port.htm&amp;amp;url=http://www.lvr.com/serport.htm" add_date="1224857282" last_visit="1225260855" last_charset="ISO-8859-1" id="rdf:#$4+BoS1"&gt;Howstuffworks&lt;/a&gt;&lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.cse.unsw.edu.au/%7Eneilb/oss/linux-commentary/vfs.html#toc10" add_date="1221578697" last_visit="1221738769" last_charset="ISO-8859-1" id="rdf:#$xd3KD2"&gt;The Linux Virtual File-system Layer&lt;/a&gt;&lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.topcoder.com/tc" add_date="1220290379" last_charset="ISO-8859-1" id="rdf:#$tRasq"&gt;Programming Contests, Software Development, and Employment Services at TopCode&lt;/a&gt;&lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.cs.princeton.edu/research/projects#L" add_date="1220289267" last_charset="ISO-8859-1" id="rdf:#$JQasq"&gt;Research Projects :: Princeton Computer Science&lt;/a&gt;&lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.geocities.com/ravikiran_uvs/" add_date="1219835869" last_visit="1224152793" last_charset="ISO-8859-1" id="rdf:#$gDFCa3"&gt;Ravi Kiran's Homepag&lt;/a&gt;&lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.sics.se/%7Eadam/uip/uip-1.0-refman/" add_date="1225778308" last_visit="1225868860" last_charset="ISO-8859-1" id="rdf:#$H.j3Q"&gt;uIP 1.0&lt;/a&gt;     &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://studyusa.learnhub.com/lesson/page/2199-work-study-abroad-in-the-usa" add_date="1225804773" last_visit="1225891728" last_charset="UTF-8" id="rdf:#$NFK.D2"&gt;Work-Study Abroad in the USA — LearnHub&lt;/a&gt;     &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://studyabroad.learnhub.com/lessons" add_date="1225807689" last_visit="1225891763" last_charset="UTF-8" id="rdf:#$OFK.D2"&gt;Study Abroad » Lessons — LearnHub&lt;/a&gt;     &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://sarkari-naukri.blogspot.com/" add_date="1225984480" last_visit="1226553163" last_charset="UTF-8" id="rdf:#$om7QX"&gt;सरकारी नौकरी - Government Jobs India - Sarkari Naukri&lt;/a&gt;     &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.support.psi.com/support/tut/index.html" add_date="1226402593" last_charset="ISO-8859-1" id="rdf:#$8RlpV"&gt;TCP/IP Internetworking Tutorial&lt;/a&gt;     &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.dailyartisan.com/news/open-source-e-books-for-linux/" add_date="1228968292" last_charset="UTF-8" id="rdf:#$HEynD1"&gt;Daily Artisan » Open Source E-Books for Linux&lt;/a&gt;&lt;/dt&gt;&lt;dt&gt;&lt;a href="http://gizmogates.com/forum/YaBB.pl?board=video/180"&gt;VideoTutorials&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;&lt;br /&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-2780590779713010439?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/2780590779713010439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/other-best-links.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/2780590779713010439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/2780590779713010439'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/other-best-links.html' title='Other Best Links'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-5954306588058228068</id><published>2009-03-19T11:38:00.000-07:00</published><updated>2009-03-19T11:41:07.711-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Device Drivers'/><title type='text'>Device Drivers</title><content type='html'>&lt;dl&gt;&lt;dt&gt;&lt;a href="http://www.xml.com/ldd/chapter/book/bookindexpdf.html" add_date="1219140674" last_visit="1219313236" last_charset="ISO-8859-1" id="rdf:#$xq1vs3"&gt;Linux Device Drivers, 2nd Edition: In PDF Format&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.freesoftwaremagazine.com/articles/drivers_linux?page=0%2C0" add_date="1219231044" last_visit="1219257509" last_charset="UTF-8" id="rdf:#$D6TqF3"&gt;Writing device drivers in Linux: A brief tutorial&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.embedded.com/columns/showArticle.jhtml?articleID=185300534" add_date="1219237224" last_charset="ISO-8859-1" id="rdf:#$c8TqF3"&gt;Embedded.com - Linux device driver design&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.captain.at/howto-linux-device-driver-template-skeleton.php" add_date="1219241862" last_visit="1221661976" last_charset="ISO-8859-1" id="rdf:#$d8TqF3"&gt;Linux Device Driver Template/Skeleton with Interrupt Handler and Device Read Blocking (Kernel Module Example)&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.pdc.kth.se/doc/osf/osf40b/HTML/AA-PUBVD-TE_html/TOC.html" add_date="1219242460" last_visit="1224152831" last_charset="ISO-8859-1" id="rdf:#$59TqF3"&gt;Writing Device Drivers: Tutorial&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.freebsd.org/doc/en/books/arch-handbook/index.html" add_date="1219243010" last_visit="1219247246" last_charset="ISO-8859-1" id="rdf:#$g9TqF3"&gt;FreeBSD Architecture Handbook&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.ncnr.nist.gov/staff/nickm/device/" add_date="1219253364" last_visit="1219253635" last_modified="1219253386" last_charset="ISO-8859-1" id="rdf:#$MemQH3"&gt;Character devices notes&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.xml.com/ldd/chapter/book/index.html" add_date="1219257532" last_visit="1221733799" last_charset="ISO-8859-1" id="rdf:#$Mbjkc1"&gt;Linux Device Drivers, 2nd Edition: Online Book&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.linuxdriver.co.il/ldd3/" add_date="1219347295" last_visit="1228719630" last_charset="ISO-8859-1" id="rdf:#$5+85u1"&gt;Linux Device Drivers, 3rd Edition&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://tldp.org/LDP/lkmpg/2.6/html/lkmpg.html" add_date="1219434782" last_visit="1225278418" last_charset="ISO-8859-1" id="rdf:#$yYm1Z1"&gt;The Linux Kernel Module Programming Guide&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.luv.asn.au/overheads/chrdev-talk.html" add_date="1219746735" last_visit="1224152988" last_charset="UTF-8" id="rdf:#$neye5"&gt;LUV: Linux Character Device Drivers&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://tldp.org/LDP/tlk/tlk-toc.html" add_date="1219760409" last_visit="1224153007" last_charset="ISO-8859-1" id="rdf:#$Pfye5"&gt;The Linux Kernel: Table of Contents&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://linuxgazette.net/issue93/bhaskaran.html" add_date="1219934204" last_visit="1224153021" last_charset="ISO-8859-1" id="rdf:#$eM9F3"&gt;Writing a Network device driver - Part 1 LG #93&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.iana.org/assignments/port-numbers" add_date="1225454661" last_charset="UTF-8" id="rdf:#$mfdhP3"&gt;http://www.iana.org/assignments/port-numbers&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.lammertbies.nl/comm/info/serial-uart.html" add_date="1222192389" last_visit="1226032305" last_charset="ISO-8859-1" id="rdf:#$qkFL43"&gt;Serial UART, an in depth tutorial&lt;/a&gt;     &lt;/dt&gt;&lt;/dl&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-5954306588058228068?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/5954306588058228068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/device-drivers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/5954306588058228068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/5954306588058228068'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/device-drivers.html' title='Device Drivers'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-3910982090777723233</id><published>2009-03-19T11:28:00.000-07:00</published><updated>2009-03-19T11:41:35.253-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Library'/><title type='text'>C Library</title><content type='html'>&lt;dl&gt;&lt;dt&gt;&lt;a href="http://www.opengroup.org/onlinepubs/007908799/xshix.html" add_date="1217263265" last_visit="1221583418" last_charset="ISO-8859-1" id="rdf:#$6rKJz"&gt;System Interfaces &amp;amp; Headers Issue 5 - Index&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;br /&gt;&lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.gnu.org/software/libc/manual/html_mono/libc.html" add_date="1216995894" last_visit="1223993581" last_charset="ISO-8859-1" id="rdf:#$iDwCx1"&gt;The GNU C Library&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;br /&gt;&lt;/dt&gt;&lt;dt&gt;&lt;a href="http://users.actcom.co.il/%7Echoo/lupg/tutorials/index.html" add_date="1218049573" last_visit="1224154459" last_charset="ISO-8859-1" id="rdf:#$7zKQR1"&gt;Tutorials&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;br /&gt;&lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.mkssoftware.com/docs/api_index.asp" add_date="1218099631" last_visit="1229061500" last_modified="1218099657" last_charset="ISO-8859-1" id="rdf:#$CheaS1"&gt;All C functions of UNIX/linux&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;br /&gt;&lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.space.unibe.ch/comp_doc/c_manual/C/master_index.html" add_date="1222858912" last_visit="1227338300" last_charset="ISO-8859-1" id="rdf:#$REkqR3"&gt;C Ref Master Index&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;br /&gt;&lt;/dt&gt;&lt;dt&gt;&lt;a href="http://www.cs.cf.ac.uk/Dave/C/CE.html" add_date="1222876194" last_visit="1226403226" last_charset="ISO-8859-1" id="rdf:#$kFkqR3"&gt;Programming in C&lt;/a&gt;         &lt;/dt&gt;&lt;dt&gt;&lt;a href="http://homepage.mac.com/paalb/Examples/Menupb2.html" add_date="1222450957" last_visit="1226029937" last_charset="ISO-8859-1" id="rdf:#$1SLXN1"&gt;&lt;br /&gt;&lt;/a&gt;     &lt;/dt&gt;&lt;/dl&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-3910982090777723233?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/3910982090777723233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/c-library.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/3910982090777723233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/3910982090777723233'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/c-library.html' title='C Library'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-2179009364303512182</id><published>2009-03-19T11:12:00.000-07:00</published><updated>2011-04-27T11:49:23.648-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kernel'/><title type='text'>Linux Kernel</title><content type='html'>&lt;a href="http://www.kernel.org/"&gt;http://www.kernel.org/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-2179009364303512182?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/2179009364303512182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/linux-kernel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/2179009364303512182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/2179009364303512182'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/linux-kernel.html' title='Linux Kernel'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-2222489675226833010</id><published>2009-03-19T09:50:00.000-07:00</published><updated>2009-03-19T11:09:37.247-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>PlaceHolders for printf</title><content type='html'>&lt;h2 class="first-section-title"&gt;&lt;a name="154"&gt;&lt;/a&gt;&lt;a name="ch05lev1sec2"&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class="section"&gt;&lt;i class="emphasis"&gt;&lt;/i&gt;Placeholders are used to print values  of arguments supplied in print. The directives in the placeholders control  printing. &lt;div class="section"&gt; &lt;h4 class="sect4-title"&gt;Program/Example&lt;/h4&gt; &lt;p class="first-para"&gt;The general form of a placeholder is:&lt;/p&gt; &lt;ul class="simple-list"&gt;&lt;li class="first-listitem"&gt; &lt;p class="first-para"&gt;% flags field-width precision prefix  type-identifier.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt; &lt;div class="section"&gt; &lt;h4 class="sect4-title"&gt;Type-identifiers&lt;/h4&gt; &lt;p class="first-para"&gt;The type-identifiers are as follows:&lt;/p&gt; &lt;ul class="simple-list"&gt;&lt;li class="first-listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;d, i&lt;/tt&gt; Signed integers&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;o&lt;/tt&gt; Unsigned integers displayed in octal form.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;u&lt;/tt&gt; Unsigned integers in decimal form.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;x&lt;/tt&gt; Unsigned integers in hexadecimal form, and the  hexadecimal characters a, b, c, d, e, and f printed in lowercase.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;X&lt;/tt&gt; Unsigned integer in hexadecimal form, and the  hexadecimal characters A, B, C, D, E, and F printed in uppercase.&lt;a name="156"&gt;&lt;/a&gt;&lt;a name="page59"&gt;&lt;/a&gt; &lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;c&lt;/tt&gt; Any value converted to unsigned &lt;tt&gt;char&lt;/tt&gt; and  displayed; &lt;tt&gt;c&lt;/tt&gt; is used mainly for printing characters.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;s&lt;/tt&gt; The argument is converted to a character array  and is printed; the last null in the string is not printed.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;f&lt;/tt&gt; Floating point.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;e, E&lt;/tt&gt; Floating point displayed in exponential form.  It will have one digit to the left of the decimal point; the number of digits on  the right side of the decimal point depends on the required precision.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;g, G&lt;/tt&gt; The value can be printed in floating point or  exponential form. The exponential form is used if the exponent is less than –1  or if the exponent causes more places than required by the specified precision;  the decimal point appears only if it is followed by a digit.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;n&lt;/tt&gt; This indicates to print the number of characters  that are printed so far by &lt;tt&gt;printf&lt;/tt&gt;.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;p&lt;/tt&gt; It indicates an additional argument pointer to  void; the value of the pointer is converted to a sequence of  characters.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt; &lt;div class="section"&gt; &lt;h4 class="sect4-title"&gt;Type prefixes&lt;/h4&gt; &lt;ul class="simple-list"&gt;&lt;li class="first-listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;h&lt;/tt&gt; It can appear before type indicators d, i, o, u,  x, and X. It indicates that the value to be displayed should be interpreted as  short; for example, short integer (hd) and short unsigned integer (hu).&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;l&lt;/tt&gt; It can appear before type-identifiers d, i, o, u,  x, and X. It indicates that the value to be displayed should be interpreted as  long; for example, long integer (hd) and long unsigned integer (hu).&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;l, L&lt;/tt&gt; Available for type-identifiers e, E, f, g, and  G. It indicates that a value should be indicated as long  double.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt; &lt;div class="section"&gt; &lt;h4 class="sect4-title"&gt;Field-width&lt;/h4&gt; &lt;ol class="orderedlist"&gt;&lt;li class="first-listitem"&gt; &lt;p class="first-para"&gt;&lt;i class="emphasis"&gt;Field-width&lt;/i&gt; indicates the least number  of columns that will be allocated to the output. For example, if you write  &lt;tt&gt;%4d&lt;/tt&gt; to &lt;tt&gt;i&lt;/tt&gt; and the value of &lt;tt&gt;i&lt;/tt&gt; is 10, then 4 columns are  allocated for &lt;tt&gt;i&lt;/tt&gt; and 2 blank are added on left side of value of  &lt;tt&gt;i&lt;/tt&gt;. So the output is &lt;tt&gt;bb10&lt;/tt&gt;. Here, b indicates blank.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;If the value is more than the specified column, field-width  is ignored and the number of columns used is equal to the number of columns  required by the arguments. So if &lt;tt&gt;i&lt;/tt&gt; is 12345 then 5 columns are used,  even if &lt;tt&gt;%4d&lt;/tt&gt; is specified.&lt;a name="157"&gt;&lt;/a&gt;&lt;a name="page60"&gt;&lt;/a&gt; &lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;In any circumstance, the output width is not shortened,  because of field-width.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;If you specify * instead of field-width then you have to  specify additional arguments. For example,&lt;/p&gt;&lt;pre class="programlisting"&gt;printf ("%*d\n", 5, 20);     // A&lt;br /&gt;printf ("%*d\n", 20, 5);     // B&lt;br /&gt;&lt;/pre&gt; &lt;p class="para"&gt;In A, 5 is substituted for * and it indicates putting the value 20  in 5 columns.&lt;/p&gt; &lt;p class="last-para"&gt;In B, 20 is substituted for * and it indicates putting the  value 5 in 20 columns.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt; &lt;div class="section"&gt; &lt;h4 class="sect4-title"&gt;Precision&lt;/h4&gt; &lt;ol class="orderedlist"&gt;&lt;li class="first-listitem"&gt; &lt;p class="first-para"&gt;&lt;i class="emphasis"&gt;Precision&lt;/i&gt; indicates the minimum number  of digits printed for type integers d, i, o, u, x, and X. For example,&lt;/p&gt;&lt;pre class="programlisting"&gt;i.    printf("%10.4d\n", 35)&lt;br /&gt;&lt;/pre&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;Here 10 is the field-width and 4 is the precision, so 10  columns are used for the 4-digit output. To make 35 into 4 digits, two 0s are  added to the left side to make it 0035. To print 0035 in 10 columns, blanks are  added to make the output bbbbbb0035.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;For floating arguments, precision indicates how many digits  are printed after decimal points. If precision is more than the number of digits  on the right side of the decimal point, 0s are added to the right side.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;If precision indicates too few digits, then it is ignored  and the number of digits are printed as necessary.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt; &lt;div class="section"&gt; &lt;h4 class="sect4-title"&gt;Flags&lt;/h4&gt; &lt;ol class="orderedlist"&gt;&lt;li class="first-listitem"&gt; &lt;p class="first-para"&gt;&lt;i class="emphasis"&gt;Flag&lt;/i&gt; characters are used to give  directives for the output. You can use multiple flag characters in any  order.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;The flag characters are as follows:&lt;/p&gt; &lt;ul class="simple-list"&gt;&lt;li class="first-listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;—&lt;/tt&gt; Indicates that output is left justified.&lt;/p&gt;&lt;pre class="programlisting"&gt;printf("%-10.4d\n", 25)&lt;br /&gt;&lt;/pre&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;It causes the number to be printed as 0025bbbbbb. Thus,  blanks are added to the right side.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;In the absence of a flag, it is printed as bbbbbb0025.&lt;a name="158"&gt;&lt;/a&gt;&lt;a name="page61"&gt;&lt;/a&gt; &lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;+&lt;/tt&gt; Indicates that &lt;tt&gt;i&lt;/tt&gt; number is printed using  a sign character (+ or &lt;tt&gt;—)&lt;/tt&gt;.&lt;/p&gt;&lt;pre class="programlisting"&gt;printf("%+d\n", -25);&lt;br /&gt;printf("%+d\n", 25);&lt;br /&gt;&lt;/pre&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;It causes printing as&lt;/p&gt;&lt;pre class="programlisting"&gt;-25&lt;br /&gt;+25&lt;br /&gt;&lt;/pre&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;&lt;space&gt;&lt;/space&gt;&lt;/tt&gt; Indicates a space for positive values  so that positive values and negative values are aligned. For example,&lt;/p&gt;&lt;pre class="programlisting"&gt;printf("% d\n", 25);&lt;br /&gt;printf("% d", 25);&lt;br /&gt;&lt;/pre&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;It causes printing in the form of&lt;/p&gt;&lt;pre class="programlisting"&gt;b25&lt;br /&gt;25&lt;br /&gt;&lt;/pre&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;In the first case, blank is displayed.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;&lt;span class="unicode"&gt;−&lt;/span&gt; #&lt;/tt&gt; Indicates that the  value should be converted to another form before displaying. For example, for  hexadecimal values you can indicate 0X; for the floating data type, # indicates  that the decimal point should always be included in the output.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;0&lt;/tt&gt; Used with whole and real numbers, 0 causes 0s to  be padded to complete the field width. If the precision is specified as 0, then  this flag is ignored; if the 0 and – flags are both specified, the 0 flag is  ignored.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4 style="text-align: left;" class="sect4-title"&gt;ESCAPE SEQUENCE&lt;br /&gt;&lt;/h4&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="section"&gt; &lt;h3 class="sect3-title"&gt;&lt;a name="159"&gt;&lt;/a&gt;&lt;a name="ch05lev2sec3"&gt;&lt;/a&gt;&lt;/h3&gt; &lt;p class="first-para"&gt;&lt;tt&gt;Escape sequences&lt;/tt&gt; are the special directives used to  format printing. For example, &lt;tt&gt;\n&lt;/tt&gt; indicates that the next printing  should start from the first column of the next line. Following are the escape  sequences:&lt;/p&gt; &lt;ul class="simple-list"&gt;&lt;li class="first-listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;\a&lt;/tt&gt; Alert&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;Produces a beep or flash; the cursor position is not  changed.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;\b&lt;/tt&gt; Backspace&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;Moves the cursor to the last column of the previous  line.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;\f&lt;/tt&gt; Form feed&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;Moves the cursor to start of next page.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;\n&lt;/tt&gt; New line&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;Moves the cursor to the first column of the next line.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;\r&lt;/tt&gt; Carriage Return&lt;a name="160"&gt;&lt;/a&gt;&lt;a name="page62"&gt;&lt;/a&gt; &lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;Moves the cursor to the first column of the current  line.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;\t&lt;/tt&gt; Horizontal Tab&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;Moves the cursor to the next horizontal tab stop on the  line.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;\v&lt;/tt&gt; Vertical Tab&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;Moves the cursor to the next vertical tab stop on the  line.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;\\&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;Prints &lt;tt&gt;\\&lt;/tt&gt;.&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;&lt;tt&gt;\"&lt;/tt&gt; &lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;Prints "&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;%%&lt;/p&gt; &lt;/li&gt;&lt;li class="listitem"&gt; &lt;p class="first-para"&gt;Prints %.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-2222489675226833010?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/2222489675226833010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/placeholders-for-printf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/2222489675226833010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/2222489675226833010'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/placeholders-for-printf.html' title='PlaceHolders for printf'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-3983644799991927314</id><published>2009-03-17T10:13:00.000-07:00</published><updated>2009-09-11T11:50:31.093-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>Facts About Computer and Programming</title><content type='html'>&lt;ul&gt;&lt;li&gt;Most applications  in a data warehouse consists of transactions.&lt;/li&gt;&lt;li&gt;A Transaction consist of one read and write operation.&lt;/li&gt;&lt;li&gt;For security purpose we use proxy server along with firewall.&lt;/li&gt;&lt;li&gt;Rollback command undo all changes of a transaction.&lt;/li&gt;&lt;li&gt;Applet is a dynamic document application program.&lt;/li&gt;&lt;li&gt;The speed of a Super Computer is mainly measured in FLOPS.&lt;/li&gt;&lt;li&gt;RAID 3 is a single parity drive depends on disk controller for finding out which disk has failed.&lt;/li&gt;&lt;li&gt;Propagation time is the time which takes by a signal to transmit from one point of a medium to other end.&lt;/li&gt;&lt;li&gt;Sliding window protocol is used in data link layer to store the information about frame sequences and respective acknowledgement.&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;archie is a program to find files in ftp site.&lt;/li&gt;&lt;li&gt;website to get kernel source code&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;img src="file:///C:/DOCUME%7E1/ADMINI%7E1/LOCALS%7E1/Temp/moz-screenshot.jpg" alt="" /&gt;http://lxr.free-electrons.com/source/&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;The linux kernel mailing list http://www.tux.org/lkml/#s15-3&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;static library has extension .a and dynamic library has .so.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;files which shown in colors in linux require permissions.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;./ is the relative path and starts with / is called absolute path.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-3983644799991927314?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/3983644799991927314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/facts-about-computer-and-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/3983644799991927314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/3983644799991927314'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/facts-about-computer-and-programming.html' title='Facts About Computer and Programming'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-8552896189182098869</id><published>2009-03-16T11:19:00.000-07:00</published><updated>2009-04-08T10:19:13.579-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>Important facts in Writing a C Program</title><content type='html'>&lt;ul&gt;&lt;li&gt;Preprocessor can be redefined any where in the Program so that most recently assigned value will be taken.&lt;/li&gt;&lt;li&gt;The scope of the labels is limited to functions.&lt;/li&gt;&lt;li&gt;The case statement can have only constant expressions (this implies that we cannot use variable names directly). Enumerated types can be used in case statements.&lt;/li&gt;&lt;li&gt;Scanf returns number of items successfully read.&lt;/li&gt;&lt;li&gt;A variable is available for use from the point of declaration.&lt;/li&gt;&lt;li&gt;Pointers give a facility to access the value of a variable indirectly.&lt;/li&gt;&lt;li&gt;Prefix/postfix increment(++) and decrement(--) must be used with variables.&lt;/li&gt;&lt;li&gt;Precedence is very important in writing a expression.&lt;/li&gt;&lt;li&gt;Execution of preprocessor is separate from execution of compiler(Note: we can use any keywords and inbuilt function names).&lt;/li&gt;&lt;li&gt;Every function name contains some address. So we can easily print that address using printf("%p",main);.&lt;/li&gt;&lt;li&gt;Array names are pointer constants.&lt;/li&gt;&lt;li&gt;Character constants are saved in code/data area but not in stack.&lt;/li&gt;&lt;li&gt;g1##g2,Here g1 and g2 joined together.&lt;/li&gt;&lt;li&gt;The default return value of a function is int. if it is not declared.&lt;/li&gt;&lt;li&gt;printf can be implemented using variable length argument list.&lt;/li&gt;&lt;li&gt;asserts are used during debugging to make sure that certain conditions are satisfied. If assertion fails, the program will terminate reporting the same. After debugging use, #undef NDEBUG and this will disable all the assertions from the source code.  Assertion is a good debugging tool to make use of. if program terminates it shows &lt;&lt;filename&gt;&gt; &lt;&lt;line&gt;&gt; of the program.&lt;/line&gt;&lt;/filename&gt;&lt;/li&gt;&lt;li&gt;stdin,stdout,stderr these three files are opened automatically when c program executes.&lt;/li&gt;&lt;li&gt;SEEK_SET sets the file pointer to beginning of file.&lt;/li&gt;&lt;li&gt;SEEK_CUR and SEEK_END are set accordingly by the name.&lt;/li&gt;&lt;li&gt;if we want to read input between two quotation marks we should use scanf(" \"%[^\"]\"",s);.&lt;/li&gt;&lt;li&gt;fgets always return a pointer,So while reading end of file it returns NULL pointer.&lt;/li&gt;&lt;li&gt;If a program is continuously executed without any condition to terminate then its stack will filled completely and abnormally terminates.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;-1 is a boolean true value,Hence in if statement it executes next instruction of if.&lt;/li&gt;&lt;li&gt;When two strings are placed together (or separated by white-space) they are concatenated (this is called as "stringization" operation).&lt;/li&gt;&lt;li&gt;For array elements, consecutive memory locations are allocated.&lt;/li&gt;&lt;li&gt;&lt;a name="272"&gt;&lt;/a&gt;&lt;a name="page111"&gt;&lt;/a&gt;When a variable can be  resolved by using multiple references, the local definition is given more  preference.&lt;/li&gt;&lt;li&gt;The variables in C can have static or automatic  lifetimes.&lt;/li&gt;&lt;li&gt;When a variable has a static lifetime, memory is allocated  at the beginning of the program execution and it is reallocated only after the  program terminates.&lt;a name="285"&gt;&lt;/a&gt;&lt;a name="page117"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;When a variable has an automatic lifetime, the memory is  allocated to the variable when the function is called and it is deallocated once  the function completes its execution.&lt;/li&gt;&lt;li&gt;Global variables have static lifetimes. &lt;/li&gt;&lt;li&gt;By default, local variables have automatic lifetimes.&lt;/li&gt;&lt;li&gt;To make a local variable static, use the storage-class  specifier.&lt;/li&gt;&lt;li&gt;&lt;i class="emphasis"&gt;Extern&lt;/i&gt; means that the variable or function is implemented  elsewhere but is referred to in the current file.&lt;/li&gt;&lt;li&gt;memory is allocated to the global variable at the beginning of the program  execution.&lt;/li&gt;&lt;li&gt; Register allocation is done for faster access, generally for  loop counters.&lt;/li&gt;&lt;li&gt;You cannot declare global register variables.&lt;/li&gt;&lt;li&gt;The code between opening and closing curly brace called as block.&lt;/li&gt;&lt;li&gt;Array elements are Homogeneous(means their elements are of same type).&lt;/li&gt;&lt;li&gt;Structure elements are of Heterogeneous type (means their elements are of different type).&lt;/li&gt;&lt;li&gt;Never compare or at-least be cautious when using floating point numbers with relational operators (== , &gt;, &lt;, &lt;=, &gt;=,!= ) .&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-8552896189182098869?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/8552896189182098869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/important-facts-in-writing-c-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/8552896189182098869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/8552896189182098869'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/important-facts-in-writing-c-program.html' title='Important facts in Writing a C Program'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-49656630657933549</id><published>2009-03-16T10:43:00.000-07:00</published><updated>2009-03-20T10:04:41.451-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>Common Mistakes in C</title><content type='html'>&lt;ul&gt;&lt;li&gt; Initializing the structure member variables while declaring.&lt;/li&gt;&lt;li&gt;Converting a character Array into String without Appending NULL character.&lt;/li&gt;&lt;li&gt;Calling the function without declaring the Prototype.&lt;/li&gt;&lt;li&gt;Declared buffer must be initialized before use.&lt;/li&gt;&lt;li&gt;Using proper data types when copying functions from one project to another project.&lt;/li&gt;&lt;li&gt;Multiple definition of a function some times creates a problem when we are browsing the code through tags in some famous editors like vim etc.(NOTE: Enable the function which is currently in use.Comment the other ones).&lt;/li&gt;&lt;li&gt;Avoid same function names which are already defined in system library.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-49656630657933549?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/49656630657933549/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/common-mistakes-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/49656630657933549'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/49656630657933549'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/common-mistakes-in-c.html' title='Common Mistakes in C'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8866586641689355103.post-1484310130765095015</id><published>2009-03-16T10:22:00.000-07:00</published><updated>2009-03-19T11:09:37.248-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C Programming'/><title type='text'>C Operator Precedence</title><content type='html'>&lt;table style="border-collapse: collapse;color:#111111;" border="1" border cellpadding="2" cellspacing="0" width="90%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="center"&gt;&lt;span style="font-family:Courier New;font-size:100%;"&gt;()&lt;br /&gt;              []&lt;br /&gt;              .&lt;br /&gt;                -&gt;&lt;br /&gt;    ++  --&lt;/span&gt;&lt;/td&gt;               &lt;td&gt;Parentheses (function call)&lt;br /&gt;              Brackets (array subscript)&lt;br /&gt;              Member selection via object name&lt;br /&gt;              Member selection via pointer&lt;br /&gt;    Postfix increment/decrement&lt;br /&gt;&lt;/td&gt;               &lt;td valign="top"&gt;                 &lt;p align="center"&gt;left-to-right&lt;/p&gt;               &lt;/td&gt;             &lt;/tr&gt;             &lt;tr&gt;               &lt;td align="center"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Courier New;"&gt;++                --&lt;br /&gt;              +                -&lt;br /&gt;              !                ~&lt;br /&gt;              (&lt;i&gt;type&lt;/i&gt;)&lt;br /&gt;              *&lt;br /&gt;              &amp;amp;&lt;br /&gt;              sizeof&lt;/span&gt; &lt;/span&gt; &lt;/td&gt;               &lt;td&gt;Prefix increment/decrement&lt;br /&gt;              Unary plus/minus&lt;br /&gt;              Logical negation/bitwise complement&lt;br /&gt;              Cast (change &lt;i&gt;type&lt;/i&gt;)&lt;br /&gt;              Dereference&lt;br /&gt;              Address&lt;br /&gt;              Determine size in bytes&lt;/td&gt;               &lt;td align="center" valign="top"&gt;right-to-left&lt;/td&gt;             &lt;/tr&gt;             &lt;tr&gt;               &lt;td align="center"&gt;&lt;span style="font-family:Courier New;"&gt;*                /                %&lt;/span&gt;&lt;/td&gt;               &lt;td&gt;Multiplication/division/modulus&lt;/td&gt;               &lt;td align="center" valign="top"&gt;left-to-right&lt;/td&gt;             &lt;/tr&gt;             &lt;tr&gt;               &lt;td align="center"&gt;&lt;span style="font-family:Courier New;font-size:100%;"&gt;+                -&lt;/span&gt;&lt;/td&gt;               &lt;td&gt;Addition/subtraction&lt;/td&gt;               &lt;td align="center" valign="top"&gt;left-to-right&lt;/td&gt;             &lt;/tr&gt;             &lt;tr&gt;               &lt;td align="center"&gt;&lt;span style="font-family:Courier New;font-size:100%;"&gt;&lt;&lt;                &gt;&gt;&lt;/span&gt;&lt;/td&gt;               &lt;td&gt;Bitwise shift left,               Bitwise shift right&lt;/td&gt;               &lt;td align="center" valign="top"&gt;left-to-right&lt;/td&gt;             &lt;/tr&gt;             &lt;tr&gt;               &lt;td align="center"&gt;&lt;span style="font-family:Courier New;"&gt;&lt;                &lt;=&lt;br /&gt;                &gt;                &gt;=&lt;/span&gt;&lt;/td&gt;               &lt;td&gt;Relational less than/less than or equal to&lt;br /&gt;              Relational greater than/greater than or equal to&lt;/td&gt;               &lt;td align="center" valign="top"&gt;left-to-right&lt;/td&gt;             &lt;/tr&gt;             &lt;tr&gt;               &lt;td align="center"&gt;&lt;span style="font-family:Courier New;"&gt;==                !=&lt;/span&gt;&lt;/td&gt;               &lt;td&gt;Relational is equal to/is not equal to&lt;/td&gt;               &lt;td align="center" valign="top"&gt;left-to-right&lt;/td&gt;             &lt;/tr&gt;             &lt;tr&gt;               &lt;td align="center"&gt;&lt;span style="font-family:Courier New;"&gt;&amp;amp;&lt;/span&gt;&lt;/td&gt;               &lt;td&gt;Bitwise AND&lt;/td&gt;               &lt;td align="center" valign="top"&gt;left-to-right&lt;/td&gt;             &lt;/tr&gt;             &lt;tr&gt;               &lt;td align="center"&gt;&lt;span style="font-family:Courier New;"&gt;^&lt;/span&gt;&lt;/td&gt;               &lt;td&gt;Bitwise exclusive OR&lt;/td&gt;               &lt;td align="center" valign="top"&gt;left-to-right&lt;/td&gt;             &lt;/tr&gt;             &lt;tr&gt;               &lt;td align="center"&gt;&lt;span style="font-family:Courier New;font-size:100%;"&gt;|&lt;/span&gt;&lt;/td&gt;               &lt;td&gt;Bitwise inclusive OR&lt;/td&gt;               &lt;td align="center" valign="top"&gt;left-to-right&lt;/td&gt;             &lt;/tr&gt;             &lt;tr&gt;               &lt;td align="center"&gt;&lt;span style="font-family:Courier New;"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;/td&gt;               &lt;td&gt;Logical AND&lt;/td&gt;               &lt;td align="center" valign="top"&gt;left-to-right&lt;/td&gt;             &lt;/tr&gt;             &lt;tr&gt;               &lt;td align="center"&gt;&lt;span style="font-family:Courier New;font-size:100%;"&gt;||&lt;/span&gt;&lt;/td&gt;               &lt;td&gt;Logical OR&lt;/td&gt;               &lt;td align="center" valign="top"&gt;left-to-right&lt;/td&gt;             &lt;/tr&gt;             &lt;tr&gt;               &lt;td align="center"&gt;&lt;span style="font-family:Courier New;"&gt;?:&lt;/span&gt;&lt;/td&gt;               &lt;td&gt;Ternary conditional&lt;/td&gt;               &lt;td align="center" valign="top"&gt;right-to-left&lt;/td&gt;             &lt;/tr&gt;             &lt;tr&gt;               &lt;td align="center"&gt;&lt;span style="font-family:Courier New;"&gt;=&lt;br /&gt;              +=                -=&lt;br /&gt;              *=                /=&lt;br /&gt;              %=                &amp;amp;=&lt;br /&gt;              ^=                |=&lt;br /&gt;              &lt;&lt;=                &gt;&gt;=&lt;/span&gt;&lt;/td&gt;               &lt;td&gt;Assignment&lt;br /&gt;              Addition/subtraction assignment&lt;br /&gt;              Multiplication/division assignment&lt;br /&gt;              Modulus/bitwise AND assignment&lt;br /&gt;              Bitwise exclusive/inclusive OR assignment&lt;br /&gt;              Bitwise shift left/right assignment&lt;/td&gt;               &lt;td align="center" valign="top"&gt;right-to-left&lt;/td&gt;             &lt;/tr&gt;             &lt;tr&gt;               &lt;td&gt;               &lt;p align="center"&gt;&lt;span style="font-family:Courier New;"&gt;,&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;               &lt;td&gt;Comma (separate expressions)&lt;/td&gt;               &lt;td align="center" valign="top"&gt;left-to-right&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8866586641689355103-1484310130765095015?l=fastrevision.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fastrevision.blogspot.com/feeds/1484310130765095015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fastrevision.blogspot.com/2009/03/c-operator-precedence.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/1484310130765095015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8866586641689355103/posts/default/1484310130765095015'/><link rel='alternate' type='text/html' href='http://fastrevision.blogspot.com/2009/03/c-operator-precedence.html' title='C Operator Precedence'/><author><name>Revise Your Facts</name><uri>http://www.blogger.com/profile/15731385991949339474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
