<?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-5269639880422862868</id><updated>2011-07-08T02:07:57.592-07:00</updated><title type='text'>nihar</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5269639880422862868.post-754308803951005339</id><published>2010-09-14T20:43:00.001-07:00</published><updated>2010-09-14T20:43:46.181-07:00</updated><title type='text'></title><content type='html'>&lt;a href="http://www.desicomments.com/glitter-text-generator.php"&gt;&lt;img src="http://www.desicomments.com/i/20/h.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/a.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/p.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/p.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/y.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/0.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/0.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/0.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/0.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/0.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/0.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/0.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/e.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/n.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/g.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/i.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/n.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/e.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/e.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/r.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/s.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/0.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/d.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/a.gif" border=0 &gt;&lt;img src="http://www.desicomments.com/i/20/y.gif" border=0 &gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-754308803951005339?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/754308803951005339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/09/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/754308803951005339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/754308803951005339'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/09/blog-post.html' title=''/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-7565615642202138981</id><published>2010-09-07T00:11:00.000-07:00</published><updated>2010-09-07T00:11:52.997-07:00</updated><title type='text'>php interview quesitions</title><content type='html'>&lt;a href="http://www.desicomments.com/glitter-text-generator.php"&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/p.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/h.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/p.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/0.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/i.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/n.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/t.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/e.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/r.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/v.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/i.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/e.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/w.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/0.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/q.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/u.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/e.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/s.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/i.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/t.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/i.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/o.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/n.gif" /&gt;&lt;img border="0" src="http://www.desicomments.com/i/30/s.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. What does a special set of tags &lt;!--and--&gt;do in PHP? &lt;br /&gt;&lt;br /&gt;ans- The output is displayed directly to the browser. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. What’s the difference between include and require?&lt;br /&gt;&lt;br /&gt;ans&amp;nbsp;- It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue. &lt;br /&gt;&lt;br /&gt;3. I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?&lt;br /&gt;&lt;br /&gt;ans&amp;nbsp;- PHP Interpreter treats numbers beginning with 0 as octal. Look at the similar PHP interview questions for more numeric problems. &lt;br /&gt;&lt;br /&gt;4. Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example? &lt;br /&gt;&lt;br /&gt;ans- In this example it wouldn’t matter, since the variable is all by itself, but if you were to print something like "{$a},000,000 mln dollars", then you definitely need to use the braces. &lt;br /&gt;&lt;br /&gt;5. How do you define a constant? &lt;br /&gt;&lt;br /&gt;ans- Via define() directive, like define ("MYCONSTANT", 100); &lt;br /&gt;&lt;br /&gt;6. How do you pass a variable by value? &lt;br /&gt;&lt;br /&gt;ans- Just like in C++, put an ampersand in front of it, like $a = &amp;amp;$b &lt;br /&gt;&lt;br /&gt;7. Will comparison of string "10" and integer 11 work in PHP? &lt;br /&gt;&lt;br /&gt;ans- Yes, internally PHP will cast everything to the integer type, so numbers 10 and 11 will be compared. &lt;br /&gt;&lt;br /&gt;8. When are you supposed to use endif to end the conditional statement? &lt;br /&gt;&lt;br /&gt;ans- When the original if was followed by : and then the code block without braces. &lt;br /&gt;&lt;br /&gt;9. Explain the ternary conditional operator in PHP? &lt;br /&gt;&lt;br /&gt;ans- Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed. &lt;br /&gt;&lt;br /&gt;10. How do I find out the number of parameters passed into function? &lt;br /&gt;&lt;br /&gt;ans- func_num_args() function returns the number of parameters passed in. &lt;br /&gt;&lt;br /&gt;11. If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b?&lt;br /&gt;&lt;br /&gt;ans&amp;nbsp;- 100, it’s a reference to existing variable. &lt;br /&gt;&lt;br /&gt;12. What’s the difference between accessing a class method via -&amp;gt; and via ::? &lt;br /&gt;&lt;br /&gt;ans- :: is allowed to access methods that can perform static operations, i.e. those, which do not require object initialization. &lt;br /&gt;&lt;br /&gt;13. Are objects passed by value or by reference? &lt;br /&gt;&lt;br /&gt;ans- Everything is passed by value. &lt;br /&gt;&lt;br /&gt;14. How do you call a constructor for a parent class? &lt;br /&gt;&lt;br /&gt;ans- parent::constructor($value) &lt;br /&gt;&lt;br /&gt;15. What’s the special meaning of __sleep and __wakeup?&lt;br /&gt;&lt;br /&gt;ans&amp;nbsp;- __sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them. &lt;br /&gt;&lt;br /&gt;16. Why doesn’t the following code print the newline properly? &lt;!--p&lt;--&gt;&lt;br /&gt;&lt;br /&gt;$str = ‘Hello, there.nHow are you?nThanks for visiting TechInterviews’;&lt;br /&gt;&lt;br /&gt;print $str;&lt;br /&gt;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;Because inside the single quotes the n character is not interpreted as newline, just as a sequence of two characters - and n. &lt;br /&gt;&lt;br /&gt;17. Would you initialize your strings with single quotes or double quotes? &lt;br /&gt;&lt;br /&gt;ans- Since the data inside the single-quoted string is not parsed for variable substitution, it’s always a better idea speed-wise to initialize a string with single quotes, unless you specifically need variable substitution. &lt;br /&gt;&lt;br /&gt;18. How come the code &lt;!--p print "Contents: $arr[1]";--&gt;works, but &lt;!--p print "Contents: $arr[1][2]";--&gt;doesn’t for two-dimensional array of mine? &lt;br /&gt;&lt;br /&gt;ans- Any time you have an array with more than one dimension, complex parsing syntax is required. print "Contents: {$arr[1][2]}" would’ve worked. &lt;br /&gt;&lt;br /&gt;19. What is the difference between characters 23 and x23? &lt;br /&gt;&lt;br /&gt;ans- The first one is octal 23, the second is hex 23. &lt;br /&gt;&lt;br /&gt;20. With a heredoc syntax, do I get variable substitution inside the heredoc contents? &lt;br /&gt;&lt;br /&gt;ans- Yes. &lt;br /&gt;&lt;br /&gt;21. I want to combine two variables together: &lt;br /&gt;&lt;br /&gt;22. $var1 = 'Welcome to ';&lt;br /&gt;&lt;br /&gt;23. $var2 = 'TechInterviews.com';&lt;br /&gt;&lt;br /&gt;What will work faster? Code sample 1:&lt;br /&gt;&lt;br /&gt;$var 3 = $var1.$var2;&lt;br /&gt;&lt;br /&gt;Or code sample 2:&lt;br /&gt;&lt;br /&gt;$var3 = "$var1$var2";&lt;br /&gt;&lt;br /&gt;Both examples would provide the same result - $var3 equal to "Welcome to TechInterviews.com". However, Code Sample 1 will work significantly faster. Try it out with large sets of data (or via concatenating small sets a million times or so), and you will see that concatenation works significantly faster than variable substitution. &lt;br /&gt;&lt;br /&gt;24. For printing out strings, there are echo, print and printf. Explain the differences. &lt;br /&gt;&lt;br /&gt;ans- echo is the most primitive of them, and just outputs the contents following the construct to the screen. print is also a construct (so parentheses are optional when calling it), but it returns TRUE on successful output and FALSE if it was unable to print out the string. However, you can pass multiple parameters to echo, like: &lt;br /&gt;&lt;br /&gt;&lt;!--p echo 'Welcome ', 'to', ' ', 'TechInterviews!';--&gt;&lt;br /&gt;&lt;br /&gt;and it will output the string "Welcome to TechInterviews!" print does not take multiple parameters. It is also generally argued that echo is faster, but usually the speed advantage is negligible, and might not be there for future versions of PHP. printf is a function, not a construct, and allows such advantages as formatted output, but it’s the slowest way to print out data out of echo, print and printf. &lt;br /&gt;&lt;br /&gt;25. I am writing an application in PHP that outputs a printable version of driving directions. It contains some long sentences, and I am a neat freak, and would like to make sure that no line exceeds 50 characters. How do I accomplish that with PHP?&lt;br /&gt;&lt;br /&gt;ans&amp;nbsp;- On large strings that need to be formatted according to some length specifications, use wordwrap() or chunk_split(). &lt;br /&gt;&lt;br /&gt;26. What’s the output of the ucwords function in this example? &lt;br /&gt;&lt;br /&gt;27. $formatted = ucwords("TECHINTERVIEWS IS COLLECTION OF INTERVIEW QUESTIONS");&lt;br /&gt;&lt;br /&gt;print $formatted;&lt;br /&gt;&lt;br /&gt;What will be printed is TECHINTERVIEWS IS COLLECTION OF INTERVIEW QUESTIONS.&lt;br /&gt;&lt;br /&gt;ucwords() makes every first letter of every word capital, but it does not lower&lt;br /&gt;&lt;br /&gt;ans-case anything else. To avoid this, and get a properly formatted string, it’s worth using strtolower() first. &lt;br /&gt;&lt;br /&gt;28. What’s the difference between htmlentities() and htmlspecialchars()? &lt;br /&gt;&lt;br /&gt;ans- htmlspecialchars only takes care of &amp;lt;, &amp;gt;, single quote ‘, double quote " and ampersand. htmlentities translates all occurrences of character sequences that have different meaning in HTML. &lt;br /&gt;&lt;br /&gt;29. What’s the difference between md5(), crc32() and sha1() crypto on PHP? &lt;br /&gt;&lt;br /&gt;ans- The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits, while sha1() returns a 128 bit value, and md5() returns a 160 bit value. This is important when avoiding collisions. &lt;br /&gt;&lt;br /&gt;30. So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()? &lt;br /&gt;&lt;br /&gt;ans- Crypto usage in PHP is simple, but that doesn’t mean it’s free. First off, depending on the data that you’re encrypting, you might have reasons to store a 32-bit value in the database instead of the 160-bit value to save on space. Second, the more secure the crypto is, the longer is the computation time to deliver the hash value. A high volume site might be significantly slowed down, if frequent md5() generation is required.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-7565615642202138981?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/7565615642202138981/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/09/php-interview-quesitions.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/7565615642202138981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/7565615642202138981'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/09/php-interview-quesitions.html' title='php interview quesitions'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-937483729652176321</id><published>2010-08-29T20:54:00.000-07:00</published><updated>2010-08-29T20:54:07.205-07:00</updated><title type='text'>habbul telescope photos</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_X50GYp5yKWY/THsqqHAxzUI/AAAAAAAAAEM/AhsM_YEb8_8/s1600/image3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://3.bp.blogspot.com/_X50GYp5yKWY/THsqqHAxzUI/AAAAAAAAAEM/AhsM_YEb8_8/s320/image3.jpg" /&gt;&lt;/a&gt;&lt;a href="http://4.bp.blogspot.com/_X50GYp5yKWY/THsqunuoiSI/AAAAAAAAAEU/DRbScsCofCM/s1600/image4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://4.bp.blogspot.com/_X50GYp5yKWY/THsqunuoiSI/AAAAAAAAAEU/DRbScsCofCM/s320/image4.jpg" /&gt;&lt;/a&gt;&lt;a href="http://2.bp.blogspot.com/_X50GYp5yKWY/THsqx4fx5JI/AAAAAAAAAEc/F4qFKYCtl-0/s1600/image5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://2.bp.blogspot.com/_X50GYp5yKWY/THsqx4fx5JI/AAAAAAAAAEc/F4qFKYCtl-0/s320/image5.jpg" /&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_X50GYp5yKWY/THsq0wGaQ-I/AAAAAAAAAEk/tlsSNgHBcLI/s1600/image6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://3.bp.blogspot.com/_X50GYp5yKWY/THsq0wGaQ-I/AAAAAAAAAEk/tlsSNgHBcLI/s320/image6.jpg" /&gt;&lt;/a&gt;&lt;a href="http://4.bp.blogspot.com/_X50GYp5yKWY/THsq30-bgTI/AAAAAAAAAEs/n--MUyQ1UoQ/s1600/image7.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://4.bp.blogspot.com/_X50GYp5yKWY/THsq30-bgTI/AAAAAAAAAEs/n--MUyQ1UoQ/s320/image7.jpg" /&gt;&lt;/a&gt;&lt;a href="http://1.bp.blogspot.com/_X50GYp5yKWY/THsq-FcL3fI/AAAAAAAAAE0/Y_4GBbljJ0U/s1600/image8.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://1.bp.blogspot.com/_X50GYp5yKWY/THsq-FcL3fI/AAAAAAAAAE0/Y_4GBbljJ0U/s320/image8.jpg" /&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_X50GYp5yKWY/THsrB5QSADI/AAAAAAAAAE8/Y0dSEdVjYbs/s1600/image9.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://3.bp.blogspot.com/_X50GYp5yKWY/THsrB5QSADI/AAAAAAAAAE8/Y0dSEdVjYbs/s320/image9.jpg" /&gt;&lt;/a&gt;&lt;a href="http://1.bp.blogspot.com/_X50GYp5yKWY/THsrF6kEBaI/AAAAAAAAAFE/V9FVPBwd0ao/s1600/image10.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://1.bp.blogspot.com/_X50GYp5yKWY/THsrF6kEBaI/AAAAAAAAAFE/V9FVPBwd0ao/s320/image10.jpg" /&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_X50GYp5yKWY/THsrJV0YwoI/AAAAAAAAAFM/8hfhhU3aotk/s1600/image11.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://3.bp.blogspot.com/_X50GYp5yKWY/THsrJV0YwoI/AAAAAAAAAFM/8hfhhU3aotk/s320/image11.jpg" /&gt;&lt;/a&gt;&lt;a href="http://4.bp.blogspot.com/_X50GYp5yKWY/THsrNMTeWII/AAAAAAAAAFU/yis8iiJRoJ8/s1600/images1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://4.bp.blogspot.com/_X50GYp5yKWY/THsrNMTeWII/AAAAAAAAAFU/yis8iiJRoJ8/s320/images1.jpg" /&gt;&lt;/a&gt;&lt;a href="http://2.bp.blogspot.com/_X50GYp5yKWY/THsrQ6TVtfI/AAAAAAAAAFc/wJEANAcqcP8/s1600/images2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" ox="true" src="http://2.bp.blogspot.com/_X50GYp5yKWY/THsrQ6TVtfI/AAAAAAAAAFc/wJEANAcqcP8/s320/images2.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-937483729652176321?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/937483729652176321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/habbul-telescope-photos.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/937483729652176321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/937483729652176321'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/habbul-telescope-photos.html' title='habbul telescope photos'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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/_X50GYp5yKWY/THsqqHAxzUI/AAAAAAAAAEM/AhsM_YEb8_8/s72-c/image3.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5269639880422862868.post-6246316109050999747</id><published>2010-08-23T04:55:00.001-07:00</published><updated>2010-08-23T04:55:35.061-07:00</updated><title type='text'></title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_X50GYp5yKWY/THJhjbF9_LI/AAAAAAAAAD8/_phoiYFZt_w/s1600/hubble_newold12.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="388" ox="true" src="http://3.bp.blogspot.com/_X50GYp5yKWY/THJhjbF9_LI/AAAAAAAAAD8/_phoiYFZt_w/s640/hubble_newold12.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-6246316109050999747?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/6246316109050999747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/blog-post_5950.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/6246316109050999747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/6246316109050999747'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/blog-post_5950.html' title=''/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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/_X50GYp5yKWY/THJhjbF9_LI/AAAAAAAAAD8/_phoiYFZt_w/s72-c/hubble_newold12.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5269639880422862868.post-3090894970131295492</id><published>2010-08-23T04:30:00.000-07:00</published><updated>2010-08-23T04:30:47.349-07:00</updated><title type='text'></title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-b0347cdf122ccbca" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v10.nonxt2.googlevideo.com/videoplayback?id%3Db0347cdf122ccbca%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331331978%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D9413097725F5DFB045083E8190DEFA85BD6021D.3305E5DEA1084255623E57D466696160EA2B62D7%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Db0347cdf122ccbca%26offsetms%3D5000%26itag%3Dw160%26sigh%3DvgXfuIlQ3ATs6-IBqUfSIY4utw4&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v10.nonxt2.googlevideo.com/videoplayback?id%3Db0347cdf122ccbca%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331331978%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D9413097725F5DFB045083E8190DEFA85BD6021D.3305E5DEA1084255623E57D466696160EA2B62D7%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Db0347cdf122ccbca%26offsetms%3D5000%26itag%3Dw160%26sigh%3DvgXfuIlQ3ATs6-IBqUfSIY4utw4&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-3090894970131295492?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/3090894970131295492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/blog-post_23.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/3090894970131295492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/3090894970131295492'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/blog-post_23.html' title=''/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-7756374466196947831</id><published>2010-08-21T03:12:00.000-07:00</published><updated>2010-08-21T03:12:02.942-07:00</updated><title type='text'>jntu(k)2008 5th sem quesition papers</title><content type='html'>&lt;span style="color: blue;"&gt;MULTIMEDIA APPLICATION DEVELOPMENT&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;1. a) Explain the various multimedia software tools?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) List and explain the image data types?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;2. Enumerate the differences between NTSC video, PAL video and SECAM video?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;3. a) Explain the various features of Action script?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) List out and describe the data types and type checking in Action Script?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;4. Describe OOP Application framework?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;5. Explain the importance of the concept of inheritance in action script with an example?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;6. a) Explain the steps of the Shannon – Fano algorithm with an example?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) What is wavelet based coding?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;7. Describe the MPEG standard?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;8. Write short notes on&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;a) Multimedia over ATM networks&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Media – On – Demand (MOD)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;OBJECT ORIENTED ANALYSIS &amp;amp; DESIGN (USING UML)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;1. a) What is the need for modeling?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Explain software development lifecycle.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;2. a) List and explain types of relationships used in object-oriented modeling along with their&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;notation.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) What is the importance of package? How it is modeled in UML?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;3. a) What are the contents of class diagram?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) List and explain uses of class diagram.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;4. a) What is an Interaction? What kinds of messages can be modeled in UML?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Distinguish between sequence Diagram and Interaction Diagram.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;5. Write short notes on the following:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;a) Swimlanes&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Usecases.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;6. Compare the following&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;a) Event Vs Signal&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Sequential substates Vs Concurrent substates.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;7. a) Distinguish between nodes and components.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Explain how collaboration is used to model the Realization of a usecase.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;8. a) Draw and explain class Diagram for unified Library system.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Draw and explain sequence Diagram for “Issue of Book”&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;SOFTWARE PROJECT MANAGEMENT&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;1. a) What are the drawbacks of waterfall model?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Based on what parameters software cost can be estimated? Explain.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;2. a) List advantages and drawbacks of custom software in comparison with commercial&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;components.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Explain principles of software management.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;3. a) Give an overview of lifecycle software process Artifacts.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Explain about elaboration phase in lifecycle process.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;4. a) From technical perspective discuss about software Architecture.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Describe iteration’s workflow sequence.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;5. a) What is the need and contents of periodic status Assessment Reviews?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Discuss about project planning using top-down and bottom-up approach.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;6. a) List software Management team activities.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Write about change Management team activities in interactive process.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;7. a) What are the goals of software Metrics? Discuss in detail about core Metrics.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) With some example applications explain process variability in technical and management&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;dimensions.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;8. a) Explain features and benefits of a modern process from the point of software project&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;manager.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Discuss about changes in modern software economics.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;SOFTWARE TESTING METHODOLOGIES&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;1. a) Discuss in detail various phases in a Tester’s Mental life.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Explain the importance of bugs.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;2. a) Compare and contrast between control flow graphs and flow charts.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Give a detailed note on path testing.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;3. a) What are the steps involved in a transaction for an online information retrieval systems?&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;Explain with an example.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Explain about structured test strategies in detail.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;4. a) Give a note on testing of two-dimensional domains.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Discuss about domain ambiguities and contradictions.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;5. Explain in detail the reduction procedure for converting a flow graph into a path&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;expression with example.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;6. a) Draw the KU chart for the specification below:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Write about change Management team activities in interactive process.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;7. a) “Specifications are one of the most common source of ambiguities and contradictions.”&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;Explain with an example.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) Explain the impact of bugs in state testing.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;8. a) Discuss about node-reduction algorithm with a suitable example.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;b) What are the reasons why two-dimensional array representation is not convenient for&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;larger graphs?. &lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;*************Related Posts by Categories****&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-7756374466196947831?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/7756374466196947831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/jntuk2008-5th-sem-quesition-papers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/7756374466196947831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/7756374466196947831'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/jntuk2008-5th-sem-quesition-papers.html' title='jntu(k)2008 5th sem quesition papers'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-4770524101839179152</id><published>2010-08-21T03:06:00.000-07:00</published><updated>2010-08-21T03:06:37.215-07:00</updated><title type='text'>jntu(k)2009 5th sem quesition papers</title><content type='html'>&lt;span style="color: red;"&gt;JNTU Kakinada MCA 5th Sem Regular &amp;amp; Supplementary Exams, November 2009&lt;/span&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;Subject code: MC512&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;E-COMMERCE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Answer any FIVE questions. All questions carry Equal marks&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. a) Define E-Commerce and Explain the benefits of Electronic Commerce. 6M&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;b) Discuss briefly about the E-commerce consumer applications. 6M&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;2. a) Explain briefly about Home Shopping. 4M&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;b) What is meant by Home entertainment? How it is related to E-Commerce and explain the size &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;the size of the Home Entertainment market? 8M&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;3. a) List of the types of Electronic payment systems. 4M&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;b) How the payment transaction sequence is happens in the Electronic check system and &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;explain its advantages 8M&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;4 . a) Define EDI. Explain about EDI layered Architecture. 6M&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;b) How EDI works? Explain. 6M&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;5. Explain clearly about Customization and internal Commerce. 12M&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;6. a) Expain how advertising is carrid out on Internet. 6M&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;b)Briefly discuss about Digital documents. 6M&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;7. What is the purpose of Search Engine? Explain about Wide Area Information Services (WAIS)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Engine. 12M&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;8. a) Explain the steps in desktop video processing. 6M&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;b) Write notes on multimedia storage Technology. 6M&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;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;Multimedia Application Development&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;JNTU Kakinada MCA 5th Sem Regular &amp;amp; Supplementary Exams, November 2009&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Subject code: MC513 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Answer any 5 questions &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. a) Explain about multimedia software tools. &lt;br /&gt;&lt;br /&gt;b) Explain about www &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. a) Explain about MIDI &lt;br /&gt;&lt;br /&gt;b) Explain about transmission of audio &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. a) What are the features of action script? &lt;br /&gt;&lt;br /&gt;b) Write ashort note on databases with examples &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. a) What is meant by Inheritance? Explain. &lt;br /&gt;&lt;br /&gt;b) What are the different types of exceptions? Explain. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. What is meant by object- orient programming? explain about the applications of OOP. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. a) Explain about variable- length coding with examples &lt;br /&gt;&lt;br /&gt;b)Explain about arthematic coding with examples &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7. a) Explain about audio compression techniques. &lt;br /&gt;&lt;br /&gt;b) Write a short note on MPEG. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8. Explain about the following &lt;br /&gt;&lt;br /&gt;a) MOD &lt;br /&gt;&lt;br /&gt;b) Multimedia over IP &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OBJECT ORIENTED ANALYSIS AND DESIGN (USING UML) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;JNTU Kakinada MCA 5th Sem Regular &amp;amp; Supplementary Exams, November 2009&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Subject code: MC514 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ANSWER ANY FIVE QUESTIONS &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. a) What are the essential features of object oriented paradigm? Explain them briefly. (6M) &lt;br /&gt;&lt;br /&gt;b) Explain the conceptual model of diagram of UML. Briefly explain various types of things of UML. (6M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. Explain about Types and Roles, Interfaces and Packages with suitable diagrams. (12 M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. a) Explain terms and concepts of Object diagram with example. (6 M) &lt;br /&gt;&lt;br /&gt;b) Explain terms and concepts of Class diagram with example. (6M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Briefly explain the terms and concepts of Collaboration diagram. Draw the Collaboration diagram for ATM bank transactions. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. a) Define Activity Diagram. Briefly explain all its terms and concepts in activity Diagram. (6M) &lt;br /&gt;&lt;br /&gt;b) How are forking and joining used in activity diagrams? Give examples . (6 M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. a) Define the terms Event, Signal, State machine, Process and Thread with examples. (6M) &lt;br /&gt;&lt;br /&gt;b)Explain briefly about state chart diagrams with examples. (6M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7. a) Explain terms and Concepts of Component Diagram with neat example. (6 M) &lt;br /&gt;&lt;br /&gt;b) What are the common modeling techniques in Component diagram? (6M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8. Give detail case study of United Library Application. (12 M) &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;SOFTWARE PROJECT MANAGEMENT &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;JNTU Kakinada MCA 5th Sem Regular &amp;amp; Supplementary Exams, November 2009&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Subject code: MC515 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ANSWER ANY FIVE QUESTIONS &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1.a) Define progress. Show the development progress of a conventional project diagramatically. (6M) &lt;br /&gt;&lt;br /&gt;b) what is meant by late late risk resolution? (6M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2.a) Write the characteristics of an object oriented project. (6M) &lt;br /&gt;&lt;br /&gt;b) In what way software process is aoverload term? Explain. (6M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3.a) Write briefly about work break down structure. (6M) &lt;br /&gt;&lt;br /&gt;b) Describe the life cycle process (6M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4.a) Discuss the architecture of software with the help of a diagram. (6M) &lt;br /&gt;&lt;br /&gt;b) show the relative levels of effort expected across the phases of life cycle. (6M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5.a) what are milestones? What minor milestones needed to be considered when aproject is being planned? (6M) &lt;br /&gt;&lt;br /&gt;b) what is the necessirty of periodic statu8s assesment? (6M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6.a) Explain the roles and responsibilities in a software line of bussines organisation. (6M) &lt;br /&gt;&lt;br /&gt;b) Illustrate the activities of software assessment team. (6M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7.a) What are quality indicators? Briefly Explain. (6M) &lt;br /&gt;&lt;br /&gt;b) Write the purpose and priorities of seven core metrics. (6M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8.a) Give the risk profile of a modern project across its life cycle. (6M) &lt;br /&gt;&lt;br /&gt;b) On what factors should the next generation software cost models focus at? (6M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Software Testing Methodologies &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;JNTU Kakinada MCA 5th Sem Regular &amp;amp; Supplementary Exams, November 2009&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Subject code: MC518 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ANSWER ANY FIVE QUESTIONS &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1.a) What are the goals for testing? (3M) &lt;br /&gt;&lt;br /&gt;b) What are the differences between Testing and Debugging? (3 M) &lt;br /&gt;&lt;br /&gt;c) Explain the Taxonomy of Bugs. (6 M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. a) What is a control flow and what are its components? (4 M) &lt;br /&gt;&lt;br /&gt;b) What is path Instrumentation? Explain various Instrumentation Methods. (8 M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. a) Briefly Explain Data flow techniques.(6 M) &lt;br /&gt;&lt;br /&gt;b) Explain the Data flow Model. (6 M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. a) Explain Nice Domains. (6 M) &lt;br /&gt;&lt;br /&gt;b) What are 2D Domain bugs? Explain the procedure for detecting these bugs. (6 M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. a) How path expressions are converted into Regular expressions. Give some examples. (6 M) &lt;br /&gt;&lt;br /&gt;b) Explain the following (6 M) &lt;br /&gt;&lt;br /&gt;i) Path products ii) Path Sums &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. a) Explain the role of Decision tables in Test case design and how predicates and rule evaluations are taken care off. (6 M) &lt;br /&gt;&lt;br /&gt;b) Write the procedure for specification validation (6 M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7. a) Explain State Bugs. (6 M) &lt;br /&gt;&lt;br /&gt;b) Describe the design guidelines to build Finite State machines into your code. (6 M) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;8. a) Describe how transtive closure is used to convert an arbitrary graph into partly ordered graph. (6 M) &lt;br /&gt;&lt;br /&gt;b) Explain how to use Apache J Meter to test the performance of the database server, when multiple users try to access the database simultaneously. (6 M)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-4770524101839179152?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/4770524101839179152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/jntuk2009-5th-sem-quesition-papers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/4770524101839179152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/4770524101839179152'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/jntuk2009-5th-sem-quesition-papers.html' title='jntu(k)2009 5th sem quesition papers'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-3706247042982937429</id><published>2010-08-19T03:54:00.001-07:00</published><updated>2010-08-19T03:54:25.278-07:00</updated><title type='text'></title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_X50GYp5yKWY/TG0NKI88VII/AAAAAAAAACk/_W7Ule3gjk8/s1600/p10.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="256" ox="true" src="http://4.bp.blogspot.com/_X50GYp5yKWY/TG0NKI88VII/AAAAAAAAACk/_W7Ule3gjk8/s320/p10.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-3706247042982937429?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/3706247042982937429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/blog-post_19.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/3706247042982937429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/3706247042982937429'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/blog-post_19.html' title=''/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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/_X50GYp5yKWY/TG0NKI88VII/AAAAAAAAACk/_W7Ule3gjk8/s72-c/p10.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5269639880422862868.post-5466231966165927006</id><published>2010-08-18T05:10:00.001-07:00</published><updated>2010-08-18T05:10:55.194-07:00</updated><title type='text'>images</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_X50GYp5yKWY/TGvNgZrlfgI/AAAAAAAAABI/TGhLfIw2jho/s1600/car5.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" ox="true" src="http://3.bp.blogspot.com/_X50GYp5yKWY/TGvNgZrlfgI/AAAAAAAAABI/TGhLfIw2jho/s320/car5.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_X50GYp5yKWY/TGvNi8oSc5I/AAAAAAAAABM/hJPT_HHbliU/s1600/car6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" ox="true" src="http://3.bp.blogspot.com/_X50GYp5yKWY/TGvNi8oSc5I/AAAAAAAAABM/hJPT_HHbliU/s320/car6.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_X50GYp5yKWY/TGvNkTYIkmI/AAAAAAAAABQ/H38IFKWivYA/s1600/ferrari.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="180" ox="true" src="http://2.bp.blogspot.com/_X50GYp5yKWY/TGvNkTYIkmI/AAAAAAAAABQ/H38IFKWivYA/s320/ferrari.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_X50GYp5yKWY/TGvNmD5XczI/AAAAAAAAABU/nMAtMKTaYS0/s1600/car1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="220" ox="true" src="http://2.bp.blogspot.com/_X50GYp5yKWY/TGvNmD5XczI/AAAAAAAAABU/nMAtMKTaYS0/s320/car1.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_X50GYp5yKWY/TGvNn6EmcXI/AAAAAAAAABY/peCdWvkT-Xs/s1600/car2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="186" ox="true" src="http://4.bp.blogspot.com/_X50GYp5yKWY/TGvNn6EmcXI/AAAAAAAAABY/peCdWvkT-Xs/s320/car2.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_X50GYp5yKWY/TGvNpAU2MDI/AAAAAAAAABc/W2CTDJJE40o/s1600/car3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" ox="true" src="http://4.bp.blogspot.com/_X50GYp5yKWY/TGvNpAU2MDI/AAAAAAAAABc/W2CTDJJE40o/s320/car3.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_X50GYp5yKWY/TGvNqOOtobI/AAAAAAAAABg/NvjmydARtaI/s1600/car4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="225" ox="true" src="http://2.bp.blogspot.com/_X50GYp5yKWY/TGvNqOOtobI/AAAAAAAAABg/NvjmydARtaI/s320/car4.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-5466231966165927006?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/5466231966165927006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/images.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/5466231966165927006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/5466231966165927006'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/images.html' title='images'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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/_X50GYp5yKWY/TGvNgZrlfgI/AAAAAAAAABI/TGhLfIw2jho/s72-c/car5.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5269639880422862868.post-4517235802727495648</id><published>2010-08-17T00:30:00.000-07:00</published><updated>2010-08-17T00:30:34.107-07:00</updated><title type='text'>java</title><content type='html'>&lt;span style="color: red;"&gt;What is Collection API ?&lt;/span&gt;&lt;br /&gt;The Collection API is a set of classes and interfaces that support operation on collections of objects. These classes and interfaces are more flexible, more powerful, and more regular than the vectors, arrays, and hashtables if effectively replaces. &lt;br /&gt;Example of classes: HashSet, HashMap, ArrayList, LinkedList, TreeSet and TreeMap.&lt;br /&gt;Example of interfaces: Collection, Set, List and Map.&lt;br /&gt;Is Iterator a Class or Interface? What is its use? &lt;br /&gt;Answer: Iterator is an interface which is used to step through the elements of a Collection. &lt;br /&gt;What is similarities/difference between an Abstract class and Interface? &lt;br /&gt;Differences are as follows: &lt;br /&gt;Interfaces provide a form of multiple inheritance. A class can extend only one other class. Interfaces are limited to public methods and constants with no implementation. Abstract classes can have a partial implementation, protected parts, static methods, etc. &lt;br /&gt;A Class may implement several interfaces. But in case of abstract class, a class may extend only one abstract class. Interfaces are slow as it requires extra indirection to to find corresponding method in in the actual class. Abstract classes are fast. &lt;br /&gt;Similarities: &lt;br /&gt;&lt;br /&gt;Neither Abstract classes or Interface can be instantiated. &lt;br /&gt;&lt;span style="color: red;"&gt;Java Interview Questions - How to define an Abstract class? &lt;/span&gt;&lt;br /&gt;A class containing abstract method is called Abstract class. An Abstract class can't be instantiated.&lt;br /&gt;Example of Abstract class:&lt;br /&gt;abstract class testAbstractClass {&lt;br /&gt;protected String myString; &lt;br /&gt;public String getMyString() { &lt;br /&gt;return myString; &lt;br /&gt;} &lt;br /&gt;public abstract string anyAbstractFunction();&lt;br /&gt;} &lt;br /&gt;&lt;span style="color: red;"&gt;How to define an Interface in Java ?&lt;/span&gt; &lt;br /&gt;In Java Interface defines the methods but does not implement them. Interface can include constants. A class that implements the interfaces is bound to implement all the methods defined in Interface.&lt;br /&gt;Emaple of Interface:&lt;br /&gt;&lt;br /&gt;public interface sampleInterface {&lt;br /&gt;public void functionOne();&lt;br /&gt;&lt;br /&gt;public long CONSTANT_ONE = 1000; &lt;br /&gt;}&lt;br /&gt;&lt;span style="color: red;"&gt;If a class is located in a package, what do you need to change in the OS environment to be able to use it?&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;You need to add a directory or a jar file that contains the package directories to the CLASSPATH environment variable. Let's say a class Employee belongs to a package com.xyz.hr; and is located in the file c:\dev\com\xyz\hr\Employee.java. In this case, you'd need to add c:\dev to the variable CLASSPATH. If this class contains the method main(), you could test it from a command prompt window as follows:&lt;br /&gt;c:\&amp;gt;java com.xyz.hr.Employee &lt;br /&gt;&lt;span style="color: red;"&gt;How many methods in the Serializable interface?&lt;/span&gt; &lt;br /&gt;There is no method in the Serializable interface. The Serializable interface acts as a marker, telling the object serialization tools that your class is serializable. &lt;br /&gt;&lt;span style="color: red;"&gt;How many methods in the Externalizable interface?&lt;/span&gt; &lt;br /&gt;There are two methods in the Externalizable interface. You have to implement these two methods in order to make your class externalizable. These two methods are readExternal() and writeExternal(). &lt;br /&gt;&lt;span style="color: red;"&gt;What is the difference between Serializalble and Externalizable interface?&lt;/span&gt; &lt;br /&gt;When you use Serializable interface, your class is serialized automatically by default. But you can override writeObject() and readObject() two methods to control more complex object serailization process. When you use Externalizable interface, you have a complete control over your class's serialization process.&lt;br /&gt;&lt;span style="color: red;"&gt;What is a transient variable in Java?&lt;/span&gt; &lt;br /&gt;A transient variable is a variable that may not be serialized. If you don't want some field to be serialized, you can mark that field transient or static.&lt;br /&gt;&lt;span style="color: red;"&gt;Which containers use a border layout as their default layout?&lt;/span&gt; &lt;br /&gt;The Window, Frame and Dialog classes use a border layout as their default layout.&lt;br /&gt;&lt;span style="color: red;"&gt;How are Observer and Observable used?&lt;/span&gt; &lt;br /&gt;Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated, it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by objects that observe Observable objects.&lt;br /&gt;&lt;span style="color: red;"&gt;What is Java?&lt;/span&gt;&lt;br /&gt;Java is an object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. The language, initially called Oak (named after the oak trees outside Gosling's office), was intended to replace C++, although the feature set better resembles that of Objective C. Java should not be confused with JavaScript, which shares only the name and a similar C-like syntax. Sun Microsystems currently maintains and updates Java regularly. &lt;br /&gt;&lt;span style="color: red;"&gt;What does a well-written OO program look like?&lt;/span&gt; &lt;br /&gt;A well-written OO program exhibits recurring structures that promote abstraction, flexibility, modularity and elegance. &lt;br /&gt;&lt;span style="color: red;"&gt;Can you have virtual functions in Java?&lt;/span&gt; &lt;br /&gt;Yes, all functions in Java are virtual by default. This is actually a pseudo trick question because the word "virtual" is not part of the naming convention in Java (as it is in C++, C-sharp and VB.NET), so this would be a foreign concept for someone who has only coded in Java. Virtual functions or virtual methods are functions or methods that will be redefined in derived classes. &lt;br /&gt;Jack developed a program by using a Map container to hold key/value pairs. He wanted to make a change to the map. He decided to make a clone of the map in order to save the original data on side. What do you think of it? ? &lt;br /&gt;If Jack made a clone of the map, any changes to the clone or the original map would be seen on both maps, because the clone of Map is a shallow copy. So Jack made a wrong decision. &lt;br /&gt;&lt;span style="color: red;"&gt;What is more advisable to create a thread, by implementing a Runnable interface or by extending Thread class? &lt;/span&gt;&lt;br /&gt;Strategically speaking, threads created by implementing Runnable interface are more advisable. If you create a thread by extending a thread class, you cannot extend any other class. If you create a thread by implementing Runnable interface, you save a space for your class to extend another class now or in future. &lt;br /&gt;&lt;span style="color: red;"&gt;What is NullPointerException and how to handle it? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When an object is not initialized, the default value is null. When the following things happen, the NullPointerException is thrown: &lt;br /&gt;--Calling the instance method of a null object.&lt;br /&gt;--Accessing or modifying the field of a null object.&lt;br /&gt;--Taking the length of a null as if it were an array.&lt;br /&gt;--Accessing or modifying the slots of null as if it were an array.&lt;br /&gt;--Throwing null as if it were a Throwable value.&lt;br /&gt;The NullPointerException is a runtime exception. The best practice is to catch such exception even if it is not required by language design. &lt;br /&gt;An application needs to load a library before it starts to run, how to code?&lt;br /&gt;One option is to use a static block to load a library before anything is called. For example, &lt;br /&gt;class Test { &lt;br /&gt;static {&lt;br /&gt;System.loadLibrary("path-to-library-file");&lt;br /&gt;}&lt;br /&gt;....&lt;br /&gt;} &lt;br /&gt;When you call new Test(), the static block will be called first before any initialization happens. Note that the static block position may matter. &lt;br /&gt;How could Java classes direct program messages to the system console, but error messages, say to a file? &lt;br /&gt;The class System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both point at the system console. This how the standard output could be re-directed: &lt;br /&gt;Stream st = new Stream(new FileOutputStream("output.txt")); System.setErr(st); System.setOut(st);&lt;br /&gt;&lt;span style="color: red;"&gt;What's the difference between an interface and an abstract class? &lt;/span&gt;&lt;br /&gt;An abstract class may contain code in method bodies, which is not allowed in an interface. With abstract classes, you have to inherit your class from it and Java does not allow multiple inheritance. On the other hand, you can implement multiple interfaces in your class. &lt;br /&gt;Name the containers which uses Border Layout as their default layout? &lt;br /&gt;Containers which uses Border Layout as their default are: window, Frame and Dialog classes. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Java Interview Questions and Answers&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;What is synchronization and why is it important?&lt;/span&gt;&lt;br /&gt;With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often causes dirty data and leads to significant errors. &lt;br /&gt;&lt;span style="color: red;"&gt;What are synchronized methods and synchronized statements?&lt;/span&gt; &lt;br /&gt;Synchronized methods are methods that are used to control access to a method or an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class. Synchronized statements are similar to synchronized methods. A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement. &lt;br /&gt;&lt;span style="color: red;"&gt;What are three ways in which a thread can enter the waiting state?&lt;/span&gt; &lt;br /&gt;A thread can enter the waiting state by invoking its sleep() method, by blocking on IO, by unsuccessfully attempting to acquire an object's lock, or by invoking an object's wait() method. It can also enter the waiting state by invoking its (deprecated) suspend() method. &lt;br /&gt;&lt;span style="color: red;"&gt;Can a lock be acquired on a class?&lt;/span&gt; &lt;br /&gt;Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object. &lt;br /&gt;What's new with the stop(), suspend() and resume() methods in JDK 1.2? &lt;br /&gt;The stop(), suspend() and resume() methods have been deprecated in JDK 1.2. &lt;br /&gt;&lt;span style="color: red;"&gt;What is the preferred size of a component?&lt;/span&gt; &lt;br /&gt;The preferred size of a component is the minimum component size that will allow the component to display normally. &lt;br /&gt;&lt;span style="color: red;"&gt;What's the difference between J2SDK 1.5 and J2SDK 5.0?&lt;/span&gt; &lt;br /&gt;There's no difference, Sun Microsystems just re-branded this version. &lt;br /&gt;What would you use to compare two String variables - the operator == or the method equals()? &lt;br /&gt;I'd use the method equals() to compare the values of the Strings and the == to check if two variables point at the same instance of a String object.&lt;br /&gt;&lt;span style="color: red;"&gt;What is thread?&lt;/span&gt; &lt;br /&gt;A thread is an independent path of execution in a system. &lt;br /&gt;&lt;span style="color: red;"&gt;What is multi-threading? &lt;/span&gt;&lt;br /&gt;Multi-threading means various threads that run in a system. &lt;br /&gt;&lt;span style="color: red;"&gt;How does multi-threading take place on a computer with a single CPU? &lt;/span&gt;&lt;br /&gt;The operating system's task scheduler allocates execution time to multiple tasks. By quickly switching between executing tasks, it creates the impression that tasks execute sequentially. &lt;br /&gt;&lt;span style="color: red;"&gt;How to create a thread in a program?&lt;/span&gt; &lt;br /&gt;You have two ways to do so. First, making your class "extends" Thread class. Second, making your class "implements" Runnable interface. Put jobs in a run() method and call start() method to start the thread. &lt;br /&gt;&lt;span style="color: red;"&gt;Can Java object be locked down for exclusive use by a given thread? &lt;/span&gt;&lt;br /&gt;Yes. You can lock an object by putting it in a "synchronized" block. The locked object is inaccessible to any thread other than the one that explicitly claimed it. &lt;br /&gt;&lt;span style="color: red;"&gt;Can each Java object keep track of all the threads that want to exclusively access to it? &lt;/span&gt;&lt;br /&gt;Yes. Use Thread.currentThread() method to track the accessing thread. &lt;br /&gt;&lt;span style="color: red;"&gt;Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written? &lt;/span&gt;&lt;br /&gt;Yes, it does. The FileNoFoundException is inherited from the IOException. Exception's subclasses have to be caught first. &lt;br /&gt;What invokes a thread's run() method? &lt;br /&gt;After a thread is started, via its start() method of the Thread class, the JVM invokes the thread's run() method when the thread is initially executed&lt;br /&gt;&lt;span style="color: red;"&gt;What is the purpose of the wait(), notify(), and notifyAll() methods?&lt;/span&gt;&lt;br /&gt;The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to communicate each other. &lt;br /&gt;&lt;span style="color: red;"&gt;What are the high-level thread states? &lt;/span&gt;&lt;br /&gt;The high-level thread states are ready, running, waiting, and dead. &lt;br /&gt;&lt;span style="color: red;"&gt;What is the difference between yielding and sleeping? &lt;/span&gt;&lt;br /&gt;When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state. &lt;br /&gt;&lt;span style="color: red;"&gt;What happens when a thread cannot acquire a lock on an object? &lt;/span&gt;&lt;br /&gt;If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object's lock, it enters the waiting state until the lock becomes available. &lt;br /&gt;&lt;span style="color: red;"&gt;What is the difference between Process and Thread? &lt;/span&gt;&lt;br /&gt;A process can contain multiple threads. In most multithreading operating systems, a process gets its own memory address space; a thread doesn't. Threads typically share the heap belonging to their parent process. For instance, a JVM runs in a single process in the host O/S. Threads in the JVM share the heap belonging to that process; that's why several threads may access the same object. Typically, even though they share a common heap, threads have their own stack space. This is how one thread's invocation of a method is kept separate from another's. This is all a gross oversimplification, but it's accurate enough at a high level. Lots of details differ between operating systems. Process vs. Thread A program vs. similar to a sequential program an run on its own vs. Cannot run on its own Unit of allocation vs. Unit of execution Have its own memory space vs. Share with others Each process has one or more threads vs. Each thread belongs to one process Expensive, need to context switch vs. Cheap, can use process memory and may not need to context switch More secure. One process cannot corrupt another process vs. Less secure. A thread can write the memory used by another thread &lt;br /&gt;&lt;span style="color: red;"&gt;Can an inner class declared inside of a method access local variables of this method? &lt;/span&gt;&lt;br /&gt;It's possible if these variables are final. &lt;br /&gt;What can go wrong if you replace &amp;amp;emp;&amp;amp;emp; with &amp;amp;emp; in the following code: String a=null; if (a!=null &amp;amp;&amp;amp; a.length()&amp;gt;10) {...} &lt;br /&gt;A single ampersand here would lead to a NullPointerException.&lt;br /&gt;&lt;span style="color: red;"&gt;What is the Vector class? &lt;/span&gt;&lt;br /&gt;The Vector class provides the capability to implement a growable array of objects &lt;br /&gt;&lt;span style="color: red;"&gt;What modifiers may be used with an inner class that is a member of an outer class? &lt;/span&gt;&lt;br /&gt;A (non-local) inner class may be declared as public, protected, private, static, final, or abstract. &lt;br /&gt;&lt;span style="color: red;"&gt;If a method is declared as protected, where may the method be accessed? &lt;/span&gt;&lt;br /&gt;A protected method may only be accessed by classes or interfaces of the same package or by subclasses of the class in which it is declared. &lt;br /&gt;&lt;span style="color: red;"&gt;What is an Iterator interface? &lt;/span&gt;&lt;br /&gt;The Iterator interface is used to step through the elements of a Collection. &lt;br /&gt;&lt;span style="color: red;"&gt;How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters? &lt;/span&gt;&lt;br /&gt;Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns. &lt;br /&gt;&lt;span style="color: red;"&gt;What's the main difference between a Vector and an ArrayList? &lt;/span&gt;&lt;br /&gt;Java Vector class is internally synchronized and ArrayList is not. &lt;br /&gt;&lt;span style="color: red;"&gt;What are wrapped classes? &lt;/span&gt;&lt;br /&gt;Wrapped classes are classes that allow primitive types to be accessed as objects. &lt;br /&gt;&lt;span style="color: red;"&gt;Does garbage collection guarantee that a program will not run out of memory? &lt;/span&gt;&lt;br /&gt;No, it doesn't. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection. &lt;br /&gt;&lt;span style="color: red;"&gt;What is the difference between preemptive scheduling and time slicing? &lt;/span&gt;&lt;br /&gt;Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors.&lt;br /&gt;&lt;span style="color: red;"&gt;Name Component subclasses that support painting ?&lt;/span&gt;&lt;br /&gt;The Canvas, Frame, Panel, and Applet classes support painting. &lt;br /&gt;&lt;span style="color: red;"&gt;What is a native method? &lt;/span&gt;&lt;br /&gt;A native method is a method that is implemented in a language other than Java. &lt;br /&gt;&lt;span style="color: red;"&gt;How can you write a loop indefinitely? &lt;/span&gt;&lt;br /&gt;for(;;)--for loop; while(true)--always true, etc. &lt;br /&gt;Can an anonymous class be declared as implementing an interface and extending a class? &lt;br /&gt;An anonymous class may implement an interface or extend a superclass, but may not be declared to do both. &lt;br /&gt;&lt;span style="color: red;"&gt;What is the purpose of finalization? &lt;/span&gt;&lt;br /&gt;The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected. &lt;br /&gt;&lt;span style="color: red;"&gt;When should the method invokeLater()be used? &lt;/span&gt;&lt;br /&gt;This method is used to ensure that Swing components are updated through the event-dispatching thread. &lt;br /&gt;&lt;span style="color: red;"&gt;How many methods in Object class? &lt;/span&gt;&lt;br /&gt;This question is not asked to test your memory. It tests you how well you know Java. Ten in total.&lt;br /&gt;clone() &lt;br /&gt;equals() &amp;amp; hashcode() &lt;br /&gt;getClass() &lt;br /&gt;finalize() &lt;br /&gt;wait() &amp;amp; notify() &lt;br /&gt;toString() &lt;br /&gt;How does Java handle integer overflows and underflows? &lt;br /&gt;It uses low order bytes of the result that can fit into the size of the type allowed by the operation. &lt;br /&gt;&lt;span style="color: red;"&gt;What is the numeric promotion? &lt;/span&gt;&lt;br /&gt;Numeric promotion is used with both unary and binary bitwise operators. This means that byte, char, and short values are converted to int values before a bitwise operator is applied.&lt;br /&gt;If a binary bitwise operator has one long operand, the other operand is converted to a long value.&lt;br /&gt;The type of the result of a bitwise operation is the type to which the operands have been promoted. For example:&lt;br /&gt;short a = 5;&lt;br /&gt;byte b = 10;&lt;br /&gt;long c = 15;&lt;br /&gt;The type of the result of (a+b) is int, not short or byte. The type of the result of (a+c) or (b+c) is long. &lt;br /&gt;&lt;span style="color: red;"&gt;Is the numeric promotion available in other platform? &lt;/span&gt;&lt;br /&gt;Yes. Because Java is implemented using a platform-independent virtual machine, bitwise operations always yield the same result, even when run on machines that use radically different CPUs. &lt;br /&gt;&lt;span style="color: red;"&gt;What is the difference between the Boolean &amp;amp; operator and the &amp;amp;&amp;amp; operator? &lt;/span&gt;&lt;br /&gt;If an expression involving the Boolean &amp;amp; operator is evaluated, both operands are evaluated. Then the &amp;amp; operator is applied to the operand. When an expression involving the &amp;amp;&amp;amp; operator is evaluated, the first operand is evaluated. If the first operand returns a value of true then the second operand is evaluated. The &amp;amp;&amp;amp; operator is then applied to the first and second operands. If the first operand evaluates to false, the evaluation of the second operand is skipped. &lt;br /&gt;Operator &amp;amp; has no chance to skip both sides evaluation and &amp;amp;&amp;amp; operator does. If asked why, give details as above. &lt;br /&gt;&lt;span style="color: red;"&gt;When is the ArithmeticException throwQuestion: What is the GregorianCalendar class?&lt;/span&gt; &lt;br /&gt;The GregorianCalendar provides support for traditional Western calendars. &lt;br /&gt;&lt;span style="color: red;"&gt;What is the SimpleTimeZone class? &lt;/span&gt;&lt;br /&gt;The SimpleTimeZone class provides support for a Gregorian calendar. &lt;br /&gt;&lt;span style="color: red;"&gt;How can a subclass call a method or a constructor defined in a superclass? &lt;/span&gt;&lt;br /&gt;Use the following syntax: super.myMethod(); To call a constructor of the superclass, just write super(); in the first line of the subclass's constructor. &lt;br /&gt;&lt;span style="color: red;"&gt;What is the Properties class? &lt;/span&gt;&lt;br /&gt;The properties class is a subclass of Hashtable that can be read from or written to a stream. It also provides the capability to specify a set of default values to be used. &lt;br /&gt;&lt;span style="color: red;"&gt;What is the purpose of the Runtime class? &lt;/span&gt;&lt;br /&gt;The purpose of the Runtime class is to provide access to the Java runtime system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-4517235802727495648?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/4517235802727495648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/4517235802727495648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/4517235802727495648'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/java.html' title='java'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-219130504650795979</id><published>2010-08-16T23:51:00.001-07:00</published><updated>2010-08-16T23:51:56.163-07:00</updated><title type='text'>unix command</title><content type='html'>Sun Solaris Command Tips &lt;br /&gt;All commands are specific to Sun Solaris operating system &lt;br /&gt;UNIX backups/Restore &lt;br /&gt;Commands to take backup of /usr /var /lib directories to tape and disk using "tar" &lt;br /&gt;ANS: a) tar -cvf /dev/rmt/0 /usr /var /lib [Taking into tape ] &lt;br /&gt;b) tar -cvf backup_file.tar /usr /var /lib [ Taking disk image]&lt;br /&gt;Taking backup to a tape device attached to a remote system &lt;br /&gt;ANS: a) tar -cv /var /usr /lib | rsh remote_hostname dd of=/dev/rm/0 obs=128 &lt;br /&gt;b) ufsdump 0ucf remote_hostname:/dev/rmt/0 /file_system&lt;br /&gt;Extracting / Restore the contents of a tape /tar file &lt;br /&gt;ANS: a) tar -xvf /dev/rmt/0 [ restore contents of a tar tape ] &lt;br /&gt;b) tar -xvf filename.tar [ Restore contents of a tar file ] &lt;br /&gt;c) ufsrestore f /dev/rmt/0 filename [Restore from ufsdump tape backup] &lt;br /&gt;d) ufsrestore rf remote_hostname:/dev/rmt/0 filename [ Restore from remote host tape device ]&lt;br /&gt;List contents of backup &lt;br /&gt;ANS: a) tar -tvf /dev/rmt/0 [ List contents of a tar tape ] &lt;br /&gt;b) tar -tvf filename.tar [ List contents of a tar file ] &lt;br /&gt;c) ufsrestore tf /dev/rmt/0 [ list contents of a tape of ufsdump]&lt;br /&gt;Processes and Processor &lt;br /&gt;What are the types of priority classes supported by Solaris ? &lt;br /&gt;ANS: timesharing, system and reat-time &lt;br /&gt;How will you place a running process in real time class? &lt;br /&gt;ANS: priocntl -s –c RT –I uid process_id_number &lt;br /&gt;How will you start a process in real time class? &lt;br /&gt;ANS : priocntl –c RT –e process_name &lt;br /&gt;How will you bind a process to processor ? &lt;br /&gt;Ans: pbind –b processor_no process_id &lt;br /&gt;Network &lt;br /&gt;What is the pocket size used by SQL*NET Version 2 on Solaris &lt;br /&gt;Ans : Default is 2K &lt;br /&gt;What is the procket size used by network layer TCP/IP in SQL*NET v2? &lt;br /&gt;Ans : Default 1K &lt;br /&gt;Inter process communication (IPC) tuning &lt;br /&gt;What is post wait driver ? &lt;br /&gt;The post wait driver reduces the overhead incurred by the more expensive use of semaphore operation for interprocess communication. &lt;br /&gt;Memory &lt;br /&gt;What is the kernel parameter which controls the UNIX buffer cache on solaris ? &lt;br /&gt;Ans : bufhwm ( bufhwm is the maximum amount of physical memory, in kilobytes that can be used by &lt;br /&gt;I/O buffers)&lt;br /&gt;While starting an oracle process , the unix system displays an erro message like "Cannot allocate more shared memory segment for the processes" If oracle person approaches you, how will you fix this problem? &lt;br /&gt;ANS: increase the value for kernel memory parameter "set semsys:seminfo_semmns" in /etc/system file. [ this is a blind way] &lt;br /&gt;System configurations &lt;br /&gt;How do you find out total RAM installed on your machine &lt;br /&gt;Ans: $prtconf |grep size &lt;br /&gt;How do you find no. of processors installed on your sun box and processing speed? &lt;br /&gt;Ans: $psrinfo –v &lt;br /&gt;How do you find out how many disks are available on your system? &lt;br /&gt;Ans: $ format (for sysadmins) &lt;br /&gt;$ iostat –E (for users – count only the disks which has disk size correctly) &lt;br /&gt;System Boot Options &lt;br /&gt;How do you boot sun box in single user mode? &lt;br /&gt;ANS: At ok prompt type "boot -s" [ ok boot -s OR ok boot -1 OR ok boot -S ] &lt;br /&gt;What are the commands to shutdown the system? &lt;br /&gt;ANS: shutdown, init , halt, reboot &lt;br /&gt;Devices &lt;br /&gt;What is the meaning of logical name of a disk drive format like c0t0d0s0? &lt;br /&gt;ANS: c0 - Controller number &lt;br /&gt;t0 - SCSI bus target number &lt;br /&gt;d0 - Disk number &lt;br /&gt;s0 - Partition or slice number&lt;br /&gt;List some of the main device types? &lt;br /&gt;ANS: /dev/dsk - Disk devices &lt;br /&gt;/dev/rdsk - Raw or character devices &lt;br /&gt;/dev/rmt - Tape devices &lt;br /&gt;/dev/term - Serial line devices &lt;br /&gt;/dev/pts - Pseudo terminals&lt;br /&gt;List commands to display physical devices ? &lt;br /&gt;ANS: prtconf &lt;br /&gt;Sysdef &lt;br /&gt;Dmesg &lt;br /&gt;sysinfo&lt;br /&gt;   Have a Unix Problem &lt;br /&gt;Do you have a UNIX Question? &lt;br /&gt;Unix Books :- &lt;br /&gt;UNIX Programming, Certification, System Administration, Performance Tuning Reference Books &lt;br /&gt;   Return to : Unix System Administration Hints and Tips &lt;br /&gt;(c) www.sap-basis-abap.com All material on this site is Copyright. &lt;br /&gt;Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. &lt;br /&gt;All product names are trademarks of their respective companies. &lt;br /&gt;The site www.sap-basis-abap.com is in no way affiliated with or endorsed by any company listed at this site. &lt;br /&gt;Any unauthorised copying or mirroring is prohibited.&lt;br /&gt;________________________________________&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-219130504650795979?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/219130504650795979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/unix-command.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/219130504650795979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/219130504650795979'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/unix-command.html' title='unix command'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-8487936978132389524</id><published>2010-08-16T23:33:00.001-07:00</published><updated>2010-08-16T23:33:54.747-07:00</updated><title type='text'>linux commands</title><content type='html'>•  &lt;br /&gt;An A-Z Index of the Bash command line for Linux.&lt;br /&gt;  adduser  Add a user to the system&lt;br /&gt;  addgroup Add a group to the system&lt;br /&gt;  alias    Create an alias •&lt;br /&gt;  apropos  Search Help manual pages (man -k)&lt;br /&gt;  apt-get  Search for and install software packages (Debian/Ubuntu)&lt;br /&gt;  aptitude Search for and install software packages (Debian/Ubuntu)&lt;br /&gt;  aspell   Spell Checker&lt;br /&gt;  awk      Find and Replace text, database sort/validate/index&lt;br /&gt;b&lt;br /&gt;  basename Strip directory and suffix from filenames&lt;br /&gt;  bash     GNU Bourne-Again SHell &lt;br /&gt;  bc       Arbitrary precision calculator language &lt;br /&gt;  bg       Send to background&lt;br /&gt;  break    Exit from a loop •&lt;br /&gt;  builtin  Run a shell builtin&lt;br /&gt;  bzip2    Compress or decompress named file(s)&lt;br /&gt;c&lt;br /&gt;  cal      Display a calendar&lt;br /&gt;  case     Conditionally perform a command&lt;br /&gt;  cat      Display the contents of a file&lt;br /&gt;  cd       Change Directory&lt;br /&gt;  cfdisk   Partition table manipulator for Linux&lt;br /&gt;  chgrp    Change group ownership&lt;br /&gt;  chmod    Change access permissions&lt;br /&gt;  chown    Change file owner and group&lt;br /&gt;  chroot   Run a command with a different root directory&lt;br /&gt;  chkconfig System services (runlevel)&lt;br /&gt;  cksum    Print CRC checksum and byte counts&lt;br /&gt;  clear    Clear terminal screen&lt;br /&gt;  cmp      Compare two files&lt;br /&gt;  comm     Compare two sorted files line by line&lt;br /&gt;  command  Run a command - ignoring shell functions •&lt;br /&gt;  continue Resume the next iteration of a loop •&lt;br /&gt;  cp       Copy one or more files to another location&lt;br /&gt;  cron     Daemon to execute scheduled commands&lt;br /&gt;  crontab  Schedule a command to run at a later time&lt;br /&gt;  csplit   Split a file into context-determined pieces&lt;br /&gt;  cut      Divide a file into several parts&lt;br /&gt;d&lt;br /&gt;  date     Display or change the date &amp; time&lt;br /&gt;  dc       Desk Calculator&lt;br /&gt;  dd       Convert and copy a file, write disk headers, boot records&lt;br /&gt;  ddrescue Data recovery tool&lt;br /&gt;  declare  Declare variables and give them attributes •&lt;br /&gt;  df       Display free disk space&lt;br /&gt;  diff     Display the differences between two files&lt;br /&gt;  diff3    Show differences among three files&lt;br /&gt;  dig      DNS lookup&lt;br /&gt;  dir      Briefly list directory contents&lt;br /&gt;  dircolors Colour setup for `ls'&lt;br /&gt;  dirname  Convert a full pathname to just a path&lt;br /&gt;  dirs     Display list of remembered directories&lt;br /&gt;  dmesg    Print kernel &amp; driver messages &lt;br /&gt;  du       Estimate file space usage&lt;br /&gt;e&lt;br /&gt;  echo     Display message on screen •&lt;br /&gt;  egrep    Search file(s) for lines that match an extended expression&lt;br /&gt;  eject    Eject removable media&lt;br /&gt;  enable   Enable and disable builtin shell commands •&lt;br /&gt;  env      Environment variables&lt;br /&gt;  ethtool  Ethernet card settings&lt;br /&gt;  eval     Evaluate several commands/arguments&lt;br /&gt;  exec     Execute a command&lt;br /&gt;  exit     Exit the shell&lt;br /&gt;  expect   Automate arbitrary applications accessed over a terminal&lt;br /&gt;  expand   Convert tabs to spaces&lt;br /&gt;  export   Set an environment variable&lt;br /&gt;  expr     Evaluate expressions&lt;br /&gt;f&lt;br /&gt;  false    Do nothing, unsuccessfully&lt;br /&gt;  fdformat Low-level format a floppy disk&lt;br /&gt;  fdisk    Partition table manipulator for Linux&lt;br /&gt;  fg       Send job to foreground &lt;br /&gt;  fgrep    Search file(s) for lines that match a fixed string&lt;br /&gt;  file     Determine file type&lt;br /&gt;  find     Search for files that meet a desired criteria&lt;br /&gt;  fmt      Reformat paragraph text&lt;br /&gt;  fold     Wrap text to fit a specified width.&lt;br /&gt;  for      Expand words, and execute commands&lt;br /&gt;  format   Format disks or tapes&lt;br /&gt;  free     Display memory usage&lt;br /&gt;  fsck     File system consistency check and repair&lt;br /&gt;  ftp      File Transfer Protocol&lt;br /&gt;  function Define Function Macros&lt;br /&gt;  fuser    Identify/kill the process that is accessing a file&lt;br /&gt;g&lt;br /&gt;  gawk     Find and Replace text within file(s)&lt;br /&gt;  getopts  Parse positional parameters&lt;br /&gt;  grep     Search file(s) for lines that match a given pattern&lt;br /&gt;  groups   Print group names a user is in&lt;br /&gt;  gzip     Compress or decompress named file(s)&lt;br /&gt;h&lt;br /&gt;  hash     Remember the full pathname of a name argument&lt;br /&gt;  head     Output the first part of file(s)&lt;br /&gt;  help     Display help for a built-in command •&lt;br /&gt;  history  Command History&lt;br /&gt;  hostname Print or set system name&lt;br /&gt;i&lt;br /&gt;  id       Print user and group id's&lt;br /&gt;  if       Conditionally perform a command&lt;br /&gt;  ifconfig Configure a network interface&lt;br /&gt;  ifdown   Stop a network interface &lt;br /&gt;  ifup     Start a network interface up&lt;br /&gt;  import   Capture an X server screen and save the image to file&lt;br /&gt;  install  Copy files and set attributes&lt;br /&gt;j&lt;br /&gt;  jobs     List active jobs •&lt;br /&gt;  join     Join lines on a common field&lt;br /&gt;k&lt;br /&gt;  kill     Stop a process from running&lt;br /&gt;  killall  Kill processes by name&lt;br /&gt;l&lt;br /&gt;  less     Display output one screen at a time&lt;br /&gt;  let      Perform arithmetic on shell variables •&lt;br /&gt;  ln       Make links between files&lt;br /&gt;  local    Create variables •&lt;br /&gt;  locate   Find files&lt;br /&gt;  logname  Print current login name&lt;br /&gt;  logout   Exit a login shell •&lt;br /&gt;  look     Display lines beginning with a given string&lt;br /&gt;  lpc      Line printer control program&lt;br /&gt;  lpr      Off line print&lt;br /&gt;  lprint   Print a file&lt;br /&gt;  lprintd  Abort a print job&lt;br /&gt;  lprintq  List the print queue&lt;br /&gt;  lprm     Remove jobs from the print queue&lt;br /&gt;  ls       List information about file(s)&lt;br /&gt;  lsof     List open files&lt;br /&gt;m&lt;br /&gt;  make     Recompile a group of programs&lt;br /&gt;  man      Help manual&lt;br /&gt;  mkdir    Create new folder(s)&lt;br /&gt;  mkfifo   Make FIFOs (named pipes)&lt;br /&gt;  mkisofs  Create an hybrid ISO9660/JOLIET/HFS filesystem&lt;br /&gt;  mknod    Make block or character special files&lt;br /&gt;  more     Display output one screen at a time&lt;br /&gt;  mount    Mount a file system&lt;br /&gt;  mtools   Manipulate MS-DOS files&lt;br /&gt;  mtr      Network diagnostics (traceroute/ping)&lt;br /&gt;  mv       Move or rename files or directories&lt;br /&gt;  mmv      Mass Move and rename (files)&lt;br /&gt;n&lt;br /&gt;  netstat  Networking information&lt;br /&gt;  nice     Set the priority of a command or job&lt;br /&gt;  nl       Number lines and write files&lt;br /&gt;  nohup    Run a command immune to hangups&lt;br /&gt;  notify-send  Send desktop notifications&lt;br /&gt;  nslookup Query Internet name servers interactively&lt;br /&gt;o&lt;br /&gt;  open     Open a file in its default application&lt;br /&gt;  op       Operator access &lt;br /&gt;p&lt;br /&gt;  passwd   Modify a user password&lt;br /&gt;  paste    Merge lines of files&lt;br /&gt;  pathchk  Check file name portability&lt;br /&gt;  ping     Test a network connection&lt;br /&gt;  pkill    Stop processes from running&lt;br /&gt;  popd     Restore the previous value of the current directory&lt;br /&gt;  pr       Prepare files for printing&lt;br /&gt;  printcap Printer capability database&lt;br /&gt;  printenv Print environment variables&lt;br /&gt;  printf   Format and print data •&lt;br /&gt;  ps       Process status&lt;br /&gt;  pushd    Save and then change the current directory&lt;br /&gt;  pwd      Print Working Directory&lt;br /&gt;q&lt;br /&gt;  quota    Display disk usage and limits&lt;br /&gt;  quotacheck Scan a file system for disk usage&lt;br /&gt;  quotactl Set disk quotas&lt;br /&gt;r&lt;br /&gt;  ram      ram disk device&lt;br /&gt;  rcp      Copy files between two machines&lt;br /&gt;  read     Read a line from standard input •&lt;br /&gt;  readarray Read from stdin into an array variable •&lt;br /&gt;  readonly Mark variables/functions as readonly&lt;br /&gt;  reboot   Reboot the system&lt;br /&gt;  rename   Rename files&lt;br /&gt;  renice   Alter priority of running processes &lt;br /&gt;  remsync  Synchronize remote files via email&lt;br /&gt;  return   Exit a shell function&lt;br /&gt;  rev      Reverse lines of a file&lt;br /&gt;  rm       Remove files&lt;br /&gt;  rmdir    Remove folder(s)&lt;br /&gt;  rsync    Remote file copy (Synchronize file trees)&lt;br /&gt;s&lt;br /&gt;  screen   Multiplex terminal, run remote shells via ssh&lt;br /&gt;  scp      Secure copy (remote file copy)&lt;br /&gt;  sdiff    Merge two files interactively&lt;br /&gt;  sed      Stream Editor&lt;br /&gt;  select   Accept keyboard input&lt;br /&gt;  seq      Print numeric sequences&lt;br /&gt;  set      Manipulate shell variables and functions&lt;br /&gt;  sftp     Secure File Transfer Program&lt;br /&gt;  shift    Shift positional parameters&lt;br /&gt;  shopt    Shell Options&lt;br /&gt;  shutdown Shutdown or restart linux&lt;br /&gt;  sleep    Delay for a specified time&lt;br /&gt;  slocate  Find files&lt;br /&gt;  sort     Sort text files&lt;br /&gt;  source   Run commands from a file `.'&lt;br /&gt;  split    Split a file into fixed-size pieces&lt;br /&gt;  ssh      Secure Shell client (remote login program)&lt;br /&gt;  strace   Trace system calls and signals&lt;br /&gt;  su       Substitute user identity&lt;br /&gt;  sudo     Execute a command as another user&lt;br /&gt;  sum      Print a checksum for a file&lt;br /&gt;  suspend  Suspend execution of this shell •&lt;br /&gt;  symlink  Make a new name for a file&lt;br /&gt;  sync     Synchronize data on disk with memory&lt;br /&gt;t&lt;br /&gt;  tail     Output the last part of files&lt;br /&gt;  tar      Tape ARchiver&lt;br /&gt;  tee      Redirect output to multiple files&lt;br /&gt;  test     Evaluate a conditional expression&lt;br /&gt;  time     Measure Program running time&lt;br /&gt;  times    User and system times&lt;br /&gt;  touch    Change file timestamps&lt;br /&gt;  top      List processes running on the system&lt;br /&gt;  traceroute Trace Route to Host&lt;br /&gt;  trap     Run a command when a signal is set(bourne)&lt;br /&gt;  tr       Translate, squeeze, and/or delete characters&lt;br /&gt;  true     Do nothing, successfully&lt;br /&gt;  tsort    Topological sort&lt;br /&gt;  tty      Print filename of terminal on stdin&lt;br /&gt;  type     Describe a command •&lt;br /&gt;u&lt;br /&gt;  ulimit   Limit user resources •&lt;br /&gt;  umask    Users file creation mask&lt;br /&gt;  umount   Unmount a device&lt;br /&gt;  unalias  Remove an alias •&lt;br /&gt;  uname    Print system information&lt;br /&gt;  unexpand Convert spaces to tabs&lt;br /&gt;  uniq     Uniquify files&lt;br /&gt;  units    Convert units from one scale to another&lt;br /&gt;  unset    Remove variable or function names&lt;br /&gt;  unshar   Unpack shell archive scripts&lt;br /&gt;  until    Execute commands (until error)&lt;br /&gt;  useradd  Create new user account&lt;br /&gt;  usermod  Modify user account&lt;br /&gt;  users    List users currently logged in&lt;br /&gt;  uuencode Encode a binary file &lt;br /&gt;  uudecode Decode a file created by uuencode&lt;br /&gt;v&lt;br /&gt;  v        Verbosely list directory contents (`ls -l -b')&lt;br /&gt;  vdir     Verbosely list directory contents (`ls -l -b')&lt;br /&gt;  vi       Text Editor&lt;br /&gt;  vmstat   Report virtual memory statistics&lt;br /&gt;w&lt;br /&gt;  watch    Execute/display a program periodically&lt;br /&gt;  wc       Print byte, word, and line counts&lt;br /&gt;  whereis  Search the user's $path, man pages and source files for a program&lt;br /&gt;  which    Search the user's $path for a program file&lt;br /&gt;  while    Execute commands&lt;br /&gt;  who      Print all usernames currently logged in&lt;br /&gt;  whoami   Print the current user id and name (`id -un')&lt;br /&gt;  Wget     Retrieve web pages or files via HTTP, HTTPS or FTP&lt;br /&gt;  write    Send a message to another user &lt;br /&gt;x&lt;br /&gt;  xargs    Execute utility, passing constructed argument list(s)&lt;br /&gt;  xdg-open Open a file or URL in the user's preferred application.&lt;br /&gt;  yes      Print a string until interrupted&lt;br /&gt;  .        Run a command script in the current shell&lt;br /&gt;  ###      Comment / Remark&lt;br /&gt;Commands marked • are bash built-ins, these are available under all shells.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-8487936978132389524?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/8487936978132389524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/linux-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/8487936978132389524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/8487936978132389524'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/linux-commands.html' title='linux commands'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-3523352093559879923</id><published>2010-08-16T23:23:00.000-07:00</published><updated>2010-08-16T23:23:46.475-07:00</updated><title type='text'>apptitude quesitions</title><content type='html'>1. NUMBERS&lt;br /&gt; &lt;br /&gt;IMPORTANT FACTS AND FORMULAE&lt;br /&gt;I..Numeral : In Hindu Arabic system, we use ten symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 called digits to represent any number.&lt;br /&gt; A group of digits, denoting a number is called a numeral.&lt;br /&gt; We represent a number, say 689745132 as shown below :&lt;br /&gt;&lt;br /&gt;Ten Crores (108)  Crores(107) Ten Lacs (Millions) (106) Lacs(105) Ten Thousands (104) Thousands (103) Hundreds (102) Tens(101) Units(100)&lt;br /&gt;6 8 9 7 4 5 1 3 2&lt;br /&gt;We read it as : 'Sixty-eight crores, ninety-seven lacs, forty-five thousand, one hundred and thirty-two'. &lt;br /&gt;II  Place Value or Local Value of a Digit in a Numeral :&lt;br /&gt;In the above numeral :&lt;br /&gt;Place value of 2 is (2 x 1) = 2; Place value of 3 is (3 x 10) = 30;&lt;br /&gt;Place value of 1 is (1 x 100) = 100 and so on.&lt;br /&gt;Place value of 6 is 6 x 108 = 600000000 &lt;br /&gt;III.Face Value : The face value of a digit in a numeral is the value of the   digit itself at whatever place it may be. In the above numeral, the face value of 2 is 2; the face value of 3 is 3 and so on.&lt;br /&gt;IV.TYPES OF NUMBERS&lt;br /&gt;1.Natural Numbers : Counting numbers 1, 2, 3, 4, 5,..... are called natural&lt;br /&gt;numbers.&lt;br /&gt;2.Whole Numbers : All counting numbers together with zero form the set of whole&lt;br /&gt;numbers. Thus,&lt;br /&gt;        (i) 0 is the only whole number which is not a natural number. &lt;br /&gt;        (ii) Every natural number is a whole number.&lt;br /&gt;3.Integers : All natural numbers, 0 and negatives of counting numbers i.e.,&lt;br /&gt;{…, -3,-2,-1, 0, 1, 2, 3,…..} together form the set of integers.&lt;br /&gt;(i) Positive Integers : {1, 2, 3, 4, …..} is the set of all positive integers.&lt;br /&gt;(ii) Negative Integers : {- 1, - 2, - 3,…..} is the set of all negative integers.&lt;br /&gt;(iii) Non-Positive and Non-Negative Integers : 0 is neither positive nor&lt;br /&gt;negative. So, {0, 1, 2, 3,….} represents the set of non-negative integers, while&lt;br /&gt;{0, -1,-2,-3,…..} represents the set of non-positive integers.&lt;br /&gt;4.  Even Numbers : A number divisible by 2 is called an even number, e.g., 2, 4, 6, 8, 10, etc.&lt;br /&gt;5.  Odd Numbers : A number not divisible by 2 is called an odd number. e.g., 1, 3, 5, 7, 9, 11, etc.&lt;br /&gt;6.  Prime Numbers : A number greater than 1 is called a prime number, if it has exactly two factors, namely 1 and the number itself.&lt;br /&gt;Prime numbers upto 100 are : 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43,&lt;br /&gt;47,  53, 59, 61, 67, 71, 73, 79, 83, 89, 97.&lt;br /&gt;Prime numbers Greater than 100 : Letp be a given number greater than 100. To find out whether it is prime or not, we use the following method :&lt;br /&gt;Find a whole number nearly greater than the square root of p. Let k &gt; *jp. Test whether p is divisible by any prime number less than k. If yes, then p is not prime. Otherwise, p is prime.&lt;br /&gt;e.g,,We have to find whether 191 is a prime number or not. Now, 14 &gt; V191.&lt;br /&gt;Prime numbers less than 14 are 2, 3, 5, 7, 11, 13.&lt;br /&gt;191 is not divisible by any of them. So, 191 is a prime number.&lt;br /&gt;7.Composite Numbers : Numbers greater than 1 which are not prime, are known as composite numbers, e.g., 4, 6, 8, 9, 10, 12.&lt;br /&gt;Note :    (i) 1 is neither prime nor composite.&lt;br /&gt;(ii) 2 is the only even number which is prime. &lt;br /&gt;(iii) There are 25 prime numbers between 1 and 100.&lt;br /&gt;8.  Co-primes : Two numbers a and b are said to be co-primes, if their H.C.F. is 1. e.g., (2, 3), (4, 5), (7, 9), (8, 11), etc. are co-primes,&lt;br /&gt;V.TESTS OF DIVISIBILITY&lt;br /&gt;1.  Divisibility By 2 : A number is divisible by 2, if its unit's digit is any of 0, 2, 4, 6, 8.&lt;br /&gt;Ex. 84932 is divisible by 2, while 65935 is not.&lt;br /&gt;2.  Divisibility By 3 : A number is divisible by 3, if the sum of its digits is divisible by 3.&lt;br /&gt;Ex.592482 is divisible by 3, since sum of its digits = (5 + 9 + 2 + 4 + 8 + 2) = 30, which is divisible by 3.&lt;br /&gt;But, 864329 is not divisible by 3, since sum of its digits =(8 + 6 + 4 + 3 + 2 + 9) = 32, which is not divisible by 3.&lt;br /&gt;3.  Divisibility By 4 : A number is divisible by 4, if the number formed by the last two digits is divisible by 4.&lt;br /&gt;Ex. 892648 is divisible by 4, since the number formed by the last two digits is&lt;br /&gt;48,  which is divisible by 4.&lt;br /&gt;But, 749282 is not divisible by 4, since the number formed by the last tv/o digits is 82, which is not divisible by 4.&lt;br /&gt;4.  Divisibility By 5 : A number is divisible by 5, if its unit's digit is either 0 or 5. Thus, 20820 and 50345 are divisible by 5, while 30934 and 40946 are not.&lt;br /&gt;5.  Divisibility By 6 : A number is divisible by 6, if it is divisible by both 2 and 3. Ex. The number 35256 is clearly divisible by 2.&lt;br /&gt;Sum of its digits = (3 + 5 + 2 + 5 + 6) = 21, which is divisible by 3. Thus, 35256 is divisible by 2 as well as 3. Hence, 35256 is divisible by 6.&lt;br /&gt;6.   Divisibility By 8 : A number is divisible by 8, if the number formed by the last&lt;br /&gt;three digits of the given number is divisible by 8.&lt;br /&gt;Ex. 953360 is divisible by 8, since the number formed by last three digits is 360, which is divisible by 8.&lt;br /&gt;But, 529418 is not divisible by 8, since the number formed by last three digits is 418, which is not divisible by 8.&lt;br /&gt;7.   Divisibility By 9 : A number is divisible by 9, if the sum of its digits is divisible&lt;br /&gt;by 9.&lt;br /&gt;Ex. 60732 is divisible by 9, since sum of digits * (6 + 0 + 7 + 3 + 2) = 18, which is divisible by 9.&lt;br /&gt;But, 68956 is not divisible by 9, since sum of digits = (6 + 8 + 9 + 5 + 6) = 34, which is not divisible by 9.&lt;br /&gt;8.   Divisibility By 10 : A number is divisible by 10, if it ends with 0.&lt;br /&gt;Ex. 96410, 10480 are divisible by 10, while 96375 is not.&lt;br /&gt;9.   Divisibility By 11 : A number is divisible by 11, if the difference of the sum of its digits at odd places and the sum of its digits at even places, is either 0 or a number divisible by 11.&lt;br /&gt;Ex. The number 4832718 is divisible by 11, since :&lt;br /&gt;(sum of digits at odd places) - (sum of digits at even places)&lt;br /&gt;- (8 + 7 + 3 + 4) - (1 + 2 + 8) = 11, which is divisible by 11.&lt;br /&gt;10.  Divisibility By 12 ; A number is divisible by 12, if it is divisible by both 4 and&lt;br /&gt;3.&lt;br /&gt;Ex. Consider the number 34632.&lt;br /&gt;(i) The number formed by last two digits is 32, which is divisible by 4, &lt;br /&gt;(ii) Sum of digits = (3 + 4 + 6 + 3 + 2) = 18, which is divisible by 3. Thus, 34632 is divisible by 4 as well as 3. Hence, 34632 is divisible by 12.&lt;br /&gt;11.   Divisibility By 14 : A number is divisible by 14, if it is divisible by 2 as well as 7.&lt;br /&gt;12.  Divisibility By 15 : A number is divisible by 15, if it is divisible by both 3 and 5.&lt;br /&gt;13.  Divisibility By 16 : A number is divisible by 16, if the number formed by the last4  digits is divisible by 16.&lt;br /&gt;Ex.7957536 is divisible by 16, since the number formed by the last four digits is 7536, which is divisible by 16.&lt;br /&gt;14.  Divisibility By 24 : A given number is divisible by 24, if it is divisible by both3  and 8.&lt;br /&gt;15.  Divisibility By 40 : A given number is divisible by 40, if it is divisible by both&lt;br /&gt;5  and 8.&lt;br /&gt;16.  Divisibility By 80 : A given number is divisible by 80, if it is divisible by both 5 and 16.&lt;br /&gt;Note : If a number is divisible by p as well as q, where p and q are co-primes, then the given number is divisible by pq.&lt;br /&gt;If p arid q are not co-primes, then the given number need not be divisible by pq,&lt;br /&gt;even when it is divisible by both p and q.&lt;br /&gt;Ex. 36 is divisible by both 4 and 6, but it is not divisible by (4x6) = 24, since&lt;br /&gt;4  and 6 are not co-primes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;VI   MULTIPLICATION BY SHORT CUT METHODS&lt;br /&gt;1.  Multiplication By Distributive Law :&lt;br /&gt;(i) a x (b + c) = a x b + a x c    (ii) ax(b-c) = a x b-a x c.&lt;br /&gt;Ex.   (i) 567958 x 99999 = 567958 x (100000 - 1)&lt;br /&gt;= 567958 x 100000 - 567958 x 1 = (56795800000 - 567958) = 56795232042. (ii) 978 x 184 + 978 x 816 = 978 x (184 + 816) = 978 x 1000 = 978000.&lt;br /&gt;2.  Multiplication of a Number By 5n :  Put n zeros to the right of the multiplicand and divide the number so formed by 2n&lt;br /&gt;Ex. 975436 x 625 = 975436 x 54= 9754360000 =   609647600&lt;br /&gt;                                                            16 &lt;br /&gt;VII.   BASIC FORMULAE&lt;br /&gt;1. (a + b)2 = a2 + b2 + 2ab                      2. (a - b)2 = a2 + b2 - 2ab&lt;br /&gt;3. (a + b)2 - (a - b)2 = 4ab                       4. (a + b)2 + (a - b)2 = 2 (a2 + b2)&lt;br /&gt;5.  (a2 - b2) = (a + b) (a - b)&lt;br /&gt;6.  (a + b + c)2 = a2 + b2 + c2 + 2 (ab + bc + ca)&lt;br /&gt;7.  (a3 + b3) = (a +b) (a2 - ab + b2)        8. (a3 - b3) = (a - b) (a2 + ab + b2) &lt;br /&gt;9. (a3 + b3 + c3 -3abc) = (a + b + c) (a2 + b2 + c2 - ab - bc - ca)&lt;br /&gt;10. If a + b + c = 0, then a3 + b3 + c3 = 3abc. &lt;br /&gt;&lt;br /&gt;VIII.  DIVISION ALGORITHM OR EUCLIDEAN ALGORITHM &lt;br /&gt;If we divide a given number by another number, then :&lt;br /&gt;Dividend = (Divisor x Quotient) + Remainder&lt;br /&gt;IX.     {i) (xn - an ) is divisible by (x - a) for all values of n.&lt;br /&gt;           (ii) (xn - an) is divisible by (x + a) for all even values of n. &lt;br /&gt;           (iii) (xn + an) is divisible by (x + a) for all odd values of n.&lt;br /&gt;&lt;br /&gt;X. PROGRESSION&lt;br /&gt;A succession of numbers formed and arranged in a definite order according to certain definite rule, is called a progression.&lt;br /&gt;1. Arithmetic Progression (A.P.) : If each term of a progression differs from its preceding term by a constant, then such a progression is called an arithmetical progression. This constant difference is called the common difference of the A.P.&lt;br /&gt;An A.P. with first term a and common difference d is given by a, (a + d), (a + 2d),(a + 3d),.....&lt;br /&gt;The nth term of this A.P. is given by Tn =a (n - 1) d.&lt;br /&gt;The sum of n terms of this A.P.&lt;br /&gt;Sn = n/2 [2a + (n - 1) d] = n/2   (first term + last term).&lt;br /&gt;&lt;br /&gt;SOME IMPORTANT RESULTS :&lt;br /&gt;&lt;br /&gt; (i) (1 + 2 + 3 +…. + n) =n(n+1)/2&lt;br /&gt;(ii) (l2 + 22 + 32 + ... + n2) = n (n+1)(2n+1)/6&lt;br /&gt;(iii)  (13 + 23 + 33 + ... + n3) =n2(n+1)2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2.   Geometrical Progression (G.P.) : A progression of numbers in which every term bears a constant ratio with its preceding term, is called a geometrical progression.&lt;br /&gt;The constant ratio is called the common ratio of the G.P. A G.P. with first term a and common ratio r is :&lt;br /&gt;a, ar, ar2,&lt;br /&gt;In this G.P. Tn = arn-1&lt;br /&gt;sum of the n terms, Sn=   a(1-rn)&lt;br /&gt;                                          (1-r)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SOLVED EXAMPLES&lt;br /&gt;&lt;br /&gt;Ex. 1. Simplify :   (i) 8888 + 888 + 88 + 8   &lt;br /&gt;                              (ii) 11992 - 7823 - 456  &lt;br /&gt;Sol.   i )  8888                       ii) 11992 - 7823 - 456 = 11992 - (7823 + 456)&lt;br /&gt;                888                                                            = 11992 - 8279 = 3713-&lt;br /&gt;                  88                                  7823                         11992&lt;br /&gt;         +         8                               +   456                      -   8279&lt;br /&gt;               9872                                  8279                          3713&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 2, What value will replace the question mark in each of the following equations ?&lt;br /&gt;(i) ? - 1936248 = 1635773            (ii) 8597 - ? = 7429 - 4358&lt;br /&gt;&lt;br /&gt;Sol.  (i) Let x  - 1936248=1635773.Then, x = 1635773 + 1936248=3572021.                 (ii) Let 8597 - x = 7429 - 4358.&lt;br /&gt;Then, x = (8597 + 4358) - 7429 = 12955 - 7429 = 5526.&lt;br /&gt;&lt;br /&gt; Ex. 3. What could be the maximum value of Q in the following equation?          5P9 + 3R7 + 2Q8 = 1114                     &lt;br /&gt;Sol. We may analyse the given equation as shown :                     1   2      &lt;br /&gt;Clearly, 2 + P + R + Q = ll.                                                           5   P  9 &lt;br /&gt;So, the maximum value of Q can be                                                3   R  7&lt;br /&gt;(11 - 2) i.e., 9 (when P = 0, R = 0);                                               2   Q  8&lt;br /&gt;                                                                                                      11  1   4 &lt;br /&gt;&lt;br /&gt;Ex. 4. Simplify : (i) 5793405 x 9999  (ii) 839478 x 625&lt;br /&gt;Sol. &lt;br /&gt;i)5793405x9999=5793405(10000-1)=57934050000-5793405=57928256595.b&lt;br /&gt;&lt;br /&gt;ii) 839478 x 625 = 839478 x 54 = 8394780000 = 524673750.&lt;br /&gt;                                                            16&lt;br /&gt;&lt;br /&gt;Ex. 5. Evaluate : (i) 986 x 237 + 986 x 863    (ii) 983 x 207 - 983 x 107 &lt;br /&gt;Sol.&lt;br /&gt;(i) 986 x 137 + 986 x 863 = 986 x (137 + 863) = 986 x 1000 = 986000.&lt;br /&gt;(ii) 983 x 207 - 983 x 107 = 983 x (207 - 107) = 983 x 100 = 98300. &lt;br /&gt;&lt;br /&gt;Ex. 6. Simplify : (i) 1605 x 1605    ii) 1398 x 1398 &lt;br /&gt;Sol.&lt;br /&gt;i) 1605 x 1605 = (1605)2 = (1600 + 5)2 = (1600)2 + (5)2 + 2 x 1600 x 5&lt;br /&gt;                                                               = 2560000 + 25 + 16000 = 2576025.&lt;br /&gt;(ii) 1398 x 1398 - (1398)2 = (1400 - 2)2= (1400)2 + (2)2 - 2 x 1400 x 2&lt;br /&gt;                                                         =1960000 + 4 - 5600 = 1954404. &lt;br /&gt;&lt;br /&gt;Ex. 7. Evaluate : (313 x 313 + 287 x 287).&lt;br /&gt;Sol.&lt;br /&gt; (a2 + b2) = 1/2 [(a + b)2 + (a- b)2]&lt;br /&gt;(313)2 + (287)2 = 1/2 [(313 + 287)2 + (313 - 287)2] = ½[(600)2 + (26)2]&lt;br /&gt;= 1/2 (360000 + 676) = 180338. &lt;br /&gt;&lt;br /&gt;Ex. 8. Which of the following are prime numbers ?&lt;br /&gt;(i) 241           (ii) 337         (Hi) 391           (iv) 571&lt;br /&gt;Sol.                             &lt;br /&gt;(i) Clearly, 16 &gt; Ö241. Prime numbers less than 16 are 2, 3, 5, 7, 11, 13.&lt;br /&gt;             241 is not divisible by any one of them. &lt;br /&gt;         241 is a prime number.&lt;br /&gt;          &lt;br /&gt;(ii) Clearly, 19&gt;Ö337. Prime numbers less than 19 are 2, 3, 5, 7, 11,13,17.           &lt;br /&gt;             337 is not divisible by any one of them.&lt;br /&gt;          337 is a prime number.&lt;br /&gt;(iii) Clearly, 20 &gt; Ö39l". Prime numbers less than 20 are 2, 3, 5, 7, 11, 13, 17, 19. &lt;br /&gt;           We find that 391 is divisible by 17. &lt;br /&gt;          391 is not prime.&lt;br /&gt;(iv) Clearly, 24 &gt; Ö57T. Prime numbers less than 24 are 2, 3, 5, 7, 11, 13, 17, 19, 23. &lt;br /&gt;            571 is not divisible by any one of them. &lt;br /&gt;         571 is a prime number.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; Ex. 9. Find the unit's digit in the product (2467)163 x (341)72. &lt;br /&gt;Sol. Clearly, unit's digit in the given product = unit's digit in 7153 x 172.                                  &lt;br /&gt;       Now, 74 gives unit digit 1.&lt;br /&gt;       7152  gives unit digit 1,&lt;br /&gt;   7153  gives unit digit (l x 7) = 7. Also, 172 gives unit digit 1. &lt;br /&gt;       Hence, unit's digit in the product = (7 x 1) = 7.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 10. Find the unit's digit in (264)102 + (264)103&lt;br /&gt;Sol. Required unit's digit = unit's digit in (4)102 + (4)103.&lt;br /&gt;       Now, 42  gives unit digit 6.&lt;br /&gt;   (4)102 gives unjt digit 6.&lt;br /&gt;   (4)103 gives unit digit of the product (6 x 4) i.e., 4. &lt;br /&gt;       Hence, unit's digit in (264)m + (264)103 = unit's digit in (6 + 4) = 0.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; Ex. 11. Find the total number of prime factors in the expression (4)11 x (7)5 x (11)2.&lt;br /&gt;Sol. (4)11x (7)5 x (11)2 = (2 x 2)11 x (7)5 x (11)2 = 211 x 211 x75x 112 = 222 x 75 x112&lt;br /&gt;       Total number of prime factors = (22 + 5 + 2) = 29. &lt;br /&gt;&lt;br /&gt;Ex.12. Simplify :    (i) 896 x 896 - 204 x 204&lt;br /&gt;                                (ii) 387 x 387 + 114 x 114 + 2 x 387 x 114 &lt;br /&gt;                                (iii) 81 X 81 + 68 X 68-2 x 81 X 68.&lt;br /&gt;Sol.&lt;br /&gt;(i)  Given exp  =  (896)2 - (204)2 = (896 + 204) (896 - 204) = 1100 x 692 = 761200. &lt;br /&gt;(ii) Given exp  = (387)2+ (114)2+ (2 x 387x 114)&lt;br /&gt;                        = a2 + b2 + 2ab,  where a = 387,b=114&lt;br /&gt;                       = (a+b)2 = (387 + 114 )2 = (501)2 = 251001.&lt;br /&gt;(iii) Given exp = (81)2 + (68)2 – 2x 81 x 68 = a2 + b2 – 2ab,Where a =81,b=68 &lt;br /&gt;                        =  (a-b)2 = (81 –68)2 = (13)2 = 169.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex.13. Which of the following numbers is divisible by 3 ? &lt;br /&gt;(i) 541326                                 (ii) 5967013&lt;br /&gt;Sol.&lt;br /&gt;(i) Sum of digits in 541326 = (5 + 4 + 1 + 3 + 2 + 6) = 21, which is divisible by 3.&lt;br /&gt;Hence, 541326 is divisible by 3.&lt;br /&gt;&lt;br /&gt;(ii) Sum of digits in 5967013 =(5+9 + 6 + 7 + 0+1 +3) = 31, which is not divisible by 3.&lt;br /&gt;Hence, 5967013 is not divisible by 3.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex.14.What least value must be assigned to * so that the number 197*5462 is r 9 ?&lt;br /&gt;Sol.&lt;br /&gt;Let the missing digit be x.&lt;br /&gt;Sum of digits = (1 + 9 + 7 + x + 5 + 4 + 6 +»2) = (34 + x). &lt;br /&gt;For (34 + x) to be divisible by 9, x must be replaced by 2 . &lt;br /&gt;Hence, the digit in place of * must be 2.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 15. Which of the following numbers is divisible by 4 ? &lt;br /&gt;(i) 67920594                    (ii) 618703572&lt;br /&gt;Sol.      &lt;br /&gt;(i) The number formed by the last two digits in the given number is 94, which is not divisible by 4.&lt;br /&gt;Hence, 67920594 is not divisible by 4.&lt;br /&gt;&lt;br /&gt;(ii) The number formed by the last two digits in the given number is 72, which is divisible by 4.&lt;br /&gt;Hence, 618703572 is divisible by 4.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 16. Which digits should come in place of * and $ if the number 62684*$ is divisible by both 8 and 5 ?&lt;br /&gt;Sol.     &lt;br /&gt;Since the given number is divisible by 5, so 0 or 5 must come in place of $. But, a number ending with 5 is never divisible by 8. So, 0 will replace $. &lt;br /&gt;Now, the number formed by the last three digits is 4*0, which becomes divisible by 8, if * is replaced by 4.&lt;br /&gt;Hence, digits in place of * and $ are 4 and 0 respectively. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 17. Show that 4832718 is divisible by 11. &lt;br /&gt;Sol.    (Sum of digits at odd places) - (Sum of digits at even places)&lt;br /&gt;                                          = (8 + 7 + 3 + 4) - (1 + 2 + 8) = 11, which is divisible by 11.&lt;br /&gt;            Hence, 4832718 is divisible by 11. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 18. Is 52563744 divisible by 24 ? &lt;br /&gt;Sol.  24 = 3 x 8, where 3 and 8 are co-primes.            &lt;br /&gt;        The sum of the digits in the given number is 36, which is divisible by 3. So, the                       given number is divisible by 3.&lt;br /&gt;         The number formed by the last 3 digits of the given number is 744, which is  divisible by 8. So, the given number is divisible by 8.&lt;br /&gt;         Thus, the given number is divisible by both 3 and 8, where 3 and 8 are co-primes.&lt;br /&gt;So, it is divisible by 3 x 8, i.e., 24.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 19. What least number must be added to 3000 to obtain a number exactly divisible by 19 ?&lt;br /&gt;Sol. On dividing 3000 by 19, we get 17 as remainder. &lt;br /&gt;    Number to be added = (19 - 17) = 2.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 20. What least number must be subtracted from 2000 to get a number exactly divisible by 17 ?&lt;br /&gt;Sol. On dividing 2000 by 17, we get 11 as remainder.&lt;br /&gt;     Required number to be subtracted = 11.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 21. Find the number which is nearest to 3105 and is exactly divisible by 21. &lt;br /&gt;Sol. On dividing 3105 by 21, we get 18 as remainder.&lt;br /&gt;     Number to be added to 3105 = (21 - 18) - 3.&lt;br /&gt;        Hence, required number = 3105 + 3 = 3108.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 22. Find the smallest number of 6 digits which is exactly divisible by 111. &lt;br /&gt;Sol. Smallest number of 6 digits is 100000.&lt;br /&gt;       On dividing 100000 by 111, we get 100 as remainder.&lt;br /&gt;    Number to be added = (111 - 100) - 11.&lt;br /&gt;        Hence, required number = 100011.-&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 23. On dividing 15968 by a certain number, the quotient is 89 and the remainder is 37. Find the divisor.&lt;br /&gt;                            Dividend - Remainder      15968-37      &lt;br /&gt;Sol.     Divisor = -------------------------- = ------------- = 179.&lt;br /&gt;                                       .Quotient                    89&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 24. A number when divided by 342 gives a remainder 47. When the same number ift divided by 19, what would be the remainder ?&lt;br /&gt;Sol.   On dividing the given number by 342, let k be the quotient and 47 as remainder.&lt;br /&gt;          Then, number – 342k + 47 = (19 x 18k + 19 x 2 + 9) = 19 (18k + 2) + 9.&lt;br /&gt;       The given number when divided by 19, gives (18k + 2) as quotient and 9 as remainder.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 25. A number being successively divided by 3, 5 and 8 leaves remainders 1, 4&lt;br /&gt;and 7 respectively. Find the respective remainders if the order of divisors be reversed,&lt;br /&gt;Sol.&lt;br /&gt;3 X &lt;br /&gt;5 y - 1&lt;br /&gt;8 z - 4&lt;br /&gt; 1 - 7&lt;br /&gt;z = (8 x 1 + 7) = 15; y = {5z + 4) = (5 x 15 + 4) = 79; x = (3y + 1) = (3 x 79 + 1) = 238.&lt;br /&gt;Now,&lt;br /&gt;8 238 &lt;br /&gt;5 29 - 6&lt;br /&gt;3 5 - 4&lt;br /&gt; 1 - 9,&lt;br /&gt;Respective remainders are 6, 4, 2.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 26. Find the remainder when 231 is divided by 5.&lt;br /&gt; Sol.    210 = 1024. Unit digit of 210 x 210 x 210 is 4 [as 4 x 4 x 4 gives unit digit 4].&lt;br /&gt;        Unit digit of 231 is 8.&lt;br /&gt;            Now, 8 when divided by 5, gives 3 as remainder.&lt;br /&gt;            Hence, 231 when divided by 5, gives 3 as remainder. &lt;br /&gt;&lt;br /&gt;Ex. 27. How many numbers between 11 and 90 are divisible by 7 ? &lt;br /&gt;Sol.  The required numbers are 14, 21, 28, 35, .... 77, 84.&lt;br /&gt;        This is an A.P. with a = 14 and d = (21 - 14) = 7.&lt;br /&gt;        Let it contain n terms.&lt;br /&gt;        Then, Tn = 84   =&gt;  a + (n - 1) d = 84&lt;br /&gt;                                  =&gt;   14 + (n - 1) x 7 = 84   or n = 11.&lt;br /&gt;     Required number of terms = 11.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 28. Find the sum of all odd numbers upto 100.&lt;br /&gt;Sol. The given numbers are 1, 3, 5, 7, ..., 99.&lt;br /&gt;        This is an A.P. with a = 1 and d = 2.&lt;br /&gt;        Let it contain n terms. Then,&lt;br /&gt;        1 + (n - 1) x 2 = 99 or n = 50.&lt;br /&gt;     Required sum = n (first term + last term)&lt;br /&gt;                                   2&lt;br /&gt;                                = 50 (1 + 99) = 2500.&lt;br /&gt;                                     2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 29. Find the sum of all 2 digit numbers divisible by 3.&lt;br /&gt; Sol. All 2 digit numbers divisible by 3 are :&lt;br /&gt;        12, 51, 18, 21, ..., 99.&lt;br /&gt;        This is an A.P. with a = 12 and d = 3.&lt;br /&gt;        Let it contain n terms. Then,&lt;br /&gt;        12 + (n - 1) x 3 = 99 or n = 30.&lt;br /&gt;     Required sum = 30 x (12+99) = 1665.&lt;br /&gt;                                    2&lt;br /&gt;&lt;br /&gt;Ex.30.How many terms are there in 2,4,8,16……1024?&lt;br /&gt;Sol.Clearly 2,4,8,16……..1024 form a GP. With a=2 and r = 4/2 =2.&lt;br /&gt;       Let the number of terms be n  . Then&lt;br /&gt;       2 x 2n-1 =1024 or 2n-1 =512 = 29.&lt;br /&gt;    n-1=9 or n=10.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 31. 2 + 22 + 23 + ... + 28 = ?&lt;br /&gt; Sol.    Given series is a G.P. with a = 2, r = 2 and n = 8.&lt;br /&gt;        sum =  a(rn-1) = 2 x (28 –1) = (2 x 255) =510&lt;br /&gt;                         (r-1)        (2-1)&lt;br /&gt;2. H.C.F. AND L.C.M. OF NUMBERS&lt;br /&gt;&lt;br /&gt;IMPORTANT FACTS AND FORMULAE&lt;br /&gt;&lt;br /&gt;I.  Factors and Multiples : If a number a divides another number b exactly, we say that a is a factor of b. In this case, b is called a multiple of a.&lt;br /&gt;II. Highest Common Factor (H.C.F.) or Greatest Common Measure (G.C.M.) or Greatest Common Divisor (G.C.D.): The H.C.F. of two or more than two numbers is the greatest number that divides each of them exactly. &lt;br /&gt;   There are two methods of finding the H.C.F. of a given set of numbers :&lt;br /&gt;1.  Factorization Method : Express each one of the given numbers as the product of prime factors.The product of least powers of common prime factors gives H.C.F.&lt;br /&gt;2.  Division Method: Suppose we have to find the H.C.F. of two given numbers. Divide the larger   number by the smaller one. Now, divide the divisor by the remainder. Repeat the process of dividing the preceding number by the remainder last obtained till zero is obtained as remainder. The last divisor is the required H.C.F.  &lt;br /&gt;Finding the H.C.F. of more than two numbers : Suppose we have to find the H.C.F. of three numbers. Then, H.C.F. of [(H.C.F. of any two) and (the third number)] gives the H.C.F. of three given numbers.&lt;br /&gt;Similarly, the H.C.F. of more than three numbers may be obtained. &lt;br /&gt;III.  Least Common Multiple (L.C.M.) : The least number which is exactly divisible by each one of the given numbers is called their L.C.M.&lt;br /&gt;1.  Factorization Method of Finding L.C.M.: Resolve each one of the given numbers into a product of prime factors. Then, L.C.M. is the product of highest powers of all the factors,&lt;br /&gt;2.  Common Division Method {Short-cut Method) of Finding L.C.M.: Arrange the given numbers in a row in any order. Divide by a number which divides exactly at least two of the given numbers and carry forward the numbers which are not divisible. Repeat the above process till no two of the numbers are divisible by the same number except 1. The product of the divisors and the undivided numbers is the required L.C.M. of the given numbers,&lt;br /&gt;IV. Product of two numbers =Product of their H.C.F. and L.C.M. &lt;br /&gt;V. Co-primes: Two numbers are said to be co-primes if their H.C.F. is 1. &lt;br /&gt;VI. H.C.F. and L.C.M. of Fractions:&lt;br /&gt;1.H C F= H.C.F. of Numerators         2.L C M =      L.C.M  of Numerators__&lt;br /&gt;     L.C.M. of Denominators                           H.C.F. of Denominators&lt;br /&gt;VII. H.C.F. and L.C.M. of Decimal Fractions: In given numbers, make the same number of decimal places by annexing zeros in some numbers, if necessary. Considering these numbers without decimal point, find H.C.F. or L.C.M. as the case may be. Now, in the result, mark off as many decimal places as are there in each of the given numbers.&lt;br /&gt;VIII. Comparison of Fractions: Find the L.C.M. of the denominators of the given fractions. Convert each of the fractions into an equivalent fraction with L.C.M. as the denominator, by multiplying both the numerator and denominator by the same number. The resultant fraction with the greatest numerator is the greatest.&lt;br /&gt;&lt;br /&gt;SOLVED EXAMPLES&lt;br /&gt;&lt;br /&gt;Ex. 1. Find the H.C.F. of 23  X 32   X 5 X 74, 22  X 35 X 52  X 73,23 X 53  X 72 &lt;br /&gt;Sol.    The prime numbers common to given numbers are 2,5 and 7.&lt;br /&gt;H.C.F. = 22 x 5 x72 = 980. &lt;br /&gt;&lt;br /&gt;Ex. 2. Find the H.C.F. of 108, 288 and 360. &lt;br /&gt;Sol.    108 = 22 x 33, 288 = 25 x 32 and 360 = 23 x 5 x 32.&lt;br /&gt;H.C.F. = 22 x 32 = 36. &lt;br /&gt;&lt;br /&gt;Ex. 3. Find the H.C.F. of 513, 1134 and 1215.&lt;br /&gt;Sol.&lt;br /&gt;1134 ) 1215 ( 1&lt;br /&gt;           1134 &lt;br /&gt;               81 ) 1134 ( 14&lt;br /&gt;            81&lt;br /&gt;            324&lt;br /&gt;            324&lt;br /&gt;  x  &lt;br /&gt;H.C.F. of 1134 and 1215 is 81.&lt;br /&gt;So, Required H.C.F. = H.C.F. of 513 and 81.&lt;br /&gt;     ______&lt;br /&gt;81 )   513 ( 6 &lt;br /&gt;       __486____&lt;br /&gt;             27) 81 ( 3&lt;br /&gt;       81 &lt;br /&gt;                  0&lt;br /&gt;&lt;br /&gt;H.C.F. of given numbers = 27.&lt;br /&gt;&lt;br /&gt;Ex. 4. Reduce 391     to lowest terms .&lt;br /&gt;                        667&lt;br /&gt;to lowest terms.&lt;br /&gt;&lt;br /&gt;Sol.    H.C.F. of 391 and 667 is 23.&lt;br /&gt;On dividing the numerator and denominator by 23, we get :&lt;br /&gt;391 = 391  23 = 17&lt;br /&gt;667    667 23    29&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex.5.Find the L.C.M. of 22 x 33 x 5 x 72 , 23 x 32 x 52 x 74  , 2 x 3 x 53 x 7 x 11.  &lt;br /&gt;Sol. L.C.M. = Product of highest powers of 2, 3, 5, 7 and 11 = 23 x 33 x 53 x 74 x 11&lt;br /&gt;&lt;br /&gt;Ex.6. Find the L.C.M. of 72, 108 and 2100.&lt;br /&gt;Sol. 72 = 23 x 32, 108 = 33 x 22, 2100 = 22 x 52 x 3 x 7.&lt;br /&gt; L.C.M. = 23 x 33 x 52 x 7 = 37800. &lt;br /&gt;&lt;br /&gt;Ex.7.Find the L.C.M. of 16, 24, 36 and 54.&lt;br /&gt;Sol.&lt;br /&gt;2 16 -   24 -   36 -   54&lt;br /&gt;2 8 -   12 -   18 -   27&lt;br /&gt;2 4 -     6 -     9 -   27&lt;br /&gt;3 2 -     3 -     9 -   27&lt;br /&gt;3 2 -     1 -     3 -     9&lt;br /&gt; 2 -     1 -     1 -     3&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt; L.C.M. = 2 x 2 x 2 x 3 x 3 x 2 x 3 = 432.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 8. Find the H.C.F. and L.C.M. of 2  , 8  , 16 and 10.&lt;br /&gt;     3    9    81        27 &lt;br /&gt;Sol.    H.C.F. of given fractions = H.C.F. of 2,8,16,10   =     2_    &lt;br /&gt;                                                       L.C.M. of 3,9,81,27        81&lt;br /&gt;&lt;br /&gt;          L.C.M of given fractions = L.C.M. of 2,8,16,10   =    80_    &lt;br /&gt;                                                      H.C.F. of 3,9,81,27           3&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 9. Find the H.C.F. and L.C.M. of 0.63, 1.05 and 2.1.&lt;br /&gt;Sol.     Making the same number of decimal places, the given numbers are 0.63, 1.05 and 2.10.&lt;br /&gt;Without decimal places, these numbers are 63, 105 and 210.&lt;br /&gt;Now, H.C.F. of 63, 105 and 210 is 21.&lt;br /&gt;H.C.F. of 0.63, 1.05 and 2.1 is 0.21.&lt;br /&gt;L.C.M. of 63, 105 and 210 is 630.&lt;br /&gt;L.C.M. of 0.63, 1.05 and 2.1 is 6.30.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 10. Two numbers are in the ratio of 15:11. If their H.C.F. is 13, find the numbers. &lt;br /&gt;Sol.    Let the required numbers be 15.x and llx.&lt;br /&gt;Then, their H.C.F. is x. So, x = 13.&lt;br /&gt;The numbers are (15 x 13 and 11 x 13) i.e., 195 and 143.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 11. TheH.C.F. of two numbers is 11 and their L.C.M. is 693. If one of the numbers is 77,find the other.&lt;br /&gt;Sol.    Other number = 11 X 693   = 99&lt;br /&gt;                                          77&lt;br /&gt;                              &lt;br /&gt;Ex. 12. Find the greatest possible length which can be used to measure exactly the lengths 4 m 95 cm, 9 m and 16 m 65 cm.&lt;br /&gt;Sol.    Required length = H.C.F. of 495 cm, 900 cm and 1665 cm. &lt;br /&gt;          495 = 32 x 5 x 11, 900 = 22 x 32 x 52, 1665 = 32 x 5 x 37. &lt;br /&gt;      H.C.F. = 32 x 5 = 45.&lt;br /&gt;          Hence, required length = 45 cm.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 13. Find the greatest number which on dividing 1657 and 2037 leaves remainders 6 and 5 respectively.&lt;br /&gt;Sol.    Required number = H.C.F. of (1657 - 6) and (2037 - 5) = H.C.F. of 1651 and 2032&lt;br /&gt;         _______&lt;br /&gt;1651 )   2032 ( 1 1651&lt;br /&gt;            1651_______ &lt;br /&gt;              381 )  1651 ( 4 &lt;br /&gt;                         1524_________&lt;br /&gt;                            127 )   381 ( 3 &lt;br /&gt;                                       381&lt;br /&gt;                              0&lt;br /&gt;Required number = 127.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 14. Find the largest number which divides 62, 132 and 237 to leave the same remainder in each case.&lt;br /&gt;Sol .  Required number =  H.C.F. of (132 - 62), (237 - 132) and (237 - 62) &lt;br /&gt;                                      =  H.C.F. of 70, 105 and 175 = 35.&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;Ex.15.Find the least number exactly divisible by 12,15,20,27.&lt;br /&gt;Sol. &lt;br /&gt;            &lt;br /&gt;3 12 -   15 -   20 -   27&lt;br /&gt;4 4 -   5 -   20 -   9&lt;br /&gt;5 1 -   5 -     5 -   9&lt;br /&gt; 1 -    1 -     1 -   9&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex.16.Find the least number which when divided by 6,7,8,9, and 12 leave the same remainder 1 each case &lt;br /&gt;Sol. Required number = (L.C.M OF 6,7,8,9,12) + 1&lt;br /&gt;&lt;br /&gt;3 6 -   7 -    8 -   9    -   12&lt;br /&gt;4 2 -   7 -   8 -   3   -   4&lt;br /&gt;5 1 -   7 -     4 -   3   -   2&lt;br /&gt; 1 -    7 -     2 -   3   -   1&lt;br /&gt;&lt;br /&gt;L.C.M = 3 X 2 X 2 X 7 X 2 X 3 = 504.&lt;br /&gt;Hence required number = (504 +1) = 505.&lt;br /&gt;&lt;br /&gt;Ex.17. Find the largest number of four digits exactly divisible by 12,15,18 and 27.&lt;br /&gt;Sol. The Largest number of four digits is 9999.&lt;br /&gt;       Required number must be divisible by L.C.M. of 12,15,18,27 i.e. 540.&lt;br /&gt;      On dividing 9999 by 540,we get 279 as remainder .&lt;br /&gt;   Required number = (9999-279) = 9720.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex.18.Find the smallest number of five digits exactly divisible by 16,24,36 and 54.&lt;br /&gt;Sol. Smallest number of five digits is 10000.&lt;br /&gt;       Required number must be divisible by L.C.M. of 16,24,36,54 i.e 432,&lt;br /&gt;       On dividing 10000 by 432,we get 64 as remainder.&lt;br /&gt;    Required number = 10000 +( 432 – 64 ) = 10368.&lt;br /&gt;&lt;br /&gt;Ex.19.Find the least number which when divided by 20,25,35 and 40 leaves remainders 14,19,29 and 34 respectively.&lt;br /&gt;Sol. Here,(20-14) = 6,(25 – 19)=6,(35-29)=6 and (40-34)=6.&lt;br /&gt;    Required number = (L.C.M. of 20,25,35,40) – 6 =1394.&lt;br /&gt;&lt;br /&gt;Ex.20.Find the least number which when divided by 5,6,7, and 8 leaves a remainder 3, but when divided by 9 leaves no remainder .&lt;br /&gt;Sol. L.C.M. of 5,6,7,8 = 840.&lt;br /&gt;    Required number is of the form 840k + 3&lt;br /&gt;     Least value of k for which (840k + 3) is divisible by 9 is k = 2.&lt;br /&gt; Required number = (840 X 2 + 3)=1683&lt;br /&gt;&lt;br /&gt;Ex.21.The traffic lights at three different road crossings change after every 48 sec., 72 sec and 108 sec.respectively .If they all change simultaneously at 8:20:00 hours,then at what time they again change simultaneously .&lt;br /&gt;Sol. Interval of change = (L.C.M of 48,72,108)sec.=432sec.&lt;br /&gt;       So, the lights will agin change simultaneously after every 432 seconds i.e,7 min.12sec&lt;br /&gt;       Hence , next simultaneous change will take place at 8:27:12 hrs.&lt;br /&gt;&lt;br /&gt;Ex.22.Arrange the fractions 17   , 31, 43, 59   in the ascending order.&lt;br /&gt;18   36   45  60&lt;br /&gt;Sol.L.C.M. of 18,36,45 and 60 = 180.&lt;br /&gt;Now, 17 = 17 X 10 = 170  ;   31 =   31 X 5    = 155 ;&lt;br /&gt;          18     18 X 10    180     36      36 X 5        180&lt;br /&gt;&lt;br /&gt;          43 = 43 X 4 = 172  ;   59  = 59 X 3    = 177 ; &lt;br /&gt;          45     45 X 4    180     60     60 X 3        180&lt;br /&gt;&lt;br /&gt;Since, 155&lt;170&lt;172&lt;177, so, 155 &lt; 170 &lt; 172 &lt; 177                                                 180    180    180     180Hence, 31 &lt; 17 &lt; 43 &lt; 59             36    18     45    60        3. DECIMAL FRACTIONSIMPORTANT FACTS AND FORMULAEI.    Decimal Fractions : Fractions in which denominators are powers of 10 are known as decimal  fractions.                      Thus ,1/10=1 tenth=.1;1/100=1 hundredth =.01;                    99/100=99 hundreths=.99;7/1000=7 thousandths=.007,etcII.  Conversion of a Decimal Into Vulgar Fraction : Put 1 in the denominator under the decimal point and annex with it as many zeros as is the number of digits after the decimal point. Now, remove the decimal point and reduce the fraction to its lowest terms.Thus, 0.25=25/100=1/4;2.008=2008/1000=251/125.   III.  1.  Annexing zeros to the extreme right of a decimal fraction does not change its value            Thus, 0.8 = 0.80 = 0.800, etc.2.  If numerator and denominator of a fraction contain the same number of decimal     places, then we remove the decimal sign.         Thus,   1.84/2.99 = 184/299 = 8/13;    0.365/0.584 = 365/584=5IV.  Operations on Decimal Fractions :1. Addition and Subtraction of Decimal Fractions : The given numbers are soplaced under each other that the decimal points lie in one column. The numbersso arranged can now be added or subtracted in the usual way.2. Multiplication of a Decimal Fraction By a Power of 10 : Shift the decimalpoint to the right by as many places as is the power of 10.Thus, 5.9632 x 100 = 596,32; 0.073 x 10000 = 0.0730 x 10000 = 730.3.Multiplication of Decimal Fractions : Multiply the given numbers consideringthem without the decimal point. Now, in the product, the decimal point is markedoff to obtain as many places of decimal as is the sum of the number of decimalplaces in the given numbers.Suppose we have to find the product (.2 x .02 x .002). Now, 2x2x2 = 8. Sum of decimal places = (1 + 2 + 3) = 6. .2 x .02 x .002 = .000008.4.Dividing a Decimal Fraction By a Counting Number : Divide the givennumber without considering the decimal point, by the given counting number.Now, in the quotient, put the decimal point to give as many places of decimal asthere are in the dividend.Suppose we have to find the quotient (0.0204 + 17). Now, 204 ^ 17 = 12. Dividend contains 4 places of decimal. So, 0.0204 + 17 = 0.0012.5. Dividing a Decimal Fraction By a Decimal Fraction : Multiply both the dividend and the divisor by a suitable power of 10 to make divisor a whole number. Now, proceed as above.Thus, 0.00066/0.11 = (0.00066*100)/(0.11*100) = (0.066/11) = 0.006V V.  Comparison of Fractions : Suppose some fractions are to be arranged in ascending or descending order of magnitude. Then, convert each one of the given fractions in the decimal form, and arrange them accordingly.Suppose, we have to arrange the fractions  3/5, 6/7 and 7/9  in descending order.     now, 3/5=0.6,6/7 = 0.857,7/9 = 0.777....     since  0.857&gt;0.777...&gt;0.6, so 6/7&gt;7/9&gt;3/5&lt;br /&gt;&lt;br /&gt;VI. Recurring Decimal : If in a decimal fraction, a figure or a set of figures is repeated continuously, then such a number is called a recurring decimal.&lt;br /&gt;In a recurring decimal, if a single figure is repeated, then it is expressed by putting a dot on it. If a set of figures is repeated, it is expressed by putting a bar on the set&lt;br /&gt;               ______ &lt;br /&gt;Thus 1/3 = 0.3333….= 0.3;  22 /7 = 3.142857142857.....= 3.142857&lt;br /&gt;Pure Recurring Decimal: A decimal fraction in which all the figures after the decimal point are repeated, is called a pure recurring decimal.&lt;br /&gt;&lt;br /&gt;Converting a Pure Recurring Decimal Into Vulgar Fraction : Write the repeated figures only once in the numerator and take as many nines in the denominator as is the number of repeating figures.&lt;br /&gt;&lt;br /&gt;thus ,0.5 = 5/9;  0.53 = 53/59  ;0.067 = 67/999;etc...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Mixed Recurring Decimal: A decimal fraction in which some figures do not repeat and some of them are repeated, is called a mixed recurring decimal.&lt;br /&gt;e.g., 0.17333 = 0.173.&lt;br /&gt;&lt;br /&gt;Converting a Mixed Recurring Decimal Into Vulgar Fraction : In the numerator, take the difference between the number formed by all the digits after decimal point (taking repeated digits only once) and that formed by the digits which are not repeated, In the denominator, take the number formed by as many nines as there are repeating digits followed by as many zeros as is the number of non-repeating digits.&lt;br /&gt;&lt;br /&gt;Thus 0.16 = (16-1) / 90 =  15/19 =  1/6;&lt;br /&gt;    ____&lt;br /&gt;                0.2273 =  (2273 – 22)/9900 = 2251/9900&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;VII.  Some Basic Formulae :&lt;br /&gt;&lt;br /&gt;1.   (a + b)(a- b) = (a2 - b2).&lt;br /&gt;2.   (a + b)2 = (a2 + b2 + 2ab).&lt;br /&gt;3.   (a - b)2 = (a2 + b2 - 2ab).&lt;br /&gt;4. (a + b+c)2 = a2 + b2 + c2+2(ab+bc+ca)&lt;br /&gt;5.    (a3 + b3) = (a + b) (a2 - ab + b2)&lt;br /&gt;6.    (a3 - b3) = (a - b) (a2 + ab + b2).&lt;br /&gt;7.    (a3 + b3 + c3 - 3abc) = (a + b + c) (a2 + b2 + c2-ab-bc-ca)&lt;br /&gt;8.    When   a + b + c = 0, then a3 + b3+ c3 = 3abc&lt;br /&gt;&lt;br /&gt;SOLVED EXAMPLES&lt;br /&gt;&lt;br /&gt;Ex. 1. Convert the following into vulgar fraction:&lt;br /&gt;            (i) 0.75   (ii) 3.004 (iii)  0.0056&lt;br /&gt;&lt;br /&gt;Sol. (i). 0.75 = 75/100 = 3/4 (ii) 3.004 = 3004/1000 = 751/250    (iii) 0.0056 = 56/10000 = 7/1250&lt;br /&gt;&lt;br /&gt;Ex. 2. Arrange the fractions 5/8, 7/12, 13/16, 16/29 and 3/4 in ascending order of magnitude.&lt;br /&gt;&lt;br /&gt;Sol. Converting each of the given fractions into decimal form, we get :&lt;br /&gt;        5/8 = 0.624, 7/12 = 0.8125, 16/29 = 0.5517, and 3/4 = 0.75&lt;br /&gt;        Now, 0.5517&lt;0.5833&lt;0.625&lt;0.75&lt;0.8125         16/29 &lt; 7/12 &lt; 5/8 &lt; 3/4 &lt; 13/16Ex. 3. arrange the fractions 3/5, 4/7, 8/9, and 9/11 in their descending order.Sol. Clearly, 3/5 = 0.6, 4/7 = 0.571, 8/9 = 0.88, 9/111 = 0.818.        Now, 0.88 &gt; 0.818 &gt; 0.6 &gt; 0.571&lt;br /&gt;         8/9 &gt; 9/11 &gt; 3/4 &gt; 13/ 16&lt;br /&gt;&lt;br /&gt;Ex. 4. Evaluate : (i) 6202.5 + 620.25 + 62.025 + 6.2025 + 0.62025&lt;br /&gt;       (ii) 5.064 + 3.98 + 0.7036 + 7.6 + 0.3 + 2&lt;br /&gt;&lt;br /&gt;Sol.  (i)  6202.5         (ii)   5.064&lt;br /&gt;                620.25     3.98&lt;br /&gt;                  62.025     0.7036&lt;br /&gt;         6.2025     7.6&lt;br /&gt;           + __  0.62025     0.3&lt;br /&gt;              6891.59775              _2.0___&lt;br /&gt;                19.6476 &lt;br /&gt;&lt;br /&gt;Ex. 5. Evaluate : (i) 31.004 – 17.2368  (ii) 13 – 5.1967&lt;br /&gt;&lt;br /&gt;Sol.  (i)    31.0040     (ii)   31.0000&lt;br /&gt;  – 17.2386              – _5.1967  &lt;br /&gt;13.7654 7.8033 &lt;br /&gt;&lt;br /&gt;Ex. 6. What value will replace the question mark in the following equations ?&lt;br /&gt;(i) 5172.49 + 378.352 + ? = 9318.678&lt;br /&gt;(ii) ? – 7328.96 + 5169.38&lt;br /&gt;&lt;br /&gt;Sol.  (i) Let       5172.49 + 378.352 + x = 9318.678&lt;br /&gt;    Then , x = 9318.678 – (5172.49 + 378.352) = 9318.678 – 5550.842 = 3767.836&lt;br /&gt;        (ii) Let      x – 7328.96 = 5169.38. Then, x = 5169.38 + 7328.96 = 12498.34.&lt;br /&gt;&lt;br /&gt;Ex. 7. Find the products: (i) 6.3204 * 100  (ii) 0.069 * 10000&lt;br /&gt;&lt;br /&gt;Sol.  (i) 6.3204 * 1000 = 632.04  (ii) 0.069  * 10000 = 0.0690 * 10000 = 690&lt;br /&gt;&lt;br /&gt;Ex. 8. Find the product:&lt;br /&gt; (i) 2.61 * 1.3  (ii) 2.1693 * 1.4  (iii) 0.4 * 0.04 * 0.004 * 40&lt;br /&gt;&lt;br /&gt;Sol.  (i) 261 8 13 = 3393. Sum of decimal places of given numbers = (2+1) = 3.&lt;br /&gt;  2.61 * 1.3 = 3.393.&lt;br /&gt;        (ii) 21693 * 14 = 303702. Sum of decimal places = (4+1) = 5&lt;br /&gt;              2.1693 * 1.4 = 3.03702.&lt;br /&gt;       (iii) 4 * 4 * 4 * 40 = 2560. Sum of decimal places = (1 + 2+ 3) = 6 &lt;br /&gt;   0.4 * 0.04 * 0.004 * 40 = 0.002560.&lt;br /&gt;&lt;br /&gt;Ex. 9. Given that 268 * 74 = 19832, find the values of 2.68 * 0.74.&lt;br /&gt;&lt;br /&gt;Sol.  Sum of decimal places = (2 + 2) = 4&lt;br /&gt;         2.68 * 0.74 = 1.9832.&lt;br /&gt;&lt;br /&gt;Ex. 10. Find the quotient:&lt;br /&gt; (i) 0.63 / 9  (ii) 0.0204 / 17   (iii) 3.1603 / 13 &lt;br /&gt;&lt;br /&gt;Sol.  (i) 63 / 9 = 7. Dividend contains 2 places decimal.&lt;br /&gt;  0.63 / 9 = 0.7.&lt;br /&gt;        (ii) 204 / 17 = 12. Dividend contains 4 places of decimal.&lt;br /&gt;   0.2040 / 17  = 0.0012. &lt;br /&gt;        (iii) 31603 / 13 = 2431. Dividend contains 4 places of decimal.&lt;br /&gt;    3.1603 / 13 = 0.2431.&lt;br /&gt;&lt;br /&gt;Ex. 11. Evaluate :&lt;br /&gt; (i) 35 + 0.07   (ii) 2.5 + 0.0005&lt;br /&gt;(iii) 136.09 + 43.9&lt;br /&gt;&lt;br /&gt;Sol. (i) 35/0.07 = ( 35*100) / (0.07*100) = (3500 / 7) = 500&lt;br /&gt;      (ii) 25/0.0005 = (25*10000) / (0.0005*10000) = 25000 / 5 = 5000&lt;br /&gt;     (iii) 136.09/43.9 = (136.09*10) / (43.9*10) = 1360.9 / 439 = 3.1&lt;br /&gt;&lt;br /&gt;Ex. 12. What value will come in place of question mark in the following equation?&lt;br /&gt; (i) 0.006 +? = 0.6  (ii) ? + 0.025 = 80&lt;br /&gt;&lt;br /&gt;Sol.  (i) Let 0.006 / x = 0.6, Then, x = (0.006 / 0.6) = (0.006*10) / (0.6*10) = 0.06/6 = 0.01&lt;br /&gt;        (ii) Let x / 0.025 = 80, Then, x = 80 * 0.025 = 2 &lt;br /&gt;&lt;br /&gt;Ex. 13. If (1 / 3.718) = 0.2689, Then find the value of (1 / 0.0003718).&lt;br /&gt;&lt;br /&gt;Sol.  (1 / 0.0003718 ) = ( 10000 / 3.718 ) =  10000 * (1 / 3.718) = 10000 * 0.2689 = 2689.&lt;br /&gt;&lt;br /&gt;                       ___                ______                  &lt;br /&gt;Ex. 14. Express as vulgar fractions : (i) 0.37    (ii) 0.053     (iii)  3.142857&lt;br /&gt;                __                                                  ___&lt;br /&gt;Sol. (i)  0.37 = 37 / 99 .  (ii)  0.053 = 53 / 999&lt;br /&gt;                  ______             ______  &lt;br /&gt;        (iii) 3.142857 = 3 + 0.142857 = 3 + (142857 / 999999) = 3 (142857/999999)&lt;br /&gt;                                                                        _                       __                      _&lt;br /&gt;Ex. 15. Express as vulgar fractions : (i) 0.17  (ii) 0.1254 (iii)  2.536&lt;br /&gt;                _&lt;br /&gt;Sol. (i) 0.17 = (17 – 1)/90 = 16 / 90 =  8/ 45&lt;br /&gt;                    __&lt;br /&gt;       (ii) 0.1254 = (1254 – 12 )/ 9900 = 1242 / 9900 = 69 / 550&lt;br /&gt;&lt;br /&gt;      (iii)  2.536 = 2 + 0.536 = 2 + (536 – 53)/900 = 2 + (483/900) = 2 + (161/300) = 2 (161/300)&lt;br /&gt;&lt;br /&gt;Ex. 16. Simplify:  0.05 * 0.05 * 0.05 + 0.04 * 0.04 * 0.04 &lt;br /&gt;         0.05 * 0.05 – 0.05 * 0.04 + 0.04 * 0.04&lt;br /&gt;&lt;br /&gt;Sol. Given expression  = (a3 + b3) / (a2 – ab + b2), where a = 0.05 , b = 0.04&lt;br /&gt;               = (a +b ) = (0.05 +0.04 ) =0.09&lt;br /&gt;4. SIMPLIFICATION&lt;br /&gt;&lt;br /&gt;IMPORTANT CONCEPTS&lt;br /&gt;&lt;br /&gt;I. ’BODMAS’Rule: This rule depicts the correct sequence in which the operations are to be executed,so as to find out the value of a given expression.&lt;br /&gt;&lt;br /&gt;Here, ‘B’ stands for ’bracket’ ,’O’for ‘of’ , ‘D’ for’  division’  and ‘M’ for ‘multiplication’, ‘A’ for ‘addition’ and ‘S’ for ‘subtraction’.&lt;br /&gt;Thus, in simplifying an expression, first of all the brackets must be removed, strictly in the order(), {} and [].&lt;br /&gt;&lt;br /&gt;After removing the brackets, we must use the following operations strictly in the order:&lt;br /&gt;(1)of (2)division (3) multiplication (4)addition (5)subtraction.&lt;br /&gt;&lt;br /&gt;II. Modulus of a real number : Modulus of a real number a is defined as &lt;br /&gt;     |a| ={a, if a&gt;0&lt;br /&gt;    -a, if a&lt;0 Thus, |5|=5 and |-5|=-(-5)=5.III. Virnaculum (or bar): When an expression contains Virnaculum, before applying the ‘BODMAS’ rule, we simplify the expression under the Virnaculum.   SOLVED EXAMPLESEx. 1. Simplify: (i)5005-5000+10  (ii) 18800+470+20  Sol. (i)5005-5000+10=5005-(5000/10)=5005-500=4505.        (ii)18800+470+20=(18800/470)+20=40/20=2.Ex. 2. Simplify: b-[b-(a+b)-{b-(b-a-b)}+2a] Sol. Given expression=b-[b-(a+b)-{b-(b-a+b)}+2a]                                     =b-[b-a-b-{b-2b+a}+2a]                                    =b-[-a-{b-2b+a+2a}]                                    =b-[-a-{-b+3a}]=b-[-a+b-3a]                                    =b-[-4a+b]=b+4a-b=4a.Ex. 3. What value will replace the question mark in the following equation?                        4 1+3 1+?+2 1=13 2.                           2    6         3      5         Sol. Let 9/2+19/6+x+7/3=67/5       Then x=(67/5)-(9/2+19/6+7/3)x=(67/5)-((27+19+14)/6)=((67/5)-(60/6)         x=((67/5)-10)=17/5=3 2                                                                                               5Hence, missing fractions =3 2                                             5Ex.4. 4/15 of 5/7 of a number is greater than 4/9 of 2/5 of the same number by 8.What is half of that number?Sol. Let the number be x. then 4/15 of 5/7 of x-4/9 of 2/5 of x=84/21x-8/45x=8       (4/21-8/45)x=8(60-56)/315x=84/315x=8       x=(8*315)/4=6301/2x=315Hence required number = 315.Ex. 5. Simplify:    3 1{1 1-1/2(2 1-1/4-1/6)}]                               4       4             2Sol. Given exp. =[13/4{5/4-1/2(5/2-(3-2)/12)}]=[13/4{5/4-1/2(5/2-1/12)}]                         =[13/4{5/4-1/2((30-1)/12)}]=[13/4{5/4-29/24}]                         =[13/4{(30-39)/24}]=[13/41/24]=[(13/4)*24]=78Ex. 6. Simplify: 10836of 1+2*3 1                                            4   5     4Sol. Given exp.= 1089+2*13  =108 +13 =12+13   =133 = 13 3                                        5   4       9      10          10      10        10Ex.7 Simplify: (7/2)(5/2)*(3/2)        5.25                         (7/2)(5/2)of (3/2)sol.Given exp. (7/2)(2/5)(3/2)    5.25=(21/10)(525/100)=(21/10)(15/14)                          (7/2)(15/4)Ex. 8. Simplify: (i) 12.05*5.4+0.6  (ii) 0.6*0.6+0.6*0.6 ( Bank P.O 2003)Sol. (i) Given exp. = 12.05*(5.4/0.6) = (12.05*9) = 108.45       (ii) Given exp. = 0.6*0.6+(0.6*6) = 0.36+0.1 = 0.46Ex. 9. Find the value of x in each of the following equation:(i) [(17.28/x) / (3.6*0.2)] = 2(ii) 3648.24 + 364.824 + x – 36.4824 = 3794.1696(iii) 8.5 – { 5 ½  – [7 ½  + 2.8]/x}*4.25/(0.2)2 = 306 (Hotel Management,1997)Sol. (i) (17.28/x) = 2*3.6*0.2  x = (17.28/1.44) = (1728/14) = 12.       (ii) (364.824/x) = (3794.1696 + 36.4824) – 3648.24 = 3830.652 – 3648.24 = 182.412.   x = (364.824/182.412) =2.(iii) 8.5-{5.5-(7.5+(2.8/x))}*(4.25/0.04) = 306          8.5-{5.5-{(7.5x+2.8)/x)}*(425/4) = 306             8.5-{(5.5x-7.5x-2.8)/x}*(425/4) = 306          8.5-{(-2x-2.8)/x}*106.25  = 306          8.5-{(-212.5x-297.5)/x} = 306             (306-221)x = 297.5  x =(297.5/85) = 3.5.Ex. 10. If (x/y)=(6/5), find the value (x2+y2)/(x2-y2) Sol.  (x2+y2)/(x2-y2) = ( x2 /y2+ 1)/ ( x2 /y2-1) = [(6/5)2+1] / [(6/5)2-1]                                     =  [(36/25)+1] / [(36/25)-1] = (61*25)/(25*11) = 61/11 Ex. 11. Find the value of 4 -  _____5_________           1 + ___1___  __      3 + __1___              2 + _1_            4Sol.    Given exp. =    4 -  _____5_______   =  4 -  ____5________  = 4 - ____5_____          1 + ___1__                       1 + _____1____           1 + ___1__       3 + __1___                     3 + __4__                    (31/9)            2 + _1_                                9          4                                                           =  4 - __5____   =  4 - __5___  =  4 – (5*31)/ 40 = 4 – (31/8) = 1/8        1 + _9¬_              (40/31)     31  Ex. 12. If  _____2x______   = 1 ., then find the value of x .      1 + ___1___  __   1+ __x__           1 -  xSol. We have : _____2x______ _  = 1    _____2x_____   = 1   __2x____    = 1      1 + ___1_____                  1 + ___1____                1+ (1 – x)             _(1 – x) – x                         [1/(1- x)]                 1 - x    2x = 2-x  3x = 2  x = (2/3). Ex.13.(i)If a/b=3/4 and 8a+5b=22,then find the value of a.(ii)if x/4-x-3/6=1,then find the value of x.Sol. (i) (a/b)=3/4 b=(4/3) a. 8a+5b=22  8a+5*(4/3) a=22  8a+(20/3) a=22               44a = 66  a=(66/44)=3/2(ii) (x /4)-((x-3)/6)=1 (3x-2(x-3) )/12 = 1  3x-2x+6=12  x=6.Ex.14.If 2x+3y=34 and ((x + y)/y)=13/8,then find the value of 5y+7x.Sol. The given equations are:2x+3y=34 …(i) and, ((x + y) /y)=13/8  8x+8y=13y  8x-5y=0 …(ii)Multiplying (i) by 5,(ii) by 3 and adding, we get : 34x=170 or x=5.Putting x=5 in (i), we get: y=8. 5y+7x=((5*8)+(7*5))=40+35=75Ex.15.If 2x+3y+z=55,x-y=4 and y - x + z=12,then what are the values of x , y and z?   Sol. The given equations are:2x+3y+z=55 …(i); x + z - y=4 …(ii); y -x + z =12 …(iii)Subtracting (ii) from (i), we get: x+4y=51  …(iv)Subtracting (iii) from (i), we get: 3x+2y=43  …(v) Multiplying (v) by 2 and subtracting (iv) from it, we get: 5x=35 or x=7.Putting x=7 in (iv), we get: 4y=44 or y=11.Putting x=7,y=11 in (i), we get: z=8.Ex.16.Find the value of (1-(1/3))(1-(1/4))(1-(1/5))….(1-(1/100)).  Sol. Given expression = (2/3)*(3/4)*(4/5) *…….* (99/100) = 2/100 = 1/50.Ex.17. Find the value of (1/(2*3))+(1/(3*4))+(1/(4*5))+(1/(5*6))+…..+ ((1/(9*10)).Sol. Given expression=((1/2)-(1/3))+((1/3)-(1/4))+((1/4)-(1/5))+((1/5)-(1/6))+….+ ((1/9)-(1/10))=((1/2)-(1/10))=4/10 = 2/5.Ex.18.Simplify: 9948/49  * 245.Sol. Given expression = (100-1/49) * 245=(4899/49) * 245 = 4899 * 5=24495.Ex.19.A board 7ft. 9 inches long is divided into 3 equal parts . What is the length of each part?Sol. Length of board=7ft. 9 inches=(7*12+9)inches=93 inches.Length of each part = (93/3) inches = 31 inches = 2ft. 7 inches      20.A man divides Rs. Among 5 sons,4daughters and 2 nephews .If each daughter receives four times as much as each nephews and each son receives five times as much as each nephews ,how much does each  daughter receive?Let the share of each nephews be Rs.x.Then,share of each daughter=rs4x;share of each son=Rs.5x;So,5*5x+4*4x+2*x=860025x+16x+2x=8600=43x=8600x=200;21.A man spends 2/5 of his salary on house rent,3/10 of his salary on food and 1/8 of his salary on conveyence.if he has Rs.1400 left with him,find his expenditure on food and conveyence.Part of salary left=1-(2/5+3/10+1/8)Let the monthly salary be Rs.xThen, 7/40 of x=1400X=(1400*40/7)=8600Expenditure on food=Rs.(3/10*800)=Rs.2400Expenditure on conveyence=Rs.(1/8*8000)=Rs.100022.A third of Arun’s marks in mathematics exeeds a half of his marks in english by 80.if he got 240 marks In two subjects together how many marks did he got inh english?Let Arun’s marks in mathematics and english be x and yThen 1/3x-1/2y=302x-3y=180……&gt;(1)&lt;br /&gt;x+y=240…….&gt;(2)&lt;br /&gt;solving (1) and (2)&lt;br /&gt;x=180&lt;br /&gt;and y=60&lt;br /&gt;&lt;br /&gt;23.A tin of oil was 4/5full.when 6 bottles of oil were taken out and four bottles of oil were poured into it, it was ¾ full. how many bottles of oil can the tin contain?&lt;br /&gt;Suppose x bottles can fill the tin completely&lt;br /&gt;Then4/5x-3/4x=6-4&lt;br /&gt;X/20=2&lt;br /&gt;X=40&lt;br /&gt;Therefore required no of bottles =40&lt;br /&gt;&lt;br /&gt;24.if 1/8 of a pencil is black ½ of the remaining is white and the remaining 3 ½  is blue find the total length of the pencil?&lt;br /&gt; Let the total length be xm&lt;br /&gt;Then black part =x/8cm&lt;br /&gt;The remaining part=(x-x/8)cm=7x/8cm&lt;br /&gt;White part=(1/2 *7x/8)=7x/16 cm&lt;br /&gt;Remaining part=(7x/8-7x/16)=7x/16cm&lt;br /&gt;7x/16=7/2&lt;br /&gt;x=8cm&lt;br /&gt;&lt;br /&gt;25.in a certain office 1/3 of the workers are women ½ of the women are married and 1/3 of the married women have children if ¾ of the men are married and 2/3 of the married men have children what part of workers are without children?&lt;br /&gt; Let the total no of workers be x&lt;br /&gt;No of women =x/3&lt;br /&gt;No of men =x-(x/3)=2x/3&lt;br /&gt;No of women having  children =1/3 of ½ ofx/3=x/18&lt;br /&gt;No of men having children=2/3 of ¾ of2x/3=x/3&lt;br /&gt;No of workers having children = x/8 +x/3=7x/18&lt;br /&gt;Workers having no children=x-7x/18=11x/18=11/18 of all wprkers&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;26.a crate of mangoes contains one bruised mango for every thirty mango in the crate. If three out of every four bruised mango are considerably unsaleble and there are 12 unsaleable mangoes in the crate then how msny mango are there in the crate?&lt;br /&gt;&lt;br /&gt;Let the total no of mangoes in the crate be x&lt;br /&gt;Then the no of bruised mango = 1/30 x &lt;br /&gt;Let the no of unsalable mangoes =3/4 (1/30 x)&lt;br /&gt;1/40 x =12&lt;br /&gt;x=480&lt;br /&gt;&lt;br /&gt;27. a train starts full of passengers at the first station it drops 1/3 of the passengers and takes 280more at the second station it drops one half the new total and takes twelve more .on arriving at the third station it is found to have 248 passengers. Find the no of passengers in the beginning?&lt;br /&gt;Let no of passengers in the beginning be x&lt;br /&gt;After first station no passengers=(x-x/3)+280=2x/3 +280&lt;br /&gt;After second station no passengers =1/2(2x/3+280)+12&lt;br /&gt;½(2x/3+280)+12=248&lt;br /&gt;2x/3+280=2*236&lt;br /&gt;2x/3=192&lt;br /&gt;x=288&lt;br /&gt;&lt;br /&gt;28.if a2+b2=177and ab=54 then find the value of a+b/a-b?&lt;br /&gt;(a+b)2=a2+b2+2ab=117+2*24=225&lt;br /&gt;a+b=15&lt;br /&gt;(a-b)2=a2+b2-2ab=117-2*54&lt;br /&gt;a-b=3&lt;br /&gt;a+b/a-b=15/3=5&lt;br /&gt;&lt;br /&gt;29.find the value of (75983*75983- 45983*45983/30000)&lt;br /&gt;Given expression=(75983)2-(45983)2/(75983-45983)&lt;br /&gt;=(a-b)2/(a-b)&lt;br /&gt;=(a+b)(a-b)/(a-b)&lt;br /&gt;=(a+b)&lt;br /&gt;=75983+45983&lt;br /&gt;=121966&lt;br /&gt;&lt;br /&gt;30.find the value of 343*343*343-113*113*113&lt;br /&gt;                                343*343+343*113+113*113&lt;br /&gt;     &lt;br /&gt;Given expression= (a3-b3)&lt;br /&gt;                               a2+ab+b2&lt;br /&gt;                            =(a-b)&lt;br /&gt;=(343-113)&lt;br /&gt;.=230&lt;br /&gt;&lt;br /&gt;31.Village X has a population of 68000,which is decreasing at the rate of 1200 per year.VillagyY has a population  of 42000,which is increasing &lt;br /&gt;at the rate of 800 per year .in how many years will the population of the two villages be equal?&lt;br /&gt;&lt;br /&gt;Let the population of two villages be equal after  p years&lt;br /&gt;Then,68000-1200p=42000+800p&lt;br /&gt;2000p=26000&lt;br /&gt;p=13&lt;br /&gt;&lt;br /&gt;32.From a group of boys and girls,15 girls leave.There are then left 2 boys for each girl.After this,45 boys leave.There are then 5 girls for each boy.Find &lt;br /&gt;the number of girls in the beginning?&lt;br /&gt;Let at present there be x boys.&lt;br /&gt;Then,no of girls at present=5x&lt;br /&gt;Before the boys had left:no of boys=x+45&lt;br /&gt;And no of girls=5x&lt;br /&gt;X+45=2*5x&lt;br /&gt;9x=45&lt;br /&gt;x=5&lt;br /&gt;no of girls in the beginning=25+15=40&lt;br /&gt;&lt;br /&gt;33.An employer pays Rs.20 for each day a worker works and for feits Rs.3 for each day is ideal at the end of sixty days a worker gets Rs.280 . for how many days did the worker remain ideal?&lt;br /&gt;Suppose a worker remained ideal for x days then he worked for 60-x days&lt;br /&gt;20*(60-x)-3x=280&lt;br /&gt;1200-23x=280&lt;br /&gt;23x=920&lt;br /&gt;x=40&lt;br /&gt;&lt;br /&gt;Ex 34.kiran had 85 currency notes in all , some of which were of Rs.100 denaomination and the remaining of Rs.50 denomination the total amount of all these currency note was Rs.5000.how much amount did she have in the denomination of Rs.50?&lt;br /&gt;Let  the no of fifty rupee notes be x&lt;br /&gt;Then,no of 100 rupee notes =(85-x)&lt;br /&gt;50x+100(85-x)=5000&lt;br /&gt;x+2(85-x)=100&lt;br /&gt;x=70&lt;br /&gt;so,,required amount=Rs.(50*70)= Rs.3500&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 35. When an amount was distributed among 14 boys, each of them got rs 80 more than the amount received by each boy when the same amount is distributed equally among 18 boys. What was the amount?&lt;br /&gt; Sol. Let the total amount be Rs. X the,&lt;br /&gt;   x   -   x  = 80  2 x  = 80  x =63 x 80 = 5040.&lt;br /&gt;                         14     18                        126              63&lt;br /&gt; Hence the total amount is 5040.&lt;br /&gt;&lt;br /&gt;Ex. 36. Mr. Bhaskar is on tour and he has Rs. 360 for his expenses. If he exceeds his tour by 4 days, he must cut down his daily expenses by Rs. 3. for how many days is Mr. Bhaskar on tour?&lt;br /&gt;&lt;br /&gt; Sol. Suppose Mr. Bhaskar is on tour for x days. Then,&lt;br /&gt;       360  - 360  = 3   1   -    1    =    1       x(x+4)  =4 x 120 =480&lt;br /&gt;         x       x+4              x           x+4      120&lt;br /&gt;      &lt;br /&gt;         x2 +4x –480 = 0  (x+24) (x-20) = 0   x =20.&lt;br /&gt; Hence Mr. Bhaskar is on tour for 20 days.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 37. Two pens and three pencils cost Rs 86. four Pens and a pencil cost Rs. 112. find the cost of a pen and that of a pencil.&lt;br /&gt;&lt;br /&gt;Sol. Let the cost of a pen ands a pencil be Rs. X and Rs. Y respectively.&lt;br /&gt;        Then, 2x  + 3y = 86 ….(i) and 4x + y =112.&lt;br /&gt; Solving (i) and (ii), we get: x = 25 and y = 12.&lt;br /&gt; Cost of a pen =Rs. 25 and the cost of a pencil =Rs. 12.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 38. Arjun and Sajal are friends . each has some money. If Arun gives Rs. 30 to Sajal, the Sajal will have twice the money left with Arjun. But, if Sajal gives Rs. 10 to Arjun, the Arjun will have thrice as much as is left with Sajal. How much money does each have?&lt;br /&gt; Sol. Suppose Arun has Rs. X and Sjal has Rs. Y. then,&lt;br /&gt;        2(x-30)= y+30  =&gt; 2x-y =90  …(i)&lt;br /&gt;  and  x +10 =3(y-10) =&gt; x-3y = - 40       …(ii)&lt;br /&gt;  Solving (i) and (ii), we get x =62 and y =34.&lt;br /&gt;  Arun has Rs. 62 and Sajal has Rs. 34.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 39. In a caravan, in addition to 50 hens there are 45 goats and 8 camels with some keepers. If the total number of feet be 224 more than the number of heads, find the number of keepers.&lt;br /&gt;Sol. Let the number of keepers be x then, &lt;br /&gt; Total number of heads =(50 + 45 + 8 + x)= (103 + x).&lt;br /&gt; Total number of feet = (45 + 8) x 4 + (50 + x) x 2 =(312 +2x).&lt;br /&gt;  (312 + 2x)-(103 + x) =224 x =15.&lt;br /&gt; Hence, number of keepers =15.&lt;br /&gt;&lt;br /&gt;SQUARE ROOTS AND CUBE ROOTS&lt;br /&gt;IMPORTANT FACTS AND FORMULAE&lt;br /&gt;&lt;br /&gt;Square Root: If x2 = y, we say that the square root of y is x and we write, √y = x.&lt;br /&gt;Thus, √4 = 2, √9 = 3, √196 = 14.&lt;br /&gt;Cube Root: The cube root of a given number x is the number whose cube is x. We denote the cube root of x by 3√x.&lt;br /&gt;Thus, 3√8  = 3√2 x 2 x 2 = 2, 3√343 = 3√7 x 7 x 7 = 7 etc.&lt;br /&gt;Note:&lt;br /&gt;1.√xy = √x * √y                     2. √(x/y) = √x / √y  = (√x / √y) * (√y / √y) = √xy / y&lt;br /&gt;&lt;br /&gt;SOLVED EXAMPLES&lt;br /&gt;&lt;br /&gt;Ex. 1. Evaluate √6084 by factorization method .&lt;br /&gt;Sol.     Method: Express the given number as the product of prime factors.          2    6084   &lt;br /&gt;            Now, take the product of these prime factors choosing one out of              2    3042&lt;br /&gt;            every pair of the same primes. This product gives the square root              3    1521   &lt;br /&gt;            of the given number.                                                                                   3    507&lt;br /&gt;Thus, resolving 6084 into prime factors, we get:                                        13   169&lt;br /&gt;6084 = 22 x 32 x 132                                    13   √6084 = (2 x 3 x 13) = 78.        &lt;br /&gt;                                                                     &lt;br /&gt;&lt;br /&gt;Ex. 2. Find the square root of 1471369.                                                    &lt;br /&gt; Sol.    Explanation: In the given number, mark off the digits              1  1471369 (1213&lt;br /&gt;in pairs starting from the unit's digit. Each pair and                        1              &lt;br /&gt;the remaining one digit is called a period.                                22     47&lt;br /&gt;Now, 12 = 1. On subtracting, we get 0 as remainder.                        44&lt;br /&gt;Now, bring down the next period i.e., 47.                               241      313&lt;br /&gt;Now, trial divisor is 1 x 2 = 2 and trial dividend is 47.                       241&lt;br /&gt;So, we take 22 as divisor and put 2 as quotient.                    2423        7269&lt;br /&gt;The remainder is 3.                                                                                7269&lt;br /&gt;Next, we bring down the next period which is 13.                                  x&lt;br /&gt;Now, trial divisor is 12 x 2 = 24 and trial dividend is &lt;br /&gt;313. So, we take 241 as dividend and 1 as quotient. &lt;br /&gt;The remainder is 72. ¬&lt;br /&gt;Bring down the next period i.e., 69.&lt;br /&gt;Now, the trial divisor is 121 x 2 = 242 and the trial &lt;br /&gt;dividend is 7269. So, we take 3as quotient and 2423&lt;br /&gt;as divisor. The remainder is then zero.&lt;br /&gt;Hence, √1471369 = 1213.&lt;br /&gt;&lt;br /&gt;Ex. 3. Evaluate: √248 + √51 + √ 169 . &lt;br /&gt;Sol.     Given expression = √248 + √51 + 13 = √248 + √64    = √ 248 + 8 = √256 = 16.&lt;br /&gt;&lt;br /&gt;Ex. 4. If a * b * c = √(a + 2)(b + 3) / (c + 1), find the value of 6 * 15 * 3.&lt;br /&gt;Sol. 6 * 15 * 3 = √(6 + 2)(15 + 3) / (3 + 1) = √8 * 18 / 4 = √144 / 4 = 12 / 4 = 3. &lt;br /&gt;Ex. 5. Find the value of √25/16.&lt;br /&gt;Sol.    √ 25 / 16   = √ 25 / √ 16 = 5 / 4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 6. What is the square root of 0.0009?&lt;br /&gt;Sol. √0.0009= √ 9 / 1000  = 3 / 100 = 0.03.&lt;br /&gt;&lt;br /&gt;Ex. 7. Evaluate √175.2976. &lt;br /&gt;Sol.  Method: We make even number of decimal places              1   175.2976 (13.24   &lt;br /&gt;by affixing a zero, if necessary. Now, we mark off                   1&lt;br /&gt;periods and extract the square root as shown.                     23     75             &lt;br /&gt;                                                                                                      69 &lt;br /&gt;√175.2976 = 13.24                                                         262       629 &lt;br /&gt;                                                                                                                    524&lt;br /&gt;                                                                                                     2644       10576&lt;br /&gt;                                                                                                                    10576&lt;br /&gt;                                                                                                                        x&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 8. What will come in place of question mark in each of the following questions? &lt;br /&gt;(i) √32.4 / ?  = 2 (ii) √86.49 + √ 5 + ( ? )2 = 12.3.&lt;br /&gt; Sol.  (i) Let √32.4 / x = 2. Then, 32.4/x = 4 &lt;=&gt; 4x = 32.4 &lt;=&gt; x = 8.1.&lt;br /&gt;                      &lt;br /&gt;(ii) Let √86.49 + √5 + x2 = 12.3.&lt;br /&gt;      Then, 9.3 + √5+x2 = 12.3 &lt;=&gt; √5+x2  = 12.3 - 9.3 = 3 &lt;br /&gt;      &lt;=&gt; 5 + x2 = 9   &lt;=&gt; x2 = 9 - 5= 4   &lt;=&gt;   x = √4 = 2. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex.9. Find the value of √ 0.289 / 0.00121.&lt;br /&gt;&lt;br /&gt;Sol. √0.289 / 0.00121 = √0.28900/0.00121 = √28900/121 = 170 / 11.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex.10. If √1 + (x / 144) = 13 / 12, the find the value of x.&lt;br /&gt;&lt;br /&gt;Sol. √1 + (x / 144) = 13 / 12  ( 1 + (x / 144)) = (13 / 12 )2 = 169 / 144&lt;br /&gt;  x / 144 = (169 / 144) - 1&lt;br /&gt;  x / 144 = 25/144  x = 25.&lt;br /&gt;&lt;br /&gt;Ex. 11. Find the value of √3 up to three places of decimal.&lt;br /&gt;Sol.   &lt;br /&gt;  1    3.000000   (1.732&lt;br /&gt;          1&lt;br /&gt;27 200&lt;br /&gt;189&lt;br /&gt;           343      1100&lt;br /&gt;            1029&lt;br /&gt;         3462          7100&lt;br /&gt;6924 √3 = 1.732.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 12. If √3 = 1.732, find the value of √192 - 1 √48 - √75 correct to 3 places&lt;br /&gt;                                                                            2 &lt;br /&gt;of decimal.                                          (S.S.C. 2004)&lt;br /&gt; Sol.  √192 - (1 / 2)√48 - √75 = √64 * 3 - (1/2) √ 16 * 3  - √ 25 * 3&lt;br /&gt;     =8√3 - (1/2) * 4√3 - 5√3&lt;br /&gt;     =3√3 - 2√3 = √3 = 1.732&lt;br /&gt;&lt;br /&gt;Ex. 13. Evaluate: √(9.5 * 0.0085 * 18.9) / (0.0017 * 1.9 * 0.021)&lt;br /&gt;Sol. Given exp. = √(9.5 * 0.0085 * 18.9) / (0.0017 * 1.9 * 0.021)&lt;br /&gt; Now, since the sum of decimal places in the numerator and denominator under the  radical sign is the same, we remove the decimal.&lt;br /&gt;        Given exp = √(95 * 85 * 18900) / (17 * 19 * 21) = √ 5 * 5 * 900  = 5 * 30 = 150.&lt;br /&gt;&lt;br /&gt;Ex. 14. Simplify: √ [( 12.1 )2 - (8.1)2] / [(0.25)2 + (0.25)(19.95)]&lt;br /&gt;Sol. Given exp. = √ [(12.1 + 8.1)(12.1 - 8.1)] / [(0.25)(0.25 + 19.95)]&lt;br /&gt;  &lt;br /&gt;        =√ (20.2 * 4) /( 0.25 * 20.2)   = √ 4 / 0.25 = √400 / 25 = √16 = 4.&lt;br /&gt;Ex. 15. If x = 1 + √2 and y = 1 - √2, find the value of (x2 + y2).&lt;br /&gt;Sol.  x2 + y2 = (1 + √2)2 + (1 - √2)2 = 2[(1)2 + (√2)2] = 2 * 3 = 6.&lt;br /&gt;&lt;br /&gt;Ex. 16. Evaluate: √0.9 up to 3 places of decimal.&lt;br /&gt;Sol.  &lt;br /&gt;9    0.900000(0.948&lt;br /&gt;         81&lt;br /&gt;184 900&lt;br /&gt;736&lt;br /&gt;                  1888         16400&lt;br /&gt;             15104                             √0.9 = 0.948&lt;br /&gt;                          &lt;br /&gt;&lt;br /&gt;Ex.17. If √15 = 3.88, find the value of √ (5/3).&lt;br /&gt;Sol. √ (5/3) = √(5 * 3) / (3 * 3)  = √15 / 3 = 3.88 / 3 = 1.2933…. = 1.293. &lt;br /&gt; &lt;br /&gt;Ex. 18. Find the least square number which is exactly divisible by 10,12,15 and 18.&lt;br /&gt;Sol. L.C.M. of 10, 12, 15, 18 = 180. Now, 180 = 2 * 2 * 3 * 3 *5 = 22 * 32 * 5.&lt;br /&gt; To make it a perfect square, it must be multiplied by 5.&lt;br /&gt; Required number = (22 * 32 * 52) = 900.&lt;br /&gt;&lt;br /&gt;Ex. 19. Find the greatest number of five digits which is a perfect square.&lt;br /&gt;(R.R.B. 1998)&lt;br /&gt;Sol. Greatest number of 5 digits is 99999.&lt;br /&gt;                       3    99999(316&lt;br /&gt;      9  &lt;br /&gt;                                                  61  99&lt;br /&gt;       61&lt;br /&gt;626      3899&lt;br /&gt;           3756&lt;br /&gt;   143&lt;br /&gt; Required number == (99999 - 143) = 99856.&lt;br /&gt;&lt;br /&gt;Ex. 20. Find the smallest number that must be added to 1780 to make it a perfect&lt;br /&gt;square.&lt;br /&gt;Sol. &lt;br /&gt;    4    1780 (42&lt;br /&gt;          16&lt;br /&gt;82 180 &lt;br /&gt;164&lt;br /&gt;            16&lt;br /&gt;&lt;br /&gt;   Number to be added = (43)2 - 1780 = 1849 - 1780 = 69.&lt;br /&gt;&lt;br /&gt;Ex. 21. √2 = 1.4142, find the value of √2 / (2 + √2).&lt;br /&gt;Sol. √2 / (2 + √2) = √2 / (2 + √2) * (2 - √2) / (2 - √2) = (2√2 – 2) / (4 – 2)&lt;br /&gt;           = 2(√2 – 1) / 2 = √2 – 1 = 0.4142.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;22. If x = (√5 + √3) / (√5 - √3) and y = (√5 - √3) / (√5 + √3), find the value of (x2  + y2).&lt;br /&gt;Sol. &lt;br /&gt;x = [(√5 + √3) / (√5 - √3)] * [(√5 + √3) / (√5 + √3)] = (√5 + √3)2 / (5 - 3)&lt;br /&gt;   =(5 + 3 + 2√15) / 2 = 4 + √15. &lt;br /&gt; y = [(√5 - √3) / (√5 + √3)] * [(√5 - √3) / (√5 - √3)] = (√5 - √3)2 / (5 - 3)&lt;br /&gt;    =(5 + 3 - 2√15) / 2 = 4 - √15.&lt;br /&gt; x2 + y2 = (4 + √15)2 + (4 - √15)2 = 2[(4)2 + (√15)2] = 2 * 31 = 62.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 23. Find the cube root of 2744.&lt;br /&gt;Sol.    Method: Resolve the given number as the product                 2    2744&lt;br /&gt;          of prime factors and take the product of prime                        2    1372 &lt;br /&gt; factors, choosing one out of three of the same                        2      686 &lt;br /&gt; prime factors. Resolving 2744 as the product of                     7     343&lt;br /&gt; prime factors, we get:                                                              7 ¬      49&lt;br /&gt;                                                                                                                       7&lt;br /&gt; 2744 = 23 x 73. &lt;br /&gt; 3√2744= 2 x 7 = 14.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Ex. 24. By what least number 4320 be multiplied to obtain a number which is a perfect cube?&lt;br /&gt;Sol. Clearly, 4320 = 23 * 33 * 22 * 5.&lt;br /&gt; To make it a perfect cube, it must be multiplied by 2 * 52 i.e,50.&lt;br /&gt;6.AVERAGE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex.1:Find the average of all prime numbers between 30 and 50?&lt;br /&gt;Sol: there are five prime numbers between 30 and 50.&lt;br /&gt;        They are 31,37,41,43 and 47.&lt;br /&gt; Therefore the required average=(31+37+41+43+47)/5  199/5   39.8.&lt;br /&gt;&lt;br /&gt;Ex.2. find the average of first 40 natural numbers?&lt;br /&gt;Sol:    sum  of first n natural numbers=n(n+1)/2;&lt;br /&gt; So,sum of 40 natural numbers=(40*41)/2  820.&lt;br /&gt; Therefore  the required average=(820/40) 20.5.&lt;br /&gt;&lt;br /&gt;Ex.3. find the average of first 20 multiples of 7?&lt;br /&gt;Sol:    Required average =7(1+2+3+…….+20)/20   (7*20*21)/(20*2) (147/2)=73.5.&lt;br /&gt;&lt;br /&gt;Ex.4. the average of four consecutive even numbers is 27. find the largest of these numbers?&lt;br /&gt;Sol:    let the numbers be x,x+2,x+4 andx+6. then,&lt;br /&gt;(x+(x+2)+(x+4)+(x+6))/4) = 27  &lt;br /&gt;(4x+12)/4 = 27&lt;br /&gt;x+3=27       x=24.&lt;br /&gt;Therefore the largest number=(x+6)=24+6=30.&lt;br /&gt;&lt;br /&gt;Ex.5. there are two sections A and B of a class consisting of 36 and 44 students respectively. If the average weight of section A is 40kg and that of section B is 35kg, find the average weight of the whole class?&lt;br /&gt;Sol:   total weight of(36+44) students=(36*40+44*35)kg  =2980kg.&lt;br /&gt; Therefore weight of the total class=(2980/80)kg  =37.25kg.&lt;br /&gt;&lt;br /&gt;Ex:6.nine persons went to a hotel for taking their meals 8 of them spent Rs.12 each on their meals and the ninth spent Rs.8 more than the average expenditure of all the nine.What was the total money spent by them?&lt;br /&gt;Sol: Let the average expenditure of all nine be Rs.x&lt;br /&gt;Then 12*8+(x+8)=9x or 8x=104 or x=13.&lt;br /&gt;Total money spent = 9x=Rs.(9*13)=Rs.117.&lt;br /&gt;&lt;br /&gt;Ex.7: Of the three numbers, second is twice the first and is also thrice the third.If the average of the three numbers is 44.Find the largest number.&lt;br /&gt;Sol: Let the third number be x.&lt;br /&gt;Then second number = 3x.&lt;br /&gt;First number=3x/2.&lt;br /&gt;Therefore x+3x+(3x/2)=(44*3) or x=24&lt;br /&gt;So largest number= 2nd number=3x=72.&lt;br /&gt;&lt;br /&gt;Ex.8:The average of  25 result is 18.The average of 1st 12 of them is 14 &amp; that of last 12 is 17.Find the 13th result.&lt;br /&gt;Sol: Clearly 13th result=(sum of 25 results)-(sum of 24 results)&lt;br /&gt;=(18*25)-(14*12)+(17*12)&lt;br /&gt;=450-(168+204)&lt;br /&gt;=450-372&lt;br /&gt;=78.&lt;br /&gt;&lt;br /&gt;Ex.9:The Average of 11 results is 16, if the average of the 1st 6 results is 58 &amp; that of the last 63. Find the 6th result.&lt;br /&gt;Sol: 6th result = (58*6+63*6-60*11)=66&lt;br /&gt;&lt;br /&gt;Ex.10:The average waight of A,B,C is 45 Kg. The avg wgt of A &amp; B be 40Kg &amp; that of B,C be 43Kg. Find the wgt of B.&lt;br /&gt;Sol. Let A,B,c represent their individual wgts.&lt;br /&gt;Then,&lt;br /&gt;A+B+C=(45*3)Kg=135Kg&lt;br /&gt;A+B=(40*2)Kg=80Kg &amp; B+C=(43*2)Kg=86Kg&lt;br /&gt;B=(A+B)+(B+C)-(A+B+C)&lt;br /&gt;=(80+86-135)Kg&lt;br /&gt;=31Kg.&lt;br /&gt;&lt;br /&gt;Ex. 11. The average age of a class of 39 students is 15 years. If the age of the teacher be included, then the average increases by3 months. Find the age of the teacher.&lt;br /&gt;Sol. Total age of 39 persons = (39 x 15) years &lt;br /&gt;     = 585 years.&lt;br /&gt;Average age of 40 persons= 15 yrs 3 months &lt;br /&gt;= 61/4 years.&lt;br /&gt;Total age of 40 persons = (_(61/4 )x 40) years= 610 years.&lt;br /&gt;:. Age of the teacher = (610 - 585) years=25 years.&lt;br /&gt;&lt;br /&gt;Ex. 12. The average weight of 10 oarsmen in a boat is increased by 1.8 kg when one of the crew, who weighs 53 kg is replaced by a new man. Find the weight of the new&lt;br /&gt; man.&lt;br /&gt;Sol. Total weight increased =(1.8 x 10) kg =18 kg.&lt;br /&gt;:. Weight of the new man =(53 + 18) kg =71 kg.&lt;br /&gt;&lt;br /&gt;Ex. 13. There were 35 students in a hostel. Due to the admission of 7 new students, ;he expenses of the mess were increased by Rs. 42 per day while the average expenditure per head diminished by Rs 1. Wbat was the original expenditure of the mess?&lt;br /&gt;Sol. Let the original average expenditure be Rs. x. Then,&lt;br /&gt; 42 (x - 1) - 35x=42    7x= 84  x =12.&lt;br /&gt;Original expenditure = Rs. (35 x 12) =Rs. 420. .&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;14. A batsman makes a score of 87 runs in the 17th inning and thus increases his avg by 3. Find his average after 17th inning.&lt;br /&gt;Sol. Let the average after 17th inning = x.&lt;br /&gt; Then, average after 16th inning = (x - 3).&lt;br /&gt;:. 16 (x - 3) + 87 = 17x or x = (87 - 48) = 39.&lt;br /&gt;&lt;br /&gt;Ex.15. Distance between two stations A and B is 778 km. A train covers the journey from A to B at 84 km per hour and returns back to A with a uniform speed of 56 km perhour. Find the average speed of the train during the whole journey.&lt;br /&gt;Sol. Required average speed = ((2xy)/(x+y)) km / hr &lt;br /&gt;=(2 x 84 x 56)/(84+56)km/hr&lt;br /&gt; = (2*84*56)/140 km/hr&lt;br /&gt;=67.2 km/hr.&lt;br /&gt; &lt;br /&gt;7. PROBLEMS ON NUMBERS&lt;br /&gt;&lt;br /&gt;In this section, questions involving a set of numbers are put in the form of a puzzle. You have to analyze the given conditions, assume the unknown numbers and form equations accordingly, which on solving yield the unknown numbers.&lt;br /&gt;&lt;br /&gt; SOLVED EXAMPLES &lt;br /&gt;&lt;br /&gt;Ex.1.  A number is as much greater than 36 as is less than 86. Find the number.&lt;br /&gt;Sol.    Let the number be x. Then, x - 36 = 86 - x  =&gt; 2x = 86 + 36 = 122 =&gt; x = 61.       Hence, the required number is 61.&lt;br /&gt;&lt;br /&gt;Ex. 2. Find a number such that when 15 is subtracted from 7 times the number, the&lt;br /&gt;Result is 10 more than twice the number.           (Hotel Management, 2002)&lt;br /&gt;Sol.    Let the number be x. Then, 7x - 15 = 2x + 10 =&gt; 5x = 25 =&gt;x = 5.&lt;br /&gt;     Hence, the required number is 5.&lt;br /&gt; Ex. 3. The sum of a rational number and its reciprocal is 13/6. Find the number.&lt;br /&gt;(S.S.C. 2000)&lt;br /&gt;Sol.     Let the number be x.&lt;br /&gt; Then, x + (1/x) = 13/6 =&gt; (x2 + 1)/x = 13/6 =&gt; 6x2 – 13x + 6 = 0&lt;br /&gt;    =&gt; 6x2 – 9x – 4x + 6 = 0 =&gt; (3x – 2) (2x – 3) = 0&lt;br /&gt; x = 2/3 or x = 3/2&lt;br /&gt;Hence the required number is 2/3 or 3/2.&lt;br /&gt; &lt;br /&gt;Ex. 4. The sum of two numbers is 184. If one-third of the one exceeds one-seventh&lt;br /&gt;of the other by 8, find the smaller number.&lt;br /&gt;       Sol.     Let the numbers be x and (184 - x). Then,&lt;br /&gt; (X/3) - ((184 – x)/7) = 8 =&gt; 7x – 3(184 – x) = 168 =&gt; 10x = 720 =&gt; x = 72.&lt;br /&gt;      So, the numbers are 72 and 112. Hence, smaller number = 72.&lt;br /&gt;&lt;br /&gt;Ex. 5. The difference of two numbers is 11 and one-fifth of their sum is 9. Find the numbers.&lt;br /&gt;Sol.     Let the number be x and y. Then,&lt;br /&gt;            x – y = 11      ----(i)     and 1/5 (x + y) = 9  =&gt; x + y = 45              ----(ii)&lt;br /&gt;           Adding (i) and (ii), we get: 2x = 56 or x = 28. Putting x = 28 in (i), we get: y = 17.&lt;br /&gt;            Hence, the numbers are 28 and 17.&lt;br /&gt;&lt;br /&gt;Ex. 6. If the sum of two numbers is 42 and their product is 437, then find the&lt;br /&gt;absolute  difference between the numbers. (S.S.C. 2003)&lt;br /&gt;Sol.      Let the numbers be x and y. Then, x + y = 42 and xy = 437&lt;br /&gt;            x - y = sqrt[(x + y)2 - 4xy] = sqrt[(42)2 - 4 x 437 ] = sqrt[1764 – 1748] = sqrt[16] = 4.&lt;br /&gt;     Required difference = 4.&lt;br /&gt;Ex. 7. The sum of two numbers is 16 and the sum of their squares is 113. Find the &lt;br /&gt;numbers.&lt;br /&gt;         Sol.     Let the numbers be x and (15 - x).&lt;br /&gt;          Then, x2 + (15 - x)2 = 113           =&gt; x2 + 225 + X2 - 30x = 113 &lt;br /&gt;           =&gt;       2x2 - 30x + 112 = 0          =&gt;    x2 - 15x + 56 = 0&lt;br /&gt;           =&gt;       (x - 7) (x - 8) = 0              =&gt;      x = 7  or  x = 8.&lt;br /&gt;           So, the numbers are 7 and 8.&lt;br /&gt;&lt;br /&gt;Ex. 8. The average  of  four consecutive even numbers is 27. Find the largest of these&lt;br /&gt;numbers.&lt;br /&gt;Sol.     Let the four consecutive even numbers be x, x + 2, x + 4 and x + 6.&lt;br /&gt;           Then, sum of these numbers = (27 x 4) = 108.&lt;br /&gt;           So, x + (x + 2) + (x + 4) + (x + 6) = 108  or  4x = 96  or  x = 24.&lt;br /&gt;      :. Largest number = (x + 6) = 30.&lt;br /&gt;&lt;br /&gt;Ex. 9. The sum of the squares of three consecutive odd numbers is 2531.Find the&lt;br /&gt;numbers. &lt;br /&gt;         Sol.     Let the numbers be x, x + 2 and x + 4.&lt;br /&gt;           Then, X2 + (x + 2)2 + (x + 4)2 = 2531 =&gt; 3x2 + 12x - 2511 = 0&lt;br /&gt;            =&gt;     X2 + 4x - 837 = 0 =&gt;  (x - 27) (x + 31) = 0 =&gt; x = 27.&lt;br /&gt;            Hence, the required numbers are 27, 29 and 31.&lt;br /&gt;&lt;br /&gt;Ex. 10. Of two numbers, 4 times the smaller one is less then 3 times the 1arger one by 5. If the sum of  the numbers is larger than 6 times their difference by 6, find the two numbers.&lt;br /&gt;         Sol.     Let the numbers be x and y, such that x &gt; y&lt;br /&gt;           Then, 3x - 4y = 5 ...(i)  and  (x + y) - 6 (x - y) = 6 =&gt;  -5x + 7y = 6     …(ii)&lt;br /&gt;            Solving (i) and (ii), we get: x = 59 and  y = 43.&lt;br /&gt;            Hence, the required numbers are 59 and 43.&lt;br /&gt;&lt;br /&gt;Ex. 11. The ratio between a two-digit number and the sum of the digits of that&lt;br /&gt;number is 4 : 1.If the digit in the unit's place is 3 more than the digit in the ten’s place, what is the number?&lt;br /&gt;Sol.      Let the ten's digit be x. Then, unit's digit = (x + 3).&lt;br /&gt;            Sum of the digits = x + (x + 3) = 2x + 3. Number = l0x + (x + 3) = llx + 3.&lt;br /&gt;            11x+3 / 2x + 3  = 4 / 1 =&gt; 1lx + 3 = 4 (2x + 3)    =&gt;  3x = 9      =&gt; x = 3.&lt;br /&gt;            Hence, required number = 11x + 3 = 36.&lt;br /&gt;&lt;br /&gt;Ex. 12. A number consists of two digits. The sum of the digits is 9. If 63  is subtracted&lt;br /&gt;from the number, its digits are interchanged. Find the number.&lt;br /&gt;Sol.      Let the ten's digit be x. Then, unit's digit = (9 - x).&lt;br /&gt;            Number = l0x + (9 - x) = 9x + 9.&lt;br /&gt;            Number obtained by reversing the digits = 10 (9 - x) + x = 90 - 9x.&lt;br /&gt;therefore, (9x + 9) - 63 = 90 - 9x    =&gt; 18x = 144   =&gt; x = 8.&lt;br /&gt;            So, ten's digit = 8 and unit's digit = 1.&lt;br /&gt;            Hence, the required number is 81.&lt;br /&gt;Ex. 13. A fraction becomes 2/3 when 1 is added to both, its numerator and denominator. &lt;br /&gt;And ,it becomes 1/2 when 1 is subtracted from both the numerator and  denominator. Find the fraction.&lt;br /&gt;Sol.      Let the required fraction be x/y. Then,&lt;br /&gt; x+1 / y+1 = 2 / 3  =&gt;  3x – 2y = - 1   …(i) and   x – 1 / y – 1 = 1 / 2 &lt;br /&gt; 2x – y = 1 …(ii)&lt;br /&gt;Solving (i) and (ii), we get : x = 3 , y = 5&lt;br /&gt;therefore, Required fraction= 3 / 5.&lt;br /&gt;&lt;br /&gt;Ex. 14. 50 is divided into two parts such that the sum of their reciprocals is 1/ 12.Find the two parts.&lt;br /&gt;Sol.      Let the two parts be x and  (50 - x).&lt;br /&gt;            Then, 1 / x + 1 / (50 – x) = 1 / 12 =&gt; (50 – x + x) / x ( 50 – x) = 1 / 12 &lt;br /&gt;                     =&gt; x2 – 50x + 600 = 0 =&gt; (x – 30) ( x – 20) = 0 =&gt; x = 30 or x = 20.&lt;br /&gt;So, the parts are 30 and 20.&lt;br /&gt;&lt;br /&gt; Ex. 15. If three numbers are added in pairs, the sums equal 10, 19 and 21. Find the&lt;br /&gt;numbers     )&lt;br /&gt;Sol.       Let the numbers be x, y and z. Then,&lt;br /&gt;     x+ y = 10 ...(i) y + z = 19 ...(ii)        x + z = 21       …(iii)&lt;br /&gt;Adding (i) ,(ii) and (iii), we get:  2 (x + y + z ) = 50 or  (x + y + z) = 25.&lt;br /&gt;Thus, x= (25 - 19) = 6;  y = (25 - 21) = 4;  z = (25 - 10) = 15.&lt;br /&gt;Hence, the required numbers are 6, 4 and 15.&lt;br /&gt;7. PROBLEMS ON NUMBERS&lt;br /&gt;&lt;br /&gt;In this section, questions involving a set of numbers are put in the form of a puzzle. You have to analyze the given conditions, assume the unknown numbers and form equations accordingly, which on solving yield the unknown numbers.&lt;br /&gt;&lt;br /&gt; SOLVED EXAMPLES &lt;br /&gt;&lt;br /&gt;Ex.1.  A number is as much greater than 36 as is less than 86. Find the number.&lt;br /&gt;Sol.    Let the number be x. Then, x - 36 = 86 - x  =&gt; 2x = 86 + 36 = 122 =&gt; x = 61.       Hence, the required number is 61.&lt;br /&gt;&lt;br /&gt;Ex. 2. Find a number such that when 15 is subtracted from 7 times the number, the&lt;br /&gt;Result is 10 more than twice the number.           (Hotel Management, 2002)&lt;br /&gt;Sol.    Let the number be x. Then, 7x - 15 = 2x + 10 =&gt; 5x = 25 =&gt;x = 5.&lt;br /&gt;     Hence, the required number is 5.&lt;br /&gt; Ex. 3. The sum of a rational number and its reciprocal is 13/6. Find the number.&lt;br /&gt;(S.S.C. 2000)&lt;br /&gt;Sol.     Let the number be x.&lt;br /&gt; Then, x + (1/x) = 13/6 =&gt; (x2 + 1)/x = 13/6 =&gt; 6x2 – 13x + 6 = 0&lt;br /&gt;    =&gt; 6x2 – 9x – 4x + 6 = 0 =&gt; (3x – 2) (2x – 3) = 0&lt;br /&gt; x = 2/3 or x = 3/2&lt;br /&gt;Hence the required number is 2/3 or 3/2.&lt;br /&gt; &lt;br /&gt;Ex. 4. The sum of two numbers is 184. If one-third of the one exceeds one-seventh&lt;br /&gt;of the other by 8, find the smaller number.&lt;br /&gt;       Sol.     Let the numbers be x and (184 - x). Then,&lt;br /&gt; (X/3) - ((184 – x)/7) = 8 =&gt; 7x – 3(184 – x) = 168 =&gt; 10x = 720 =&gt; x = 72.&lt;br /&gt;      So, the numbers are 72 and 112. Hence, smaller number = 72.&lt;br /&gt;&lt;br /&gt;Ex. 5. The difference of two numbers is 11 and one-fifth of their sum is 9. Find the numbers.&lt;br /&gt;Sol.     Let the number be x and y. Then,&lt;br /&gt;            x – y = 11      ----(i)     and 1/5 (x + y) = 9  =&gt; x + y = 45              ----(ii)&lt;br /&gt;           Adding (i) and (ii), we get: 2x = 56 or x = 28. Putting x = 28 in (i), we get: y = 17.&lt;br /&gt;            Hence, the numbers are 28 and 17.&lt;br /&gt;&lt;br /&gt;Ex. 6. If the sum of two numbers is 42 and their product is 437, then find the&lt;br /&gt;absolute  difference between the numbers. (S.S.C. 2003)&lt;br /&gt;Sol.      Let the numbers be x and y. Then, x + y = 42 and xy = 437&lt;br /&gt;            x - y = sqrt[(x + y)2 - 4xy] = sqrt[(42)2 - 4 x 437 ] = sqrt[1764 – 1748] = sqrt[16] = 4.&lt;br /&gt;     Required difference = 4.&lt;br /&gt;Ex. 7. The sum of two numbers is 16 and the sum of their squares is 113. Find the &lt;br /&gt;numbers.&lt;br /&gt;         Sol.     Let the numbers be x and (15 - x).&lt;br /&gt;          Then, x2 + (15 - x)2 = 113           =&gt; x2 + 225 + X2 - 30x = 113 &lt;br /&gt;           =&gt;       2x2 - 30x + 112 = 0          =&gt;    x2 - 15x + 56 = 0&lt;br /&gt;           =&gt;       (x - 7) (x - 8) = 0              =&gt;      x = 7  or  x = 8.&lt;br /&gt;           So, the numbers are 7 and 8.&lt;br /&gt;&lt;br /&gt;Ex. 8. The average  of  four consecutive even numbers is 27. Find the largest of these&lt;br /&gt;numbers.&lt;br /&gt;Sol.     Let the four consecutive even numbers be x, x + 2, x + 4 and x + 6.&lt;br /&gt;           Then, sum of these numbers = (27 x 4) = 108.&lt;br /&gt;           So, x + (x + 2) + (x + 4) + (x + 6) = 108  or  4x = 96  or  x = 24.&lt;br /&gt;      :. Largest number = (x + 6) = 30.&lt;br /&gt;&lt;br /&gt;Ex. 9. The sum of the squares of three consecutive odd numbers is 2531.Find the&lt;br /&gt;numbers. &lt;br /&gt;         Sol.     Let the numbers be x, x + 2 and x + 4.&lt;br /&gt;           Then, X2 + (x + 2)2 + (x + 4)2 = 2531 =&gt; 3x2 + 12x - 2511 = 0&lt;br /&gt;            =&gt;     X2 + 4x - 837 = 0 =&gt;  (x - 27) (x + 31) = 0 =&gt; x = 27.&lt;br /&gt;            Hence, the required numbers are 27, 29 and 31.&lt;br /&gt;&lt;br /&gt;Ex. 10. Of two numbers, 4 times the smaller one is less then 3 times the 1arger one by 5. If the sum of  the numbers is larger than 6 times their difference by 6, find the two numbers.&lt;br /&gt;         Sol.     Let the numbers be x and y, such that x &gt; y&lt;br /&gt;           Then, 3x - 4y = 5 ...(i)  and  (x + y) - 6 (x - y) = 6 =&gt;  -5x + 7y = 6     …(ii)&lt;br /&gt;            Solving (i) and (ii), we get: x = 59 and  y = 43.&lt;br /&gt;            Hence, the required numbers are 59 and 43.&lt;br /&gt;&lt;br /&gt;Ex. 11. The ratio between a two-digit number and the sum of the digits of that&lt;br /&gt;number is 4 : 1.If the digit in the unit's place is 3 more than the digit in the ten’s place, what is the number?&lt;br /&gt;Sol.      Let the ten's digit be x. Then, unit's digit = (x + 3).&lt;br /&gt;            Sum of the digits = x + (x + 3) = 2x + 3. Number = l0x + (x + 3) = llx + 3.&lt;br /&gt;            11x+3 / 2x + 3  = 4 / 1 =&gt; 1lx + 3 = 4 (2x + 3)    =&gt;  3x = 9      =&gt; x = 3.&lt;br /&gt;            Hence, required number = 11x + 3 = 36.&lt;br /&gt;&lt;br /&gt;Ex. 12. A number consists of two digits. The sum of the digits is 9. If 63  is subtracted&lt;br /&gt;from the number, its digits are interchanged. Find the number.&lt;br /&gt;Sol.      Let the ten's digit be x. Then, unit's digit = (9 - x).&lt;br /&gt;            Number = l0x + (9 - x) = 9x + 9.&lt;br /&gt;            Number obtained by reversing the digits = 10 (9 - x) + x = 90 - 9x.&lt;br /&gt;therefore, (9x + 9) - 63 = 90 - 9x    =&gt; 18x = 144   =&gt; x = 8.&lt;br /&gt;            So, ten's digit = 8 and unit's digit = 1.&lt;br /&gt;            Hence, the required number is 81.&lt;br /&gt;Ex. 13. A fraction becomes 2/3 when 1 is added to both, its numerator and denominator. &lt;br /&gt;And ,it becomes 1/2 when 1 is subtracted from both the numerator and  denominator. Find the fraction.&lt;br /&gt;Sol.      Let the required fraction be x/y. Then,&lt;br /&gt; x+1 / y+1 = 2 / 3  =&gt;  3x – 2y = - 1   …(i) and   x – 1 / y – 1 = 1 / 2 &lt;br /&gt; 2x – y = 1 …(ii)&lt;br /&gt;Solving (i) and (ii), we get : x = 3 , y = 5&lt;br /&gt;therefore, Required fraction= 3 / 5.&lt;br /&gt;&lt;br /&gt;Ex. 14. 50 is divided into two parts such that the sum of their reciprocals is 1/ 12.Find the two parts.&lt;br /&gt;Sol.      Let the two parts be x and  (50 - x).&lt;br /&gt;            Then, 1 / x + 1 / (50 – x) = 1 / 12 =&gt; (50 – x + x) / x ( 50 – x) = 1 / 12 &lt;br /&gt;                     =&gt; x2 – 50x + 600 = 0 =&gt; (x – 30) ( x – 20) = 0 =&gt; x = 30 or x = 20.&lt;br /&gt;So, the parts are 30 and 20.&lt;br /&gt;&lt;br /&gt; Ex. 15. If three numbers are added in pairs, the sums equal 10, 19 and 21. Find the&lt;br /&gt;numbers     )&lt;br /&gt;Sol.       Let the numbers be x, y and z. Then,&lt;br /&gt;     x+ y = 10 ...(i) y + z = 19 ...(ii)        x + z = 21       …(iii)&lt;br /&gt;Adding (i) ,(ii) and (iii), we get:  2 (x + y + z ) = 50 or  (x + y + z) = 25.&lt;br /&gt;Thus, x= (25 - 19) = 6;  y = (25 - 21) = 4;  z = (25 - 10) = 15.&lt;br /&gt;Hence, the required numbers are 6, 4 and 15.&lt;br /&gt;&lt;br /&gt;8. PROBLEMS ON AGES&lt;br /&gt;&lt;br /&gt; Ex. 1. Rajeev's age after 15 years will be 5 times his age 5 years back. What is the &lt;br /&gt;present age of Rajeev ?        (Hotel Management,2002)&lt;br /&gt; &lt;br /&gt; Sol. Let Rajeev's present age be x years. Then,&lt;br /&gt; Rajeev's age after 15 years = (x + 15) years.&lt;br /&gt; Rajeev's age 5 years back = (x - 5) years.&lt;br /&gt; :. x + 15 = 5 (x - 5) x + 15 = 5x - 25  4x = 40  x = 10.&lt;br /&gt; Hence, Rajeev's present age = 10 years.&lt;br /&gt; &lt;br /&gt;Ex. 2. The ages of two persons differ by 16 years. If 6 years ago, the elder  one be &lt;br /&gt;3 times as old as the younger one, find their present ages.                    (A.A.O. Exam,2003)&lt;br /&gt; Sol. Let the age of the younger person be x years.&lt;br /&gt; Then, age of the elder person = (x + 16) years.&lt;br /&gt; :. 3 (x - 6) = (x + 16 - 6)  3x -18 = x + 10  2x = 28  x = 14.&lt;br /&gt; Hence, their present ages are 14 years and 30 years.&lt;br /&gt;&lt;br /&gt;Ex. 3. The product of the ages of Ankit and Nikita is 240. If twice the age of Nikita&lt;br /&gt;is more than Ankit's age by 4 years, what is Nikita's age?  (S.B.I.P.O,1999)&lt;br /&gt;Sol. Let Ankit's age be x years. Then, Nikita's age = 240/xyears.&lt;br /&gt; 2  (240 /x ) – x = 4  480 – x2 = 4x  x2 + 4x – 480 = 0&lt;br /&gt;                                       ( x+24)(x-20) = 0  x = 20.  &lt;br /&gt; Hence, Nikita's age = (22_0) years = 12 years. 1&lt;br /&gt;Ex. 4. The present age of a father is 3 years more than three times the age of his son. Three years hence, father's age will be 10 years more than twice the age of the son. Find the present age of the father. . (S.S.C, 2003)&lt;br /&gt; Sol. Let the son's present age be x years. Then, father's present age = (3x + 3) years&lt;br /&gt;  (3x + 3 + 3) = 2 (x + 3) + 10    3x + 6 = 2x + 16  x = 10.&lt;br /&gt; Hence, father's present age = (3x + 3) = ((3  10) + 3) years = 33 years.&lt;br /&gt; &lt;br /&gt;Ex. 5. Rohit was 4 times as old as his son 8 years ago. After 8 years, Rohit will be&lt;br /&gt;twice as old as his son. What are their present ages?&lt;br /&gt; Sol. Let son's age 8 years ago be x years. Then, Rohit's age 8 years ago = 4x years.&lt;br /&gt; Son's age after 8 years = (x + 8) + 8 = (x + 16) years.&lt;br /&gt; Rohit's age after 8 years = (4x + 8) + 8 = (4x+ 16) years.&lt;br /&gt;  2 (x + 16) = 4x + 16  2x = 16  x = 8.&lt;br /&gt; Hence, son's 'present age = (x + 8) = 16 years.&lt;br /&gt; Rohit's present age = (4x + 8) = 40 years.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 6. One year ago, the ratio of Gaurav’s and Sachin’s age was 6: 7 respectively.&lt;br /&gt;Four years hence, this ratio would become 7: 8. How old is Sa chin ?&lt;br /&gt; (NABARD, 2002)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sol:&lt;br /&gt;. Let Gaurav's and Sachin's ages one year ago be 6x and 7x years respectively. Then, Gaurav's age &lt;br /&gt;  4 years hence = (6x + 1) + 4 = (6x + 5) years.&lt;br /&gt;Sachin's age 4 years hence = (7x + 1) + 4 = (7x + 5) years.&lt;br /&gt;&lt;br /&gt;6x+5  = 7   8(6x+5) = 7 (7x + 5)   48x + 40 = 49x + 35   x = 5.&lt;br /&gt;7x+5     8&lt;br /&gt; Hence, Sachin's present age = (7x + 1) = 36 years.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;,7. Abhay’s age after six years will be three-seventh of his fathers age. Ten years ago the ratio of their ages was 1 : 5. What is Abhay’s father's age at present?&lt;br /&gt; &lt;br /&gt;Sol. Let the ages of Abhay and his father 10 years ago be x and 5x years respectively. Then,&lt;br /&gt; Abhay's age after 6 years = (x + 10) + 6 = (x + 16) years.&lt;br /&gt; Father's age after 6 years = (5x + 10) + 6 = (5x + 16) years.&lt;br /&gt; &lt;br /&gt;\x + 16) =  3 (5x + 16)   7 (x + 16) = 3 (5x + 16)   7x + 112 = 15x + 48&lt;br /&gt;                  7              &lt;br /&gt;                                       8x = 64     x = 8.&lt;br /&gt;Hence, Abhay's father's present age = (5x + 10) = 50 years.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;8. PROBLEMS ON AGES&lt;br /&gt;&lt;br /&gt; Ex. 1. Rajeev's age after 15 years will be 5 times his age 5 years back. What is the &lt;br /&gt;present age of Rajeev ?        (Hotel Management,2002)&lt;br /&gt; &lt;br /&gt; Sol. Let Rajeev's present age be x years. Then,&lt;br /&gt; Rajeev's age after 15 years = (x + 15) years.&lt;br /&gt; Rajeev's age 5 years back = (x - 5) years.&lt;br /&gt; :. x + 15 = 5 (x - 5) x + 15 = 5x - 25  4x = 40  x = 10.&lt;br /&gt; Hence, Rajeev's present age = 10 years.&lt;br /&gt; &lt;br /&gt;Ex. 2. The ages of two persons differ by 16 years. If 6 years ago, the elder  one be &lt;br /&gt;3 times as old as the younger one, find their present ages.                    (A.A.O. Exam,2003)&lt;br /&gt; Sol. Let the age of the younger person be x years.&lt;br /&gt; Then, age of the elder person = (x + 16) years.&lt;br /&gt; :. 3 (x - 6) = (x + 16 - 6)  3x -18 = x + 10  2x = 28  x = 14.&lt;br /&gt; Hence, their present ages are 14 years and 30 years.&lt;br /&gt;&lt;br /&gt;Ex. 3. The product of the ages of Ankit and Nikita is 240. If twice the age of Nikita&lt;br /&gt;is more than Ankit's age by 4 years, what is Nikita's age?  (S.B.I.P.O,1999)&lt;br /&gt;Sol. Let Ankit's age be x years. Then, Nikita's age = 240/xyears.&lt;br /&gt; 2  (240 /x ) – x = 4  480 – x2 = 4x  x2 + 4x – 480 = 0&lt;br /&gt;                                       ( x+24)(x-20) = 0  x = 20.  &lt;br /&gt; Hence, Nikita's age = (22_0) years = 12 years. 1&lt;br /&gt;Ex. 4. The present age of a father is 3 years more than three times the age of his son. Three years hence, father's age will be 10 years more than twice the age of the son. Find the present age of the father. . (S.S.C, 2003)&lt;br /&gt; Sol. Let the son's present age be x years. Then, father's present age = (3x + 3) years&lt;br /&gt;  (3x + 3 + 3) = 2 (x + 3) + 10    3x + 6 = 2x + 16  x = 10.&lt;br /&gt; Hence, father's present age = (3x + 3) = ((3  10) + 3) years = 33 years.&lt;br /&gt; &lt;br /&gt;Ex. 5. Rohit was 4 times as old as his son 8 years ago. After 8 years, Rohit will be&lt;br /&gt;twice as old as his son. What are their present ages?&lt;br /&gt; Sol. Let son's age 8 years ago be x years. Then, Rohit's age 8 years ago = 4x years.&lt;br /&gt; Son's age after 8 years = (x + 8) + 8 = (x + 16) years.&lt;br /&gt; Rohit's age after 8 years = (4x + 8) + 8 = (4x+ 16) years.&lt;br /&gt;  2 (x + 16) = 4x + 16  2x = 16  x = 8.&lt;br /&gt; Hence, son's 'present age = (x + 8) = 16 years.&lt;br /&gt; Rohit's present age = (4x + 8) = 40 years.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 6. One year ago, the ratio of Gaurav’s and Sachin’s age was 6: 7 respectively.&lt;br /&gt;Four years hence, this ratio would become 7: 8. How old is Sa chin ?&lt;br /&gt; (NABARD, 2002)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sol:&lt;br /&gt;. Let Gaurav's and Sachin's ages one year ago be 6x and 7x years respectively. Then, Gaurav's age &lt;br /&gt;  4 years hence = (6x + 1) + 4 = (6x + 5) years.&lt;br /&gt;Sachin's age 4 years hence = (7x + 1) + 4 = (7x + 5) years.&lt;br /&gt;&lt;br /&gt;6x+5  = 7   8(6x+5) = 7 (7x + 5)   48x + 40 = 49x + 35   x = 5.&lt;br /&gt;7x+5     8&lt;br /&gt; Hence, Sachin's present age = (7x + 1) = 36 years.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;,7. Abhay’s age after six years will be three-seventh of his fathers age. Ten years ago the ratio of their ages was 1 : 5. What is Abhay’s father's age at present?&lt;br /&gt; &lt;br /&gt;Sol. Let the ages of Abhay and his father 10 years ago be x and 5x years respectively. Then,&lt;br /&gt; Abhay's age after 6 years = (x + 10) + 6 = (x + 16) years.&lt;br /&gt; Father's age after 6 years = (5x + 10) + 6 = (5x + 16) years.&lt;br /&gt; &lt;br /&gt;\x + 16) =  3 (5x + 16)   7 (x + 16) = 3 (5x + 16)   7x + 112 = 15x + 48&lt;br /&gt;                  7              &lt;br /&gt;                                       8x = 64     x = 8.&lt;br /&gt;Hence, Abhay's father's present age = (5x + 10) = 50 years.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;8. PROBLEMS ON AGES&lt;br /&gt;&lt;br /&gt; Ex. 1. Rajeev's age after 15 years will be 5 times his age 5 years back. What is the &lt;br /&gt;present age of Rajeev ?        (Hotel Management,2002)&lt;br /&gt; &lt;br /&gt; Sol. Let Rajeev's present age be x years. Then,&lt;br /&gt; Rajeev's age after 15 years = (x + 15) years.&lt;br /&gt; Rajeev's age 5 years back = (x - 5) years.&lt;br /&gt; :. x + 15 = 5 (x - 5) x + 15 = 5x - 25  4x = 40  x = 10.&lt;br /&gt; Hence, Rajeev's present age = 10 years.&lt;br /&gt; &lt;br /&gt;Ex. 2. The ages of two persons differ by 16 years. If 6 years ago, the elder  one be &lt;br /&gt;3 times as old as the younger one, find their present ages.                    (A.A.O. Exam,2003)&lt;br /&gt; Sol. Let the age of the younger person be x years.&lt;br /&gt; Then, age of the elder person = (x + 16) years.&lt;br /&gt; :. 3 (x - 6) = (x + 16 - 6)  3x -18 = x + 10  2x = 28  x = 14.&lt;br /&gt; Hence, their present ages are 14 years and 30 years.&lt;br /&gt;&lt;br /&gt;Ex. 3. The product of the ages of Ankit and Nikita is 240. If twice the age of Nikita&lt;br /&gt;is more than Ankit's age by 4 years, what is Nikita's age?  (S.B.I.P.O,1999)&lt;br /&gt;Sol. Let Ankit's age be x years. Then, Nikita's age = 240/xyears.&lt;br /&gt; 2  (240 /x ) – x = 4  480 – x2 = 4x  x2 + 4x – 480 = 0&lt;br /&gt;                                       ( x+24)(x-20) = 0  x = 20.  &lt;br /&gt; Hence, Nikita's age = (22_0) years = 12 years. 1&lt;br /&gt;Ex. 4. The present age of a father is 3 years more than three times the age of his son. Three years hence, father's age will be 10 years more than twice the age of the son. Find the present age of the father. . (S.S.C, 2003)&lt;br /&gt; Sol. Let the son's present age be x years. Then, father's present age = (3x + 3) years&lt;br /&gt;  (3x + 3 + 3) = 2 (x + 3) + 10    3x + 6 = 2x + 16  x = 10.&lt;br /&gt; Hence, father's present age = (3x + 3) = ((3  10) + 3) years = 33 years.&lt;br /&gt; &lt;br /&gt;Ex. 5. Rohit was 4 times as old as his son 8 years ago. After 8 years, Rohit will be&lt;br /&gt;twice as old as his son. What are their present ages?&lt;br /&gt; Sol. Let son's age 8 years ago be x years. Then, Rohit's age 8 years ago = 4x years.&lt;br /&gt; Son's age after 8 years = (x + 8) + 8 = (x + 16) years.&lt;br /&gt; Rohit's age after 8 years = (4x + 8) + 8 = (4x+ 16) years.&lt;br /&gt;  2 (x + 16) = 4x + 16  2x = 16  x = 8.&lt;br /&gt; Hence, son's 'present age = (x + 8) = 16 years.&lt;br /&gt; Rohit's present age = (4x + 8) = 40 years.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 6. One year ago, the ratio of Gaurav’s and Sachin’s age was 6: 7 respectively.&lt;br /&gt;Four years hence, this ratio would become 7: 8. How old is Sa chin ?&lt;br /&gt; (NABARD, 2002)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sol:&lt;br /&gt;. Let Gaurav's and Sachin's ages one year ago be 6x and 7x years respectively. Then, Gaurav's age &lt;br /&gt;  4 years hence = (6x + 1) + 4 = (6x + 5) years.&lt;br /&gt;Sachin's age 4 years hence = (7x + 1) + 4 = (7x + 5) years.&lt;br /&gt;&lt;br /&gt;6x+5  = 7   8(6x+5) = 7 (7x + 5)   48x + 40 = 49x + 35   x = 5.&lt;br /&gt;7x+5     8&lt;br /&gt; Hence, Sachin's present age = (7x + 1) = 36 years.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;,7. Abhay’s age after six years will be three-seventh of his fathers age. Ten years ago the ratio of their ages was 1 : 5. What is Abhay’s father's age at present?&lt;br /&gt; &lt;br /&gt;Sol. Let the ages of Abhay and his father 10 years ago be x and 5x years respectively. Then,&lt;br /&gt; Abhay's age after 6 years = (x + 10) + 6 = (x + 16) years.&lt;br /&gt; Father's age after 6 years = (5x + 10) + 6 = (5x + 16) years.&lt;br /&gt; &lt;br /&gt;\x + 16) =  3 (5x + 16)   7 (x + 16) = 3 (5x + 16)   7x + 112 = 15x + 48&lt;br /&gt;                  7              &lt;br /&gt;                                       8x = 64     x = 8.&lt;br /&gt;Hence, Abhay's father's present age = (5x + 10) = 50 years.&lt;br /&gt;&lt;br /&gt;8. PROBLEMS ON AGES&lt;br /&gt;&lt;br /&gt; Ex. 1. Rajeev's age after 15 years will be 5 times his age 5 years back. What is the &lt;br /&gt;present age of Rajeev ?        (Hotel Management,2002)&lt;br /&gt; &lt;br /&gt; Sol. Let Rajeev's present age be x years. Then,&lt;br /&gt; Rajeev's age after 15 years = (x + 15) years.&lt;br /&gt; Rajeev's age 5 years back = (x - 5) years.&lt;br /&gt; :. x + 15 = 5 (x - 5) x + 15 = 5x - 25  4x = 40  x = 10.&lt;br /&gt; Hence, Rajeev's present age = 10 years.&lt;br /&gt; &lt;br /&gt;Ex. 2. The ages of two persons differ by 16 years. If 6 years ago, the elder  one be &lt;br /&gt;3 times as old as the younger one, find their present ages.                    (A.A.O. Exam,2003)&lt;br /&gt; Sol. Let the age of the younger person be x years.&lt;br /&gt; Then, age of the elder person = (x + 16) years.&lt;br /&gt; :. 3 (x - 6) = (x + 16 - 6)  3x -18 = x + 10  2x = 28  x = 14.&lt;br /&gt; Hence, their present ages are 14 years and 30 years.&lt;br /&gt;&lt;br /&gt;Ex. 3. The product of the ages of Ankit and Nikita is 240. If twice the age of Nikita&lt;br /&gt;is more than Ankit's age by 4 years, what is Nikita's age?  (S.B.I.P.O,1999)&lt;br /&gt;Sol. Let Ankit's age be x years. Then, Nikita's age = 240/xyears.&lt;br /&gt; 2  (240 /x ) – x = 4  480 – x2 = 4x  x2 + 4x – 480 = 0&lt;br /&gt;                                       ( x+24)(x-20) = 0  x = 20.  &lt;br /&gt; Hence, Nikita's age = (22_0) years = 12 years. 1&lt;br /&gt;Ex. 4. The present age of a father is 3 years more than three times the age of his son. Three years hence, father's age will be 10 years more than twice the age of the son. Find the present age of the father. . (S.S.C, 2003)&lt;br /&gt; Sol. Let the son's present age be x years. Then, father's present age = (3x + 3) years&lt;br /&gt;  (3x + 3 + 3) = 2 (x + 3) + 10    3x + 6 = 2x + 16  x = 10.&lt;br /&gt; Hence, father's present age = (3x + 3) = ((3  10) + 3) years = 33 years.&lt;br /&gt; &lt;br /&gt;Ex. 5. Rohit was 4 times as old as his son 8 years ago. After 8 years, Rohit will be&lt;br /&gt;twice as old as his son. What are their present ages?&lt;br /&gt; Sol. Let son's age 8 years ago be x years. Then, Rohit's age 8 years ago = 4x years.&lt;br /&gt; Son's age after 8 years = (x + 8) + 8 = (x + 16) years.&lt;br /&gt; Rohit's age after 8 years = (4x + 8) + 8 = (4x+ 16) years.&lt;br /&gt;  2 (x + 16) = 4x + 16  2x = 16  x = 8.&lt;br /&gt; Hence, son's 'present age = (x + 8) = 16 years.&lt;br /&gt; Rohit's present age = (4x + 8) = 40 years.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 6. One year ago, the ratio of Gaurav’s and Sachin’s age was 6: 7 respectively.&lt;br /&gt;Four years hence, this ratio would become 7: 8. How old is Sa chin ?&lt;br /&gt; (NABARD, 2002)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sol:&lt;br /&gt;. Let Gaurav's and Sachin's ages one year ago be 6x and 7x years respectively. Then, Gaurav's age &lt;br /&gt;  4 years hence = (6x + 1) + 4 = (6x + 5) years.&lt;br /&gt;Sachin's age 4 years hence = (7x + 1) + 4 = (7x + 5) years.&lt;br /&gt;&lt;br /&gt;6x+5  = 7   8(6x+5) = 7 (7x + 5)   48x + 40 = 49x + 35   x = 5.&lt;br /&gt;7x+5     8&lt;br /&gt; Hence, Sachin's present age = (7x + 1) = 36 years.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;,7. Abhay’s age after six years will be three-seventh of his fathers age. Ten years ago the ratio of their ages was 1 : 5. What is Abhay’s father's age at present?&lt;br /&gt; &lt;br /&gt;Sol. Let the ages of Abhay and his father 10 years ago be x and 5x years respectively. Then,&lt;br /&gt; Abhay's age after 6 years = (x + 10) + 6 = (x + 16) years.&lt;br /&gt; Father's age after 6 years = (5x + 10) + 6 = (5x + 16) years.&lt;br /&gt; &lt;br /&gt;\x + 16) =  3 (5x + 16)   7 (x + 16) = 3 (5x + 16)   7x + 112 = 15x + 48&lt;br /&gt;                  7              &lt;br /&gt;                                       8x = 64     x = 8.&lt;br /&gt;Hence, Abhay's father's present age = (5x + 10) = 50 years.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;8. PROBLEMS ON AGES&lt;br /&gt;&lt;br /&gt; Ex. 1. Rajeev's age after 15 years will be 5 times his age 5 years back. What is the &lt;br /&gt;present age of Rajeev ?        (Hotel Management,2002)&lt;br /&gt; &lt;br /&gt; Sol. Let Rajeev's present age be x years. Then,&lt;br /&gt; Rajeev's age after 15 years = (x + 15) years.&lt;br /&gt; Rajeev's age 5 years back = (x - 5) years.&lt;br /&gt; :. x + 15 = 5 (x - 5) x + 15 = 5x - 25  4x = 40  x = 10.&lt;br /&gt; Hence, Rajeev's present age = 10 years.&lt;br /&gt; &lt;br /&gt;Ex. 2. The ages of two persons differ by 16 years. If 6 years ago, the elder  one be &lt;br /&gt;3 times as old as the younger one, find their present ages.                    (A.A.O. Exam,2003)&lt;br /&gt; Sol. Let the age of the younger person be x years.&lt;br /&gt; Then, age of the elder person = (x + 16) years.&lt;br /&gt; :. 3 (x - 6) = (x + 16 - 6)  3x -18 = x + 10  2x = 28  x = 14.&lt;br /&gt; Hence, their present ages are 14 years and 30 years.&lt;br /&gt;&lt;br /&gt;Ex. 3. The product of the ages of Ankit and Nikita is 240. If twice the age of Nikita&lt;br /&gt;is more than Ankit's age by 4 years, what is Nikita's age?  (S.B.I.P.O,1999)&lt;br /&gt;Sol. Let Ankit's age be x years. Then, Nikita's age = 240/xyears.&lt;br /&gt; 2  (240 /x ) – x = 4  480 – x2 = 4x  x2 + 4x – 480 = 0&lt;br /&gt;                                       ( x+24)(x-20) = 0  x = 20.  &lt;br /&gt; Hence, Nikita's age = (22_0) years = 12 years. 1&lt;br /&gt;Ex. 4. The present age of a father is 3 years more than three times the age of his son. Three years hence, father's age will be 10 years more than twice the age of the son. Find the present age of the father. . (S.S.C, 2003)&lt;br /&gt; Sol. Let the son's present age be x years. Then, father's present age = (3x + 3) years&lt;br /&gt;  (3x + 3 + 3) = 2 (x + 3) + 10    3x + 6 = 2x + 16  x = 10.&lt;br /&gt; Hence, father's present age = (3x + 3) = ((3  10) + 3) years = 33 years.&lt;br /&gt; &lt;br /&gt;Ex. 5. Rohit was 4 times as old as his son 8 years ago. After 8 years, Rohit will be&lt;br /&gt;twice as old as his son. What are their present ages?&lt;br /&gt; Sol. Let son's age 8 years ago be x years. Then, Rohit's age 8 years ago = 4x years.&lt;br /&gt; Son's age after 8 years = (x + 8) + 8 = (x + 16) years.&lt;br /&gt; Rohit's age after 8 years = (4x + 8) + 8 = (4x+ 16) years.&lt;br /&gt;  2 (x + 16) = 4x + 16  2x = 16  x = 8.&lt;br /&gt; Hence, son's 'present age = (x + 8) = 16 years.&lt;br /&gt; Rohit's present age = (4x + 8) = 40 years.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 6. One year ago, the ratio of Gaurav’s and Sachin’s age was 6: 7 respectively.&lt;br /&gt;Four years hence, this ratio would become 7: 8. How old is Sa chin ?&lt;br /&gt; (NABARD, 2002)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sol:&lt;br /&gt;. Let Gaurav's and Sachin's ages one year ago be 6x and 7x years respectively. Then, Gaurav's age &lt;br /&gt;  4 years hence = (6x + 1) + 4 = (6x + 5) years.&lt;br /&gt;Sachin's age 4 years hence = (7x + 1) + 4 = (7x + 5) years.&lt;br /&gt;&lt;br /&gt;6x+5  = 7   8(6x+5) = 7 (7x + 5)   48x + 40 = 49x + 35   x = 5.&lt;br /&gt;7x+5     8&lt;br /&gt; Hence, Sachin's present age = (7x + 1) = 36 years.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;,7. Abhay’s age after six years will be three-seventh of his fathers age. Ten years ago the ratio of their ages was 1 : 5. What is Abhay’s father's age at present?&lt;br /&gt; &lt;br /&gt;Sol. Let the ages of Abhay and his father 10 years ago be x and 5x years respectively. Then,&lt;br /&gt; Abhay's age after 6 years = (x + 10) + 6 = (x + 16) years.&lt;br /&gt; Father's age after 6 years = (5x + 10) + 6 = (5x + 16) years.&lt;br /&gt; &lt;br /&gt;\x + 16) =  3 (5x + 16)   7 (x + 16) = 3 (5x + 16)   7x + 112 = 15x + 48&lt;br /&gt;                  7              &lt;br /&gt;                                       8x = 64     x = 8.&lt;br /&gt;Hence, Abhay's father's present age = (5x + 10) = 50 years.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;8. PROBLEMS ON AGES&lt;br /&gt;&lt;br /&gt; Ex. 1. Rajeev's age after 15 years will be 5 times his age 5 years back. What is the &lt;br /&gt;present age of Rajeev ?        (Hotel Management,2002)&lt;br /&gt; &lt;br /&gt; Sol. Let Rajeev's present age be x years. Then,&lt;br /&gt; Rajeev's age after 15 years = (x + 15) years.&lt;br /&gt; Rajeev's age 5 years back = (x - 5) years.&lt;br /&gt; :. x + 15 = 5 (x - 5) x + 15 = 5x - 25  4x = 40  x = 10.&lt;br /&gt; Hence, Rajeev's present age = 10 years.&lt;br /&gt; &lt;br /&gt;Ex. 2. The ages of two persons differ by 16 years. If 6 years ago, the elder  one be &lt;br /&gt;3 times as old as the younger one, find their present ages.                    (A.A.O. Exam,2003)&lt;br /&gt; Sol. Let the age of the younger person be x years.&lt;br /&gt; Then, age of the elder person = (x + 16) years.&lt;br /&gt; :. 3 (x - 6) = (x + 16 - 6)  3x -18 = x + 10  2x = 28  x = 14.&lt;br /&gt; Hence, their present ages are 14 years and 30 years.&lt;br /&gt;&lt;br /&gt;Ex. 3. The product of the ages of Ankit and Nikita is 240. If twice the age of Nikita&lt;br /&gt;is more than Ankit's age by 4 years, what is Nikita's age?  (S.B.I.P.O,1999)&lt;br /&gt;Sol. Let Ankit's age be x years. Then, Nikita's age = 240/xyears.&lt;br /&gt; 2  (240 /x ) – x = 4  480 – x2 = 4x  x2 + 4x – 480 = 0&lt;br /&gt;                                       ( x+24)(x-20) = 0  x = 20.  &lt;br /&gt; Hence, Nikita's age = (22_0) years = 12 years. 1&lt;br /&gt;Ex. 4. The present age of a father is 3 years more than three times the age of his son. Three years hence, father's age will be 10 years more than twice the age of the son. Find the present age of the father. . (S.S.C, 2003)&lt;br /&gt; Sol. Let the son's present age be x years. Then, father's present age = (3x + 3) years&lt;br /&gt;  (3x + 3 + 3) = 2 (x + 3) + 10    3x + 6 = 2x + 16  x = 10.&lt;br /&gt; Hence, father's present age = (3x + 3) = ((3  10) + 3) years = 33 years.&lt;br /&gt; &lt;br /&gt;Ex. 5. Rohit was 4 times as old as his son 8 years ago. After 8 years, Rohit will be&lt;br /&gt;twice as old as his son. What are their present ages?&lt;br /&gt; Sol. Let son's age 8 years ago be x years. Then, Rohit's age 8 years ago = 4x years.&lt;br /&gt; Son's age after 8 years = (x + 8) + 8 = (x + 16) years.&lt;br /&gt; Rohit's age after 8 years = (4x + 8) + 8 = (4x+ 16) years.&lt;br /&gt;  2 (x + 16) = 4x + 16  2x = 16  x = 8.&lt;br /&gt; Hence, son's 'present age = (x + 8) = 16 years.&lt;br /&gt; Rohit's present age = (4x + 8) = 40 years.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 6. One year ago, the ratio of Gaurav’s and Sachin’s age was 6: 7 respectively.&lt;br /&gt;Four years hence, this ratio would become 7: 8. How old is Sa chin ?&lt;br /&gt; (NABARD, 2002)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sol:&lt;br /&gt;. Let Gaurav's and Sachin's ages one year ago be 6x and 7x years respectively. Then, Gaurav's age &lt;br /&gt;  4 years hence = (6x + 1) + 4 = (6x + 5) years.&lt;br /&gt;Sachin's age 4 years hence = (7x + 1) + 4 = (7x + 5) years.&lt;br /&gt;&lt;br /&gt;6x+5  = 7   8(6x+5) = 7 (7x + 5)   48x + 40 = 49x + 35   x = 5.&lt;br /&gt;7x+5     8&lt;br /&gt; Hence, Sachin's present age = (7x + 1) = 36 years.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;,7. Abhay’s age after six years will be three-seventh of his fathers age. Ten years ago the ratio of their ages was 1 : 5. What is Abhay’s father's age at present?&lt;br /&gt; &lt;br /&gt;Sol. Let the ages of Abhay and his father 10 years ago be x and 5x years respectively. Then,&lt;br /&gt; Abhay's age after 6 years = (x + 10) + 6 = (x + 16) years.&lt;br /&gt; Father's age after 6 years = (5x + 10) + 6 = (5x + 16) years.&lt;br /&gt; &lt;br /&gt;\x + 16) =  3 (5x + 16)   7 (x + 16) = 3 (5x + 16)   7x + 112 = 15x + 48&lt;br /&gt;                  7              &lt;br /&gt;                                       8x = 64     x = 8.&lt;br /&gt;Hence, Abhay's father's present age = (5x + 10) = 50 years.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;9. SURDS AND INDICES&lt;br /&gt;&lt;br /&gt;I IMPORTANT FACTS AND FORMULAE I&lt;br /&gt;1. LAWS OF INDICES:&lt;br /&gt;&lt;br /&gt;(i) am x an = am + n&lt;br /&gt;(ii)   am¬ / an = am-n&lt;br /&gt;(iii) (am)n = amn&lt;br /&gt;(iv) (ab)n = anbn&lt;br /&gt;(v)    ( a/ b )n = ( an / bn )&lt;br /&gt;(vi) a0 = 1&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;2. SURDS: Let a be a rational number and n be a positive integer such that a1/n = nsqrt(a)&lt;br /&gt; is irrational. Then nsqrt(a)  is called a surd of order n.&lt;br /&gt;&lt;br /&gt;3. LAWS OF SURDS:&lt;br /&gt;&lt;br /&gt;(i)  n√a = a1/2&lt;br /&gt;(ii) n √ab = n √a * n √b&lt;br /&gt;(iii) n √a/b = n √a  /  n √b&lt;br /&gt;(iv) (n √a)n = a&lt;br /&gt;(v) m√(n√(a)) = mn√(a)&lt;br /&gt;(vi) (n√a)m = n√am&lt;br /&gt;&lt;br /&gt;I SOLVED EXAMPLES &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 1. Simplify : (i) (27)2/3 (ii) (1024)-4/5 (iii)( 8 / 125 )-4/3&lt;br /&gt;&lt;br /&gt;Sol .   (i) (27)2/3 = (33)2/3 = 3( 3 * ( 2/ 3)) = 32 = 9&lt;br /&gt; (ii) (1024)-4/5 = (45)-4/5 = 4 { 5 * ( (-4) / 5 )} = 4-4 = 1 / 44 = 1 / 256&lt;br /&gt; (iii) ( 8 / 125 )-4/3 = {(2/5)3}-4/3 = (2/5){ 3 * ( -4/3)} = ( 2 / 5 )-4 = ( 5 / 2 )4  = 54 / 24 = 625 / 16&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Ex. 2. Evaluate: (i) (.00032)3/5  (ii)l (256)0.16 x (16)0.18.&lt;br /&gt;&lt;br /&gt;Sol.  (i) (0.00032)3/5 = ( 32 / 100000 )3/5. = (25 / 105)3/5  =  {( 2 / 10 )5}3/5 = ( 1 / 5 )(5 * 3 / 5) =  (1/5)3  =   1 / 125&lt;br /&gt; (ii) (256)0. 16 * (16)0. 18 = {(16)2}0. 16 * (16)0. 18 = (16)(2 * 0. 16) * (16)0. 18&lt;br /&gt;    =(16)0.32 * (16)0.18  = (16)(0.32+0.18)  = (16)0.5 = (16)1/2 = 4.&lt;br /&gt;  196&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 3. What is the quotient when (x-1 - 1) is divided by (x - 1) ?&lt;br /&gt;&lt;br /&gt;Sol.     x-1 -1 = (1/x)-1 = _1 -x *   1      = -1&lt;br /&gt; x - 1 x - 1   x (x - 1) x&lt;br /&gt;Hence, the required quotient is    -1/x&lt;br /&gt;&lt;br /&gt;Ex. 4. If 2x - 1 + 2x + 1 = 1280, then find the value of  x.&lt;br /&gt;Sol. 2x - 1 + 2X+ 1 = 1280   2x-1 (1 +22) = 1280&lt;br /&gt;                                              2x-1  =   1280 / 5 = 256 =  28  x -1 = 8  x  =  9.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Hence, x = 9.&lt;br /&gt;Ex. 5. Find the value of [ 5 ( 81/3 + 271/3)3]1/ 4&lt;br /&gt;&lt;br /&gt;Sol. [ 5 ( 81/3 + 271/3)3]1/ 4  =  [ 5 { (23)1/3 + (33)1/3}3]1/ 4 =   [ 5 { (23 * 1/3)1/3 + (33 *1/3 )1/3}3]1/ 4&lt;br /&gt;    = {5(2+3)3}1/4 = (5 * 53)1/ 4 =5(4 * 1/ 4)  = 51 = 5.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 6. Find the Value of {(16)3/2 + (16)-3/2}&lt;br /&gt;&lt;br /&gt;Sol. [(16)3/2 +(16)-3/2 = (42)3/2 +(42)-3/2 = 4(2 * 3/2) + 4{ 2* (-3/2)}&lt;br /&gt; = 43 + 4-3 = 43 + (1/43) = ( 64 + ( 1/64)) = 4097/64.&lt;br /&gt;&lt;br /&gt;Ex. 7. If (1/5)3y = 0.008, then find the value of(0.25)y.&lt;br /&gt;&lt;br /&gt;Sol. (1/5)3y = 0.008 =  8/1000 =  1/125 = (1/5)3  3y = 3  Y = 1.&lt;br /&gt;  (0.25)y = (0.25)1 = 0.25.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 8. Find the value of     (243)n/5  32n + 1&lt;br /&gt;                                             9n  3n -1 .&lt;br /&gt;&lt;br /&gt;Sol. (243)n/5 x32n+l   =   3 (5 * n/5)  32n+l _ = 3n  32n+1&lt;br /&gt;       (32)n  3n - 1          32n  3n - 1                 32n  3n-l&lt;br /&gt;&lt;br /&gt;                                    = 3n + (2n + 1)   =   3(3n+1)   =  3(3n+l)-(3n-l) = 32 = 9.&lt;br /&gt;                                          32n+n-1           3(3n-1) &lt;br /&gt;&lt;br /&gt;Ex. 9. Find the value Of (21/4-1)(23/4+21/2+21/4+1)&lt;br /&gt;&lt;br /&gt;Sol.&lt;br /&gt; Putting 21/4 = x, we get : &lt;br /&gt;&lt;br /&gt; (21/4-1) (23/4+21/2+21/4+1)=(x-1)(x3+x2+x+1) , where x = 21/4&lt;br /&gt;         =(x-1)[x2(x+1)+(x+1)]&lt;br /&gt;         =(x-1)(x+1)(x2+1) = (x2-1)(x2+1)&lt;br /&gt;         =(x4-1) = [(21/4)4-1] = [2(1/4*4) –1] = (2-1) = 1.&lt;br /&gt; &lt;br /&gt;Ex. 10. Find the value of   62/3   3√67&lt;br /&gt;     3√66&lt;br /&gt;&lt;br /&gt;Sol.       62/3   3√67   =  62/3   (67)1/3   =  62/3    6(7 * 1/3)  =   62/3    6(7/3)&lt;br /&gt;        3√66                 (66)1/3                  6(6 * 1/3)                    62&lt;br /&gt;&lt;br /&gt;    =62/3  6((7/3)-2) = 62/3  61/3  = 61 = 6.&lt;br /&gt;Ex. 11. If x= ya, y=zb and z=xc,then find the value of abc.&lt;br /&gt;&lt;br /&gt;Sol.    z1= xc =(ya)c [since x= ya]&lt;br /&gt;   =y(ac) = (zb)ac [since y=zb]&lt;br /&gt;   =zb(ac)= zabc&lt;br /&gt;   abc = 1. &lt;br /&gt; = 24 &lt;br /&gt; Ex. 12. Simplify [(xa / xb)^(a2+b2+ab)] * [(xb / xc )^ b2+c2+bc)] * [(xc/xa)^(c2+a2+ca)] &lt;br /&gt;Sol.&lt;br /&gt; Given Expression &lt;br /&gt;= [{x(o - b)}^(a2 + b2 + ob)].['(x(b - c)}^ (b2 + c2 + bc)].['(x(c - a)}^(c2 + a2 + ca])&lt;br /&gt;= [x(a - b)(a2 + b2 + ab) . x(b - c) (b2 +c2+ bc).x(c- a) (c2 + a2 + ca)]&lt;br /&gt;= [x^(a3-b3)].[x^(b3-e3)].[x^(c3-a3)] = x^(a3-b3+b3-c3+c3-a3) = x0 = 1.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 13. Which is larger √2 or 3√3 ?&lt;br /&gt;&lt;br /&gt;Sol. Given surds are of order 2 and 3. Their L.C.M. is 6. Changing each to a surd of order 6, we get:&lt;br /&gt;  √2 = 21/2 = 2((1/2)*(3/2)) =23/6 =  81/6 = 6√8&lt;br /&gt; 3√3= 31/3 = 3((1/3)*(2/2)) = 32/6 = (32)1/6 = (9)1/6 = 6√9.&lt;br /&gt;Clearly, 6√9 &gt; 6√8 and hence 3√3  &gt; √2.&lt;br /&gt;&lt;br /&gt;Ex. 14. Find the largest from among 4√6, √2 and 3√4.&lt;br /&gt;Sol. Given surds are of order 4, 2 and 3 respectively. Their L.C,M, is 12, Changing each to a surd of order 12, we get:&lt;br /&gt;&lt;br /&gt;4√6 = 61/4 = 6((1/4)*(3/3)) = 63/12 = (63)1/12  = (216)1/12.&lt;br /&gt;√2 = 21/2 = 2((1/2)*(6/6)) = 26/12 = (26)1/12  = (64)1/12.&lt;br /&gt;3√4 = 41/3 = 4((1/3)*(4/4))  =  44/12  = (44)1/12 = (256)1/12.&lt;br /&gt;&lt;br /&gt;Clearly, (256)1/12  &gt;  (216)1/12  &gt;  (64)1/12&lt;br /&gt;&lt;br /&gt;Largest one is (256)1/12.  i.e. 3√4 .  &lt;br /&gt;.&lt;br /&gt;10.PERCENTAGE&lt;br /&gt;&lt;br /&gt;IMPORTANT FACTS AND FORMULAE&lt;br /&gt;&lt;br /&gt;1. Concept of Percentage : By a certain percent ,we mean that many hundredths. Thus x percent means x hundredths, written as x%.&lt;br /&gt;&lt;br /&gt;To express x% as a fraction : We have , x% = x/100.&lt;br /&gt;&lt;br /&gt;Thus, 20% =20/100 =1/5; 48% =48/100 =12/25, etc.&lt;br /&gt;&lt;br /&gt;To express a/b as a percent : We have, a/b =((a/b)*100)%.&lt;br /&gt;&lt;br /&gt;Thus, ¼ =[(1/4)*100] = 25%; 0.6 =6/10 =3/5 =[(3/5)*100]% =60%.&lt;br /&gt;&lt;br /&gt;             &lt;br /&gt;2. If the price of a commodity increases by R%, then the reduction in consumption so asnot to increase the expenditure is&lt;br /&gt;[R/(100+R))*100]%.&lt;br /&gt;If the price of the commodity decreases by R%,then the increase in consumption so as to decrease the      expenditure is &lt;br /&gt;   [(R/(100-R)*100]%.&lt;br /&gt;&lt;br /&gt;3.    Results on Population : Let the population of the town be P now and suppose it increases at the rate of    &lt;br /&gt;       R% per annum, then : &lt;br /&gt;&lt;br /&gt;1. Population after nyeras = P [1+(R/100)]^n.&lt;br /&gt;2. Population n years ago = P /[1+(R/100)]^n.&lt;br /&gt;&lt;br /&gt;4.    Results on Depreciation :  Let the present value of a machine be P. Suppose  it depreciates  at the rate &lt;br /&gt;       R% per annum. Then,&lt;br /&gt;     &lt;br /&gt;1. Value of the machine after n years = P[1-(R/100)]n.&lt;br /&gt;2. Value of the machine n years ago = P/[1-(R/100)]n.&lt;br /&gt;&lt;br /&gt;5. If A is R% more than B, then B is less than A by&lt;br /&gt;&lt;br /&gt;   [(R/(100+R))*100]%.&lt;br /&gt;     &lt;br /&gt;        If  A is R% less than B , then B is more than A by&lt;br /&gt;&lt;br /&gt;   [(R/(100-R))*100]%.&lt;br /&gt;&lt;br /&gt;SOLVED EXAMPLES&lt;br /&gt;&lt;br /&gt;Ex. 1. Express each of the following as a fraction :&lt;br /&gt;&lt;br /&gt;(i) 56%  (ii) 4%  (iii) 0.6%  (iv) 0.008%&lt;br /&gt;&lt;br /&gt;sol.  (i) 56% = 56/100= 14/25. (ii) 4% =4/100 =1/25.&lt;br /&gt;        (iii) 0.6 =6/1000 = 3/500. (iv) 0.008 = 8/100 = 1/1250.&lt;br /&gt;&lt;br /&gt;Ex. 2. Express each of the following as a Decimal :&lt;br /&gt;&lt;br /&gt;(i) 6%   (ii)28%   (iii) 0.2%  (iv) 0.04%&lt;br /&gt;&lt;br /&gt;Sol.  (i) 6% = 6/100 =0.06.  (ii) 28% = 28/100 =0.28.&lt;br /&gt;         (iii) 0.2% =0.2/100 = 0.002. (iv) 0.04%= 0.04/100 =0.004.&lt;br /&gt;&lt;br /&gt;Ex. 3. Express each of the following as rate percent :&lt;br /&gt;&lt;br /&gt;(i) 23/36  (ii) 6 ¾  (iii) 0.004&lt;br /&gt;&lt;br /&gt;Sol.  (i) 23/36 = [(23/36)*100]% = [575/9]% = 63 8/9%.&lt;br /&gt;&lt;br /&gt;         (ii) 0.004 = [(4/1000)*100]% = 0.4%.&lt;br /&gt;&lt;br /&gt;         (iii) 6 ¾ =27/4 =[(27/4)*100]% = 675%.&lt;br /&gt;&lt;br /&gt;Ex. 4. Evaluate :&lt;br /&gt;&lt;br /&gt;(i) 28% of 450+ 45% of  280&lt;br /&gt;(ii) 16 2/3% of 600 gm- 33 1/3% of 180 gm&lt;br /&gt;&lt;br /&gt;Sol. (i) 28% of 450 + 45%  of 280 =[(28/100)*450 + (45/100)*280] = (126+126) =252.&lt;br /&gt;&lt;br /&gt;(iii) 16 2/3% of 600 gm –33 1/3% of 180 gm = [  ((50/3)*(1/100)*600) – ((100/3)*(1/3)*280)]gm = (100-60) gm = 40gm.&lt;br /&gt;&lt;br /&gt;Ex. 5. &lt;br /&gt;(i) 2 is what percent of 50 ?&lt;br /&gt;(ii) ½ is what percent of 1/3 ?&lt;br /&gt;(iii)What percent of 8 is 64 ?&lt;br /&gt;(iv)What percent of 2 metric tones is 40 quintals ?&lt;br /&gt;(v)What percent of 6.5 litres is 130 ml?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sol.&lt;br /&gt;&lt;br /&gt;(i) Required Percentage   = [(2/50)*100]% = 4%.&lt;br /&gt;&lt;br /&gt;(ii) Required Percentage = [ (1/2)*(3/1)*100]% = 150%.&lt;br /&gt;&lt;br /&gt;(iii)Required Percentage = [(84/7)*100]% = 1200%.&lt;br /&gt;&lt;br /&gt;(iv) 1 metric tonne = 10 quintals.&lt;br /&gt;&lt;br /&gt;Required percentage = [ (40/(2 * 10)) * 100]% = 200%.&lt;br /&gt;&lt;br /&gt;(v) Required Percentage  = [ (130/(6.5 * 1000)) * 100]% = 2%.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex. 6. &lt;br /&gt;Find the missing figures :&lt;br /&gt;&lt;br /&gt;(i) ?% of 25 = 20125 (ii) 9% of ? = 63  (iii) 0.25% of ? = 0.04&lt;br /&gt;&lt;br /&gt;Sol.  &lt;br /&gt;&lt;br /&gt;(i) Let x% of 25 = 2.125. Then , (x/100)*25 = 2.125&lt;br /&gt;                    X = (2.125 * 4) = 8.5.&lt;br /&gt;&lt;br /&gt;(ii) Let 9% of x =6.3. Then , 9*x/100 = 6.3&lt;br /&gt;        X = [(6.3*100)/9] =70.&lt;br /&gt;&lt;br /&gt;(iii) Let 0.25% of x = 0.04. Then , 0.25*x/100 = 0.04&lt;br /&gt;      X= [(0.04*100)/0.25] = 16.     &lt;br /&gt;&lt;br /&gt;Ex. 7.&lt;br /&gt;Which is greatest in  16  ( 2/3) %, 2/5 and 0.17 ?&lt;br /&gt;&lt;br /&gt;Sol. 16 (2/3)% =[ (50/3)* )1/100)] = 1/6 = 0.166, 2/15 = 0.133. Clearly, 0.17 is the greatest.&lt;br /&gt;&lt;br /&gt;Ex. 8.&lt;br /&gt;If the sales tax  reduced from  3 1/2 % to  3 1/3%, then what difference does it make to a person who purchases an article with market price of Rs. 8400 ?&lt;br /&gt;&lt;br /&gt;Sol.   Required difference = [3 ½ % of Rs.8400] – [3 1/3 % of Rs.8400]&lt;br /&gt;                                          = [(7/20-(10/3)]% of Rs.8400 =1/6 % of Rs.8400&lt;br /&gt;               = Rs. [(1/6)8(1/100)*8400] =  Rs. 14.&lt;br /&gt;&lt;br /&gt;Ex. 9. An inspector rejects 0.08% of the meters as defective. How many will be examine to project ?&lt;br /&gt;&lt;br /&gt;Sol.  Let the number of meters to be examined be x.&lt;br /&gt;Then, 0.08% of x =2&lt;br /&gt;[(8/100)*(1/100)*x] = 2&lt;br /&gt;x = [(2*100*100)/8] = 2500.  &lt;br /&gt;&lt;br /&gt;Ex. 10. Sixty five percent of a number is 21 less than four fifth of that number. What is the number ?&lt;br /&gt;&lt;br /&gt;Sol.  Let the number be x.&lt;br /&gt;Then, 4*x/5 –(65% of x) = 21&lt;br /&gt;4x/5 –65x/100 = 21&lt;br /&gt;5 x = 2100&lt;br /&gt;x = 140.&lt;br /&gt;&lt;br /&gt;Ex.11. Difference of two numbers is 1660. If 7.5% of the number is 12.5% of the other number , find the number ?&lt;br /&gt;Sol.  Let the numbers be x and y. Then , 7.5 % of x =12.5% of y&lt;br /&gt;X = 125*y/75 = 5*y/3.&lt;br /&gt;Now, x-y =1660 &lt;br /&gt;5*y/3 –y =1660&lt;br /&gt;2*y/3= 1660&lt;br /&gt;y =[ (1660*3)/2] =2490.&lt;br /&gt;One number = 2490, Second number =5*y/3 =4150.&lt;br /&gt;&lt;br /&gt;Ex. 12.&lt;br /&gt;In expressing a length 810472 km as nearly as possible with three significant digits , find the percentage error.&lt;br /&gt;Sol.  Error = (81.5 – 81.472)km = 0.028.&lt;br /&gt;  Required percentage = [(0.028/81.472)*100]% = 0.034%.&lt;br /&gt;&lt;br /&gt;Ex. 13. &lt;br /&gt;In an election between two candidates, 75% of the voters cast thier thier votes, out of which 2% of the votes were declared invalid. A candidate got 9261 votes which were 75% of the total valid votes. Find the total number of votes enrolled in that election.&lt;br /&gt;Sol.&lt;br /&gt; Let the number of votes enrolled be x. Then ,&lt;br /&gt;Number of votes cast =75% of x. Valid votes = 98% of (75% of x).&lt;br /&gt;75% of  (98% of (75%of x)) =9261.&lt;br /&gt;[(75/100)*(98/100)*(75/100)*x] =9261.&lt;br /&gt;X = [(9261*100*100*100)/(75*98*75)] =16800.&lt;br /&gt;&lt;br /&gt;Ex.14. Shobha’s mathematics test had 75 problems i.e.10 arithmetic, 30 algebra and 35 geometry problems. Although she answered 70% of the arithmetic ,40% of the algebra, and 60% of the geometry problems correctly.  she did not pass the test because she got less than  60% of the problems right. How many more questions she would have to answer correctly to earn 60% of the passing grade?&lt;br /&gt;         &lt;br /&gt;Sol. Number  of questions attempted correctly=(70% of 10 + 40% of 30 + 60% 0f 35)&lt;br /&gt;                                                                          =7 + 12+21= 45&lt;br /&gt;questions to be answered correctly for 60% grade=60% of 75 = 45&lt;br /&gt;&lt;br /&gt;therefore required number of questions= (45-40) = 5.&lt;br /&gt;&lt;br /&gt;Ex.15. if 50% of (x-y) = 30% of (x+y) then what percent of x is y?&lt;br /&gt;&lt;br /&gt;Sol.50% of (x-y)=30% of(x+y)  (50/100)(x-y)=(30/100)(x+y)&lt;br /&gt;        5(x-y)=3(x+y)  2x=8y  x=4y&lt;br /&gt;              therefore required percentage =((y/x) X 100)% = ((y/4y) X 100) =25%&lt;br /&gt;&lt;br /&gt;Ex.16. Mr.Jones gave 40% of the money he had to his wife. he also gave 20% of the remaining amount to his 3 sons. half of the amount now left was spent on miscellaneous items and the remaining amount of Rs.12000 was deposited in the bank. how much money did Mr.jones have initially? &lt;br /&gt; &lt;br /&gt;Sol. Let the initial amount with Mr.jones be Rs.x then,&lt;br /&gt;       Money given to wife= Rs.(40/100)x=Rs.2x/5.Balance=Rs(x-(2x/5)=Rs.3x/5.&lt;br /&gt;       Money given to 3 sons= Rs(3X((20/200) X (3x/5)) = Rs.9x/5.&lt;br /&gt;       Balance = Rs.((3x/5) – (9x/25))=Rs.6x/25.&lt;br /&gt;      Amount deposited in bank= Rs(1/2 X 6x/25)=Rs.3x/25.&lt;br /&gt;&lt;br /&gt;      Therefore 3x/25=12000  x= ((12000 x 35)/3)=100000&lt;br /&gt;       &lt;br /&gt;      So Mr.Jones initially had Rs.1,00,000 with him.&lt;br /&gt;&lt;br /&gt;Short-cut Method : Let the initial amount with Mr.Jones be Rs.x&lt;br /&gt;Then,(1/2)[100-(3*20)]% of x=12000&lt;br /&gt;&lt;br /&gt; (1/2)*(40/100)*(60/100)*x=12000&lt;br /&gt;x=((12000*25)/3)=100000&lt;br /&gt;&lt;br /&gt;Ex 17 10% of the inhabitants of village having died of cholera.,a panic set in , during which 25% of the remaining inhabitants left the village. The population is then reduced to 4050. Find the number of original inhabitants.&lt;br /&gt;Sol:&lt;br /&gt;Let the total number of orginal inhabitants be x.&lt;br /&gt;((75/100))*(90/100)*x)=4050  (27/40)*x=4050&lt;br /&gt;&lt;br /&gt;x=((4050*40)/27)=6000.&lt;br /&gt;&lt;br /&gt;Ex.18 A salesman`s commission is 5% on all sales upto Rs.10,000 and 4% on all sales exceeding this.He remits Rs.31,100 to his parent company after deducing his commission . Find the total sales.&lt;br /&gt;Sol:&lt;br /&gt;Let his total sales be Rs.x.Now(Total sales) – (Commission )=Rs.31,100&lt;br /&gt;  x-[(5% of 10000 + 4% of (x-10000)]=31,100&lt;br /&gt;x-[((5/100)*10000 + (4/100)*(x-10000)]=31,100&lt;br /&gt;x-500-((x-10000)/25)=31,100&lt;br /&gt;x-(x/25)=31200  24x/25=31200x=[(31200*25)/24)=32,500.&lt;br /&gt;Total sales=Rs.32,500&lt;br /&gt;&lt;br /&gt;Ex .19 Raman`s salary was decreased by 50% and subsequently increased by 50%.How much percent does he lose?&lt;br /&gt;Sol:&lt;br /&gt;Let the original salary = Rs.100&lt;br /&gt;New final salary=150% of  (50% of Rs.100)=&lt;br /&gt;Rs.((150/100)*(50/100)*100)=Rs.75.&lt;br /&gt;Decrease = 25%&lt;br /&gt;&lt;br /&gt;Ex.20 Paulson spends 75% of his income. His income is increased by 20% and he increased his expenditure by 10%.Find the percentage increase in his savings .&lt;br /&gt;Sol:&lt;br /&gt;Let the original income=Rs.100 . Then , expenditure=Rs.75 and savings =Rs.25&lt;br /&gt;New income =Rs.120 , New expenditure =&lt;br /&gt;Rs.((110/100)*75)=Rs.165/2&lt;br /&gt;New savings = Rs.(120-(165/2)) =  Rs.75/2&lt;br /&gt;Increase in savings = Rs.((75/2)-25)=Rs.25/2&lt;br /&gt;Increase %= ((25/2)*(1/25)*100)% = 50%.&lt;br /&gt;&lt;br /&gt;Ex21. The salary of a person was reduced by 10% .By what percent should his reduced salary be raised so as to bring it at par with his original salary ?&lt;br /&gt;Sol:&lt;br /&gt;Let the original salary be Rs.100 . New salary = Rs.90.&lt;br /&gt;Increase on 90=10 , Increase on 100=((10/90)*100)%&lt;br /&gt;= (100/9)%&lt;br /&gt;&lt;br /&gt;Ex.22 When the price fo a product was decreased by 10% , the number sold increased by 30%. What was the effect on the total revenue ?&lt;br /&gt;Sol:&lt;br /&gt;Let the price of the product be Rs.100 and let original sale be 100 pieces.&lt;br /&gt;Then , Total Revenue = Rs.(100*100)=Rs.10000.&lt;br /&gt;New revenue = Rs.(90*130)=Rs.11700.&lt;br /&gt;Increase in revenue = ((1700/10000)*100)%=17%.&lt;br /&gt;&lt;br /&gt;Ex 23 . If the numerator of a fraction be increased by 15% and its denominator be diminished by 8% , the value of the fraction is 15/16. Find the original fraction.&lt;br /&gt;Sol:&lt;br /&gt;Let the original fraction be x/y.&lt;br /&gt;Then (115%of x)/(92% of y)=15/16 =&gt; (115x/92y)=15/16&lt;br /&gt; ((15/16)*(92/115))=3/4&lt;br /&gt;&lt;br /&gt;Ex.24 In the new budget , the price of kerosene oil rose by 25%. By how much percent must a person reduce his consumption so that his expenditure  on it does not increase ?&lt;br /&gt;Sol:&lt;br /&gt;Reduction  in consumption = [((R/(100+R))*100]%&lt;br /&gt; [(25/125)*100]%=20%.&lt;br /&gt;&lt;br /&gt;Ex.25 The population of a town is 1,76,400 . If it increases at the rate of 5% per annum , what will be its population 2 years hence ? What was it 2 years ago ?&lt;br /&gt;Sol:&lt;br /&gt;Population after 2 years = 176400*[1+(5/100)]^2&lt;br /&gt;=[176400*(21/20)*(21/40)]&lt;br /&gt;= 194481.&lt;br /&gt;Population 2 years ago = 176400/[1+(5/100)]^2&lt;br /&gt;=[716400*(20/21)*(20/21)]= 160000.&lt;br /&gt;&lt;br /&gt;Ex.26 The value of a machine depreiates at the rate of 10% per annum. If its present is Rs.1,62,000 what will be its worth after 2 years ? What was the value of the machine 2 years ago ?&lt;br /&gt;Sol.&lt;br /&gt;Value of the machine after 2 years &lt;br /&gt;=Rs.[162000*(1-(10/100))^2] = Rs.[162000*(9/10)*(9/10)]&lt;br /&gt;=Rs. 131220&lt;br /&gt;Value of the machine 2 years ago &lt;br /&gt;= Rs.[162000/(1-(10/100)^2)]=Rs.[162000*(10/9)*(10/9)]=Rs.200000&lt;br /&gt;&lt;br /&gt;Ex27. During one year, the population of town increased by 5% . If the total population is 9975 at the end of the second year , then what was the population size in the beginning of the first year ?&lt;br /&gt;Sol:&lt;br /&gt;Population in the beginning of the first year&lt;br /&gt;= 9975/[1+(5/100)]*[1-(5/100)] = [9975*(20/21)*(20/19)]=10000.&lt;br /&gt;&lt;br /&gt;Ex.28 If A earns 99/3% more than B,how much percent does B earn less then A ?&lt;br /&gt;Sol:&lt;br /&gt;Required Percentage = [((100/3)*100)/[100+(100/3)]]%&lt;br /&gt;=[(100/400)*100]%=25%&lt;br /&gt;&lt;br /&gt;Ex. 29 If  A`s salary is 20% less then B`s salary , by how much percent is B`s salary more than A`s ?&lt;br /&gt;Sol:&lt;br /&gt;Required percentage = [(20*100)/(100-20)]%=25%.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ex30 .How many kg of pure salt must be added to 30kg of 2% solution of salt and water to increase it to 10% solution ?&lt;br /&gt;Sol:&lt;br /&gt;Amount of salt in 30kg solution = [(20/100)*30]kg=0.6kg&lt;br /&gt;Let x kg of pure salt be added &lt;br /&gt;Then , (0.6+x)/(30+x)=10/10060+100x=300+10x&lt;br /&gt;90x=240  x=8/3.&lt;br /&gt;&lt;br /&gt;Ex 31. Due to reduction of 25/4% in the price of sugar , a man is able to buy 1kg more for Rs.120. Find the original and reduced rate of sugar.&lt;br /&gt;Sol:&lt;br /&gt;Let the original rate be Rs.x per kg.&lt;br /&gt;Reduced rate = Rs.[(100-(25/4))*(1/100)*x}]=Rs.15x/16per kg&lt;br /&gt;120/(15x/16)-(120/x)=1  (128/x)-(120/x)=1&lt;br /&gt; x=8.&lt;br /&gt;So, the original rate = Rs.8 per kg&lt;br /&gt;Reduce rate = Rs.[(15/16)*8]per kg =  Rs.7.50 per kg&lt;br /&gt;&lt;br /&gt;Ex.32 In an examination , 35% of total students failed in Hindi , 45% failed in English and 20% in both . Find the percentage of those who passed in both subjects .&lt;br /&gt;Sol:&lt;br /&gt;Let A and B be the sets of students who failed in Hindi and English respectively . &lt;br /&gt;Then , n(A) = 35 , n(B)=45 , n(AB)=20.&lt;br /&gt;So , n(AB)=n(A)+n(B)- n(AB)=35+45-20=60.&lt;br /&gt;Percentage failed in Hindi and English or both=60%&lt;br /&gt;Hence , percentage passed = (100-60)%=40%&lt;br /&gt;&lt;br /&gt;Ex33. In an examination , 80% of the students passed in English , 85% in Mathematics and 75% in both English and Mathematics. If 40 students failed in both the subjects , find the total number of students.&lt;br /&gt;Sol:&lt;br /&gt;Let the total number of students be x .&lt;br /&gt;Let A and B represent the sets of students who passed in English and Mathematics respectively . &lt;br /&gt;Then , number of students passed in one or both the subjects &lt;br /&gt;= n(AB)=n(A)+n(B)- n(AB)=80% of x + 85% of x –75% of x&lt;br /&gt;=[(80/100)x+(85/100)x-(75/100)x]=(90/100)x=(9/10)x&lt;br /&gt;Students who failed in both the subjects = [x-(9x/10)]=x/10.&lt;br /&gt;So, x/10=40 of x=400 .&lt;br /&gt;Hence ,total number of students = 400.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-3523352093559879923?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/3523352093559879923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/apptitude-quesitions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/3523352093559879923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/3523352093559879923'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/apptitude-quesitions.html' title='apptitude quesitions'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-3860957554519580834</id><published>2010-08-14T01:35:00.000-07:00</published><updated>2010-08-14T01:35:22.110-07:00</updated><title type='text'>uml tutorial</title><content type='html'>&lt;a href="http://atlas.kennesaw.edu/~dbraun/csis4650/A&amp;D/UML_tutorial/diagrams.htm"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-3860957554519580834?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/3860957554519580834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/uml-tutorial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/3860957554519580834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/3860957554519580834'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/uml-tutorial.html' title='uml tutorial'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-2037232041138304137</id><published>2010-08-14T01:30:00.001-07:00</published><updated>2010-08-14T01:30:20.248-07:00</updated><title type='text'>ans for c</title><content type='html'>What is C language?&lt;br /&gt;The C programming language is a standardized programming language&lt;br /&gt;developed in the early 1970s by Ken Thompson and Dennis Ritchie for&lt;br /&gt;use on the UNIX operating system. It has since spread to many other&lt;br /&gt;operating systems, and is one of the most widely used programming&lt;br /&gt;languages. C is prized for its efficiency, and is the most popular&lt;br /&gt;programming language for writing system software, though it is also&lt;br /&gt;used for writing applications.&lt;br /&gt;printf() Function&lt;br /&gt;What is the output of printf("%d")?&lt;br /&gt;1. When we write printf("%d",x); this means compiler will print the&lt;br /&gt;value of x. But as here, there is nothing after %d so compiler will show&lt;br /&gt;in output window garbage value.&lt;br /&gt;2. When we use %d the compiler internally uses it to access the&lt;br /&gt;argument in the stack (argument stack). Ideally compiler determines&lt;br /&gt;the offset of the data variable depending on the format specification&lt;br /&gt;string. Now when we write printf("%d",a) then compiler first accesses&lt;br /&gt;the top most element in the argument stack of the printf which is %d&lt;br /&gt;and depending on the format string it calculated to offset to the actual&lt;br /&gt;data variable in the memory which is to be printed. Now when only %d&lt;br /&gt;will be present in the printf then compiler will calculate the correct&lt;br /&gt;offset (which will be the offset to access the integer variable) but as&lt;br /&gt;the actual data object is to be printed is not present at that memory&lt;br /&gt;location so it will print what ever will be the contents of that memory&lt;br /&gt;location.&lt;br /&gt;3. Some compilers check the format string and will generate an error&lt;br /&gt;without the proper number and type of arguments for things like&lt;br /&gt;printf(...) and scanf(...).&lt;br /&gt;Visit http://TechPreparation.com for more Interview Questions with Answers Page 2&lt;br /&gt;malloc() Function- What is the difference between "calloc(...)" and&lt;br /&gt;"malloc(...)"?&lt;br /&gt;1. calloc(...) allocates a block of memory for an array of elements of a&lt;br /&gt;certain size. By default the block is initialized to 0. The total number of&lt;br /&gt;memory allocated will be (number_of_elements * size).&lt;br /&gt;malloc(...) takes in only a single argument which is the memory&lt;br /&gt;required in bytes. malloc(...) allocated bytes of memory and not blocks&lt;br /&gt;of memory like calloc(...).&lt;br /&gt;2. malloc(...) allocates memory blocks and returns a void pointer to the&lt;br /&gt;allocated space, or NULL if there is insufficient memory available.&lt;br /&gt;calloc(...) allocates an array in memory with elements initialized to 0&lt;br /&gt;and returns a pointer to the allocated space. calloc(...) calls malloc(...)&lt;br /&gt;in order to use the C++ _set_new_mode function to set the new&lt;br /&gt;handler mode.&lt;br /&gt;printf() Function- What is the difference between "printf(...)" and&lt;br /&gt;"sprintf(...)"?&lt;br /&gt;sprintf(...) writes data to the character array whereas printf(...) writes data to the&lt;br /&gt;standard output device.&lt;br /&gt;Compilation How to reduce a final size of executable?&lt;br /&gt;Size of the final executable can be reduced using dynamic linking for&lt;br /&gt;libraries.&lt;br /&gt;Linked Lists -- Can you tell me how to check whether a linked list is circular?&lt;br /&gt;Create two pointers, and set both to the start of the list. Update each&lt;br /&gt;as follows:&lt;br /&gt;while (pointer1) {&lt;br /&gt;pointer1 = pointer1-&gt;next;&lt;br /&gt;pointer2 = pointer2-&gt;next;&lt;br /&gt;if (pointer2) pointer2=pointer2-&gt;next;&lt;br /&gt;if (pointer1 == pointer2) {&lt;br /&gt;print ("circular");&lt;br /&gt;}}&lt;br /&gt;Visit http://TechPreparation.com for more Interview Questions with Answers Page 3&lt;br /&gt;If a list is circular, at some point pointer2 will wrap around and be&lt;br /&gt;either at the item just before pointer1, or the item before that. Either&lt;br /&gt;way, its either 1 or 2 jumps until they meet.&lt;br /&gt;"union" Data Type What is the output of the following program? Why?&lt;br /&gt;#include&lt;br /&gt;main() {&lt;br /&gt;typedef union {&lt;br /&gt;int a;&lt;br /&gt;char b[10];&lt;br /&gt;float c;&lt;br /&gt;}&lt;br /&gt;Union;&lt;br /&gt;Union x,y = {100};&lt;br /&gt;x.a = 50;&lt;br /&gt;strcpy(x.b,"hello");&lt;br /&gt;x.c = 21.50;&lt;br /&gt;printf("Union x : %d %s %f n",x.a,x.b,x.c);&lt;br /&gt;printf("Union y : %d %s %f n",y.a,y.b,y.c);&lt;br /&gt;}&lt;br /&gt;What does static variable mean?&lt;br /&gt;there are 3 main uses for the static.&lt;br /&gt;1. If you declare within a function:&lt;br /&gt;It retains the value between function calls&lt;br /&gt;2.If it is declared for a function name:&lt;br /&gt;By default function is extern..so it will be visible from other files if the&lt;br /&gt;function declaration is as static..it is invisible for the outer files&lt;br /&gt;3. Static for global variables:&lt;br /&gt;By default we can use the global variables from outside files If it is&lt;br /&gt;static global..that variable is limited to with in the file&lt;br /&gt;Advantages of a macro over a function?&lt;br /&gt;Macro gets to see the Compilation environment, so it can expand __&lt;br /&gt;__TIME__ __FILE__ #defines. It is expanded by the preprocessor.&lt;br /&gt;Visit http://TechPreparation.com for more Interview Questions with Answers Page 4&lt;br /&gt;For example, you can’t do this without macros&lt;br /&gt;#define PRINT(EXPR) printf( #EXPR “=%d\n”, EXPR)&lt;br /&gt;PRINT( 5+6*7 ) // expands into printf(”5+6*7=%d”, 5+6*7 );&lt;br /&gt;You can define your mini language with macros:&lt;br /&gt;#define strequal(A,B) (!strcmp(A,B))&lt;br /&gt;Macros are a necessary evils of life. The purists don’t like them, but&lt;br /&gt;without it no real work gets done.&lt;br /&gt;What are the differences between malloc() and calloc()?&lt;br /&gt;There are 2 differences.&lt;br /&gt;First, is in the number of arguments. malloc() takes a single&lt;br /&gt;argument(memory required in bytes), while calloc() needs 2&lt;br /&gt;arguments(number of variables to allocate memory, size in bytes of a&lt;br /&gt;single variable).&lt;br /&gt;Secondly, malloc() does not initialize the memory allocated, while&lt;br /&gt;calloc() initializes the allocated memory to ZERO.&lt;br /&gt;What are the different storage classes in C?&lt;br /&gt;C has three types of storage: automatic, static and allocated.&lt;br /&gt;Variable having block scope and without static specifier have&lt;br /&gt;automatic storage duration.&lt;br /&gt;Variables with block scope, and with static specifier have static scope.&lt;br /&gt;Global variables (i.e, file scope) with or without the static specifier also&lt;br /&gt;have static scope.&lt;br /&gt;Memory obtained from calls to malloc(), alloc() or realloc() belongs to&lt;br /&gt;allocated storage class.&lt;br /&gt;What is the difference between strings and character arrays?&lt;br /&gt;A major difference is: string will have static storage duration, whereas&lt;br /&gt;as a character array will not, unless it is explicity specified by using the&lt;br /&gt;static keyword.&lt;br /&gt;Actually, a string is a character array with following properties:&lt;br /&gt;Visit http://TechPreparation.com for more Interview Questions with Answers Page 5&lt;br /&gt;* the multibyte character sequence, to which we generally call string,&lt;br /&gt;is used to initialize an array of static storage duration. The size of this&lt;br /&gt;array is just sufficient to contain these characters plus the terminating&lt;br /&gt;NUL character.&lt;br /&gt;* it not specified what happens if this array, i.e., string, is modified.&lt;br /&gt;* Two strings of same value[1] may share same memory area. For&lt;br /&gt;example, in the following declarations:&lt;br /&gt;char *s1 = “Calvin and Hobbes”;&lt;br /&gt;char *s2 = “Calvin and Hobbes”;&lt;br /&gt;the strings pointed by s1 and s2 may reside in the same memory&lt;br /&gt;location. But, it is not true for the following:&lt;br /&gt;char ca1[] = “Calvin and Hobbes”;&lt;br /&gt;char ca2[] = “Calvin and Hobbes”;&lt;br /&gt;[1] The value of a string is the sequence of the values of the contained&lt;br /&gt;characters, in order.&lt;br /&gt;Difference between const char* p and char const* p&lt;br /&gt;In const char* p, the character pointed by ‘p’ is constant, so u cant&lt;br /&gt;change the value of character pointed by p but u can make ‘p’ refer to&lt;br /&gt;some other location.&lt;br /&gt;in char const* p, the ptr ‘p’ is constant not the character referenced by&lt;br /&gt;it, so u cant make ‘p’ to reference to any other location but u can&lt;br /&gt;change the value of the char pointed by ‘p’.&lt;br /&gt;What is hashing?&lt;br /&gt;To hash means to grind up, and that’s essentially what hashing is all&lt;br /&gt;about. The heart of a hashing algorithm is a hash function that takes&lt;br /&gt;your nice, neat data and grinds it into some random-looking integer.&lt;br /&gt;The idea behind hashing is that some data either has no inherent&lt;br /&gt;ordering (such as images) or is expensive to compare (such as&lt;br /&gt;images). If the data has no inherent ordering, you can’t perform&lt;br /&gt;comparison searches.&lt;br /&gt;If the data is expensive to compare, the number of comparisons used&lt;br /&gt;Visit http://TechPreparation.com for more Interview Questions with Answers Page 6&lt;br /&gt;even by a binary search might be too many. So instead of looking at&lt;br /&gt;the data themselves, you’ll condense (hash) the data to an integer (its&lt;br /&gt;hash value) and keep all the data with the same hash value in the&lt;br /&gt;same place. This task is carried out by using the hash value as an&lt;br /&gt;index into an array.&lt;br /&gt;To search for an item, you simply hash it and look at all the data whose&lt;br /&gt;hash values match that of the data you’re looking for. This technique&lt;br /&gt;greatly lessens the number of items you have to look at. If the&lt;br /&gt;parameters are set up with care and enough storage is available for&lt;br /&gt;the hash table, the number of comparisons needed to find an item can&lt;br /&gt;be made arbitrarily close to one.&lt;br /&gt;One aspect that affects the efficiency of a hashing implementation is&lt;br /&gt;the hash function itself. It should ideally distribute data randomly&lt;br /&gt;throughout the entire hash table, to reduce the likelihood of collisions.&lt;br /&gt;Collisions occur when two different keys have the same hash value.&lt;br /&gt;There are two ways to resolve this problem. In open addressing, the&lt;br /&gt;collision is resolved by the choosing of another position in the hash&lt;br /&gt;table for the element inserted later. When the hash table is searched, if&lt;br /&gt;the entry is not found at its hashed position in the table, the search&lt;br /&gt;continues checking until either the element is found or an empty&lt;br /&gt;position in the table is found.&lt;br /&gt;The second method of resolving a hash collision is called chaining. In&lt;br /&gt;this method, a bucket or linked list holds all the elements whose keys&lt;br /&gt;hash to the same value. When the hash table is searched, the list must&lt;br /&gt;be searched linearly.&lt;br /&gt;How can you determine the size of an allocated portion of memory?&lt;br /&gt;You can’t, really. free() can , but there’s no way for your program to&lt;br /&gt;know the trick free() uses. Even if you disassemble the library and&lt;br /&gt;discover the trick, there’s no guarantee the trick won’t change with the&lt;br /&gt;next release of the compiler.&lt;br /&gt;Can static variables be declared in a header file?&lt;br /&gt;You can’t declare a static variable without defining it as well (this is&lt;br /&gt;because the storage class modifiers static and extern are mutually&lt;br /&gt;exclusive). A static variable can be defined in a header file, but this&lt;br /&gt;would cause each source file that included the header file to have its&lt;br /&gt;Visit http://TechPreparation.com for more Interview Questions with Answers Page 7&lt;br /&gt;own private copy of the variable, which is probably not what was&lt;br /&gt;intended.&lt;br /&gt;Can a variable be both const and volatile?&lt;br /&gt;Yes. The const modifier means that this code cannot change the value&lt;br /&gt;of the variable, but that does not mean that the value cannot be&lt;br /&gt;changed by means outside this code. For instance, in the example in&lt;br /&gt;FAQ 8, the timer structure was accessed through a volatile const&lt;br /&gt;pointer. The function itself did not change the value of the timer, so it&lt;br /&gt;was declared const. However, the value was changed by hardware on&lt;br /&gt;the computer, so it was declared volatile. If a variable is both const and&lt;br /&gt;volatile, the two modifiers can appear in either order.&lt;br /&gt;Can include files be nested?&lt;br /&gt;Yes. Include files can be nested any number of times. As long as you&lt;br /&gt;use precautionary measures , you can avoid including the same file&lt;br /&gt;twice. In the past, nesting header files was seen as bad programming&lt;br /&gt;practice, because it complicates the dependency tracking function of&lt;br /&gt;the MAKE program and thus slows down compilation. Many of today’s&lt;br /&gt;popular compilers make up for this difficulty by implementing a&lt;br /&gt;concept called precompiled headers, in which all headers and&lt;br /&gt;associated dependencies are stored in a precompiled state.&lt;br /&gt;Many programmers like to create a custom header file that has&lt;br /&gt;#include statements for every header needed for each module. This is&lt;br /&gt;perfectly acceptable and can help avoid potential problems relating to&lt;br /&gt;#include files, such as accidentally omitting an #include file in a&lt;br /&gt;module.&lt;br /&gt;When does the compiler not implicitly generate the address of the first&lt;br /&gt;element of an array?&lt;br /&gt;Whenever an array name appears in an expression such as&lt;br /&gt;- array as an operand of the sizeof operator&lt;br /&gt;- array as an operand of &amp; operator&lt;br /&gt;- array as a string literal initializer for a character array&lt;br /&gt;Then the compiler does not implicitly generate the address of the&lt;br /&gt;address of the first element of an array.&lt;br /&gt;What is a null pointer?&lt;br /&gt;Visit http://TechPreparation.com for more Interview Questions with Answers Page 8&lt;br /&gt;There are times when it’s necessary to have a pointer that doesn’t&lt;br /&gt;point to anything. The macro NULL, defined in , has a value that’s&lt;br /&gt;guaranteed to be different from any valid pointer. NULL is a literal zero,&lt;br /&gt;possibly cast to void* or char*. Some people, notably C++&lt;br /&gt;programmers, prefer to use 0 rather than NULL.&lt;br /&gt;The null pointer is used in three ways:&lt;br /&gt;1) To stop indirection in a recursive data structure&lt;br /&gt;2) As an error value&lt;br /&gt;3) As a sentinel value&lt;br /&gt;What is the difference between text and binary modes?&lt;br /&gt;Streams can be classified into two types: text streams and binary&lt;br /&gt;streams. Text streams are interpreted, with a maximum length of 255&lt;br /&gt;characters. With text streams, carriage return/line feed combinations&lt;br /&gt;are translated to the newline n character and vice versa. Binary&lt;br /&gt;streams are uninterrupted and are treated one byte at a time with no&lt;br /&gt;translation of characters. Typically, a text stream would be used for&lt;br /&gt;reading and writing standard text files, printing output to the screen or&lt;br /&gt;printer, or receiving input from the keyboard.&lt;br /&gt;A binary text stream would typically be used for reading and writing&lt;br /&gt;binary files such as graphics or word processing documents, reading&lt;br /&gt;mouse input, or reading and writing to the modem.&lt;br /&gt;What is static memory allocation and dynamic memory allocation?&lt;br /&gt;Static memory allocation: The compiler allocates the required memory&lt;br /&gt;space for a declared variable.By using the address of operator,the&lt;br /&gt;reserved address is obtained and this address may be assigned to a&lt;br /&gt;pointer variable.Since most of the declared variable have static&lt;br /&gt;memory,this way of assigning pointer value to a pointer variable is&lt;br /&gt;known as static memory allocation. memory is assigned during&lt;br /&gt;compilation time.&lt;br /&gt;Dynamic memory allocation: It uses functions such as malloc( ) or&lt;br /&gt;calloc( ) to get memory dynamically.If these functions are used to get&lt;br /&gt;memory dynamically and the values returned by these functions are&lt;br /&gt;assingned to pointer variables, such assignments are known as&lt;br /&gt;dynamic memory allocation.memory is assined during run time.&lt;br /&gt;When should a far pointer be used?&lt;br /&gt;Sometimes you can get away with using a small memory model in&lt;br /&gt;most of a given program. There might be just a few things that don’t fit&lt;br /&gt;in your small data and code segments. When that happens, you can&lt;br /&gt;Visit http://TechPreparation.com for more Interview Questions with Answers Page 9&lt;br /&gt;use explicit far pointers and function declarations to get at the rest of&lt;br /&gt;memory. A far function can be outside the 64KB segment most&lt;br /&gt;functions are shoehorned into for a small-code model. (Often, libraries&lt;br /&gt;are declared explicitly far, so they’ll work no matter what code model&lt;br /&gt;the program uses.) A far pointer can refer to information outside the&lt;br /&gt;64KB data segment. Typically, such pointers are used with farmalloc()&lt;br /&gt;and such, to manage a heap separate from where all the rest of the&lt;br /&gt;data lives. If you use a small-data, large-code model, you should&lt;br /&gt;explicitly make your function pointers far.&lt;br /&gt;How are pointer variables initialized?&lt;br /&gt;Pointer variable are initialized by one of the following two ways&lt;br /&gt;- Static memory allocation&lt;br /&gt;- Dynamic memory allocation&lt;br /&gt;Difference between arrays and pointers?&lt;br /&gt;- Pointers are used to manipulate data using the address. Pointers use&lt;br /&gt;* operator to access the data pointed to by them&lt;br /&gt;- Arrays use subscripted variables to access and manipulate data.&lt;br /&gt;Array variables can be equivalently written using pointer expression.&lt;br /&gt;Is using exit() the same as using return?&lt;br /&gt;No. The exit() function is used to exit your program and return control&lt;br /&gt;to the operating system. The return statement is used to return from a&lt;br /&gt;function and return control to the calling function. If you issue a return&lt;br /&gt;from the main() function, you are essentially returning control to the&lt;br /&gt;calling function, which is the operating system. In this case, the return&lt;br /&gt;statement and exit() function are similar.&lt;br /&gt;What is a method?&lt;br /&gt;Method is a way of doing something, especially a systematic way;&lt;br /&gt;implies an orderly logical arrangement (usually in steps).&lt;br /&gt;What is indirection?&lt;br /&gt;If you declare a variable, its name is a direct reference to its value. If&lt;br /&gt;you have a pointer to a variable, or any other object in memory, you&lt;br /&gt;have an indirect reference to its value.&lt;br /&gt;Visit http://TechPreparation.com for more Interview Questions with Answers Page 10&lt;br /&gt;What is modular programming?&lt;br /&gt;If a program is large, it is subdivided into a number of smaller&lt;br /&gt;programs that are called modules or subprograms. If a complex&lt;br /&gt;problem is solved using more modules, this approach is known as&lt;br /&gt;modular programming.&lt;br /&gt;How many levels deep can include files be nested?&lt;br /&gt;Even though there is no limit to the number of levels of nested include&lt;br /&gt;files you can have, your compiler might run out of stack space while&lt;br /&gt;trying to include an inordinately high number of files. This number&lt;br /&gt;varies according to your hardware configuration and possibly your&lt;br /&gt;compiler.&lt;br /&gt;What is the difference between declaring a variable and defining a variable?&lt;br /&gt;Declaring a variable means describing its type to the compiler but not&lt;br /&gt;allocating any space for it. Defining a variable means declaring it and&lt;br /&gt;also allocating space to hold the variable. You can also initialize a&lt;br /&gt;variable at the time it is defined.&lt;br /&gt;What is an lvalue?&lt;br /&gt;An lvalue is an expression to which a value can be assigned. The lvalue&lt;br /&gt;expression is located on the left side of an assignment statement,&lt;br /&gt;whereas an rvalue is located on the right side of an assignment&lt;br /&gt;statement. Each assignment statement must have an lvalue and an&lt;br /&gt;rvalue. The lvalue expression must reference a storable variable in&lt;br /&gt;memory. It cannot be a constant.&lt;br /&gt;Differentiate between an internal static and external static variable?&lt;br /&gt;An internal static variable is declared inside a block with static storage&lt;br /&gt;class whereas an external static variable is declared outside all the&lt;br /&gt;blocks in a file.An internal static variable has persistent storage,block&lt;br /&gt;scope and no linkage.An external static variable has permanent&lt;br /&gt;storage,file scope and internal linkage.&lt;br /&gt;Visit http://TechPreparation.com for more Interview Questions with Answers Page 11&lt;br /&gt;What is the difference between a string and an array?&lt;br /&gt;An array is an array of anything. A string is a specific kind of an array&lt;br /&gt;with a well-known convention to determine its length.&lt;br /&gt;There are two kinds of programming languages: those in which a string&lt;br /&gt;is just an array of characters, and those in which it’s a special type. In&lt;br /&gt;C, a string is just an array of characters (type char), with one wrinkle: a&lt;br /&gt;C string always ends with a NUL character.&lt;br /&gt;The “value” of an array is the same as the address of (or a pointer to)&lt;br /&gt;the first element; so, frequently, a C string and a pointer to char are&lt;br /&gt;used to mean the same thing.&lt;br /&gt;An array can be any length. If it’s passed to a function, there’s no way&lt;br /&gt;the function can tell how long the array is supposed to be, unless some&lt;br /&gt;convention is used. The convention for strings is NUL termination; the&lt;br /&gt;last character is an ASCII NUL (‘’) character.&lt;br /&gt;What is an argument? Differentiate between formal arguments and actual&lt;br /&gt;arguments?&lt;br /&gt;An argument is an entity used to pass the data from calling function to&lt;br /&gt;the called function. Formal arguments are the arguments available in&lt;br /&gt;the function definition. They are preceded by their own data types.&lt;br /&gt;Actual arguments are available in the function call.&lt;br /&gt;What are advantages and disadvantages of external storage class?&lt;br /&gt;Advantages of external storage class&lt;br /&gt;1)Persistent storage of a variable retains the latest value&lt;br /&gt;2)The value is globally available&lt;br /&gt;Disadvantages of external storage class&lt;br /&gt;1)The storage for an external variable exists even when the variable is&lt;br /&gt;not needed&lt;br /&gt;2)The side effect may produce surprising output&lt;br /&gt;3)Modification of the program is difficult&lt;br /&gt;4)Generality of a program is affected&lt;br /&gt;What is a void pointer?&lt;br /&gt;A void pointer is a C convention for a raw address. The compiler has no&lt;br /&gt;Visit http://TechPreparation.com for more Interview Questions with Answers Page 12&lt;br /&gt;idea what type of object a void Pointer really points to. If you write&lt;br /&gt;int *ip;&lt;br /&gt;ip points to an int. If you write&lt;br /&gt;void *p;&lt;br /&gt;p doesn’t point to a void!&lt;br /&gt;In C and C++, any time you need a void pointer, you can use another&lt;br /&gt;pointer type. For example, if you have a char*, you can pass it to a&lt;br /&gt;function that expects a void*. You don’t even need to cast it. In C (but&lt;br /&gt;not in C++), you can use a void* any time you need any kind of&lt;br /&gt;pointer, without casting. (In C++, you need to cast it).&lt;br /&gt;A void pointer is used for working with raw memory or for passing a&lt;br /&gt;pointer to an unspecified type.&lt;br /&gt;Some C code operates on raw memory. When C was first invented,&lt;br /&gt;character pointers (char *) were used for that. Then people started&lt;br /&gt;getting confused about when a character pointer was a string, when it&lt;br /&gt;was a character array, and when it was raw memory.&lt;br /&gt;When should a type cast not be used?&lt;br /&gt;A type cast should not be used to override a const or volatile&lt;br /&gt;declaration. Overriding these type modifiers can cause the program to&lt;br /&gt;fail to run correctly.&lt;br /&gt;A type cast should not be used to turn a pointer to one type of&lt;br /&gt;structure or data type into another. In the rare events in which this&lt;br /&gt;action is beneficial, using a union to hold the values makes the&lt;br /&gt;programmer’s intentions clearer.&lt;br /&gt;When is a switch statement better than multiple if statements?&lt;br /&gt;A switch statement is generally best to use when you have more than&lt;br /&gt;two conditional expressions based on a single variable of numeric type.&lt;br /&gt;What is a static function?&lt;br /&gt;A static function is a function whose scope is limited to the current&lt;br /&gt;Visit http://TechPreparation.com for more Interview Questions with Answers Page 13&lt;br /&gt;source file. Scope refers to the visibility of a function or variable. If the&lt;br /&gt;function or variable is visible outside of the current source file, it is said&lt;br /&gt;to have global, or external, scope. If the function or variable is not&lt;br /&gt;visible outside of the current source file, it is said to have local, or&lt;br /&gt;static, scope.&lt;br /&gt;What is a pointer variable?&lt;br /&gt;A pointer variable is a variable that may contain the address of another&lt;br /&gt;variable or any valid address in the memory.&lt;br /&gt;What is a pointer value and address?&lt;br /&gt;A pointer value is a data object that refers to a memory location. Each&lt;br /&gt;memory location is numbered in the memory. The number attached to&lt;br /&gt;a memory location is called the address of the location.&lt;br /&gt;What is a modulus operator? What are the restrictions of a modulus&lt;br /&gt;operator?&lt;br /&gt;A Modulus operator gives the remainder value. The result of x%y is&lt;br /&gt;obtained by (x-(x/y)*y). This operator is applied only to integral&lt;br /&gt;operands and cannot be applied to float or double.&lt;br /&gt;Differentiate between a linker and linkage?&lt;br /&gt;A linker converts an object code into an executable code by linking&lt;br /&gt;together the necessary build in functions. The form and place of&lt;br /&gt;declaration where the variable is declared in a program determine the&lt;br /&gt;linkage of variable.&lt;br /&gt;What is a function and built-in function?&lt;br /&gt;A large program is subdivided into a number of smaller programs or&lt;br /&gt;subprograms. Each subprogram specifies one or more actions to be&lt;br /&gt;performed for a large program. such subprograms are functions.&lt;br /&gt;The function supports only static and extern storage classes. By&lt;br /&gt;default, function assumes extern storage class. functions have global&lt;br /&gt;scope. Only register or auto storage class is allowed in the function&lt;br /&gt;Visit http://TechPreparation.com for more Interview Questions with Answers Page 14&lt;br /&gt;parameters. Built-in functions that predefined and supplied along with&lt;br /&gt;the compiler are known as built-in functions. They are also known as&lt;br /&gt;library functions.&lt;br /&gt;Why should I prototype a function?&lt;br /&gt;A function prototype tells the compiler what kind of arguments a&lt;br /&gt;function is looking to receive and what kind of return value a function&lt;br /&gt;is going to give back. This approach helps the compiler ensure that&lt;br /&gt;calls to a function are made correctly and that no erroneous type&lt;br /&gt;conversions are taking place.&lt;br /&gt;What is Polymorphism ?&lt;br /&gt;'Polymorphism' is an object oriented term. Polymorphism may be&lt;br /&gt;defined as the ability of related objects to respond to the same&lt;br /&gt;message with different, but appropriate actions. In other words,&lt;br /&gt;polymorphism means taking more than one form. Polymorphism leads&lt;br /&gt;to two important aspects in Object Oriented terminology - Function&lt;br /&gt;Overloading and Function Overriding. Overloading is the practice of&lt;br /&gt;supplying more than one definition for a given function name in the&lt;br /&gt;same scope. The compiler is left to pick the appropriate version of the&lt;br /&gt;function or operator based on the arguments with which it is called.&lt;br /&gt;Overriding refers to the modifications made in the sub class to the&lt;br /&gt;inherited methods from the base class to change their behavior.&lt;br /&gt;What is Operator overloading ?&lt;br /&gt;When an operator is overloaded, it takes on an additional meaning&lt;br /&gt;relative to a certain class. But it can still retain all of its old meanings.&lt;br /&gt;Examples:&lt;br /&gt;1) The operators &gt;&gt; and &lt;&lt; may be used for I/O operations because&lt;br /&gt;in the header, they are overloaded.&lt;br /&gt;2) In a stack class it is possible to overload the + operator so that it&lt;br /&gt;appends the contents of one stack to the contents of another. But the&lt;br /&gt;+ operator still retains its original meaning relative to other types of&lt;br /&gt;data.&lt;br /&gt;What is the difference between goto and longjmp() and setjmp()?&lt;br /&gt;A goto statement implements a local jump of program execution, and&lt;br /&gt;the longjmp() and setjmp() functions implement a nonlocal, or far,&lt;br /&gt;Visit http://TechPreparation.com for more Interview Questions with Answers Page 15&lt;br /&gt;jump of program execution.&lt;br /&gt;Generally, a jump in execution of any kind should be avoided because&lt;br /&gt;it is not considered good programming practice to use such statements&lt;br /&gt;as goto and longjmp in your program.&lt;br /&gt;A goto statement simply bypasses code in your program and jumps to&lt;br /&gt;a predefined position. To use the goto statement, you give it a labeled&lt;br /&gt;position to jump to. This predefined position must be within the same&lt;br /&gt;function. You cannot implement gotos between functions.&lt;br /&gt;When your program calls setjmp(), the current state of your program is&lt;br /&gt;saved in a structure of type jmp_buf. Later, your program can call the&lt;br /&gt;longjmp() function to restore the program’s state as it was when you&lt;br /&gt;called setjmp().Unlike the goto statement, the longjmp() and setjmp()&lt;br /&gt;functions do not need to be implemented in the same function.&lt;br /&gt;However, there is a major drawback to using these functions: your&lt;br /&gt;program, when restored to its previously saved state, will lose its&lt;br /&gt;references to any dynamically allocated memory between the&lt;br /&gt;longjmp() and the setjmp(). This means you will waste memory for&lt;br /&gt;every malloc() or calloc() you have implemented between your&lt;br /&gt;longjmp() and setjmp(), and your program will be horribly inefficient.&lt;br /&gt;It is highly recommended that you avoid using functions such as&lt;br /&gt;longjmp() and setjmp() because they, like the goto statement, are&lt;br /&gt;quite often an indication of poor programming practice.&lt;br /&gt;V&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-2037232041138304137?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/2037232041138304137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/ans-for-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/2037232041138304137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/2037232041138304137'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/ans-for-c.html' title='ans for c'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-3117324469980996269</id><published>2010-08-14T01:23:00.000-07:00</published><updated>2010-08-14T01:23:03.285-07:00</updated><title type='text'>c tutorials</title><content type='html'>C Programming Tutorials&lt;br /&gt;The C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system.&lt;br /&gt;C is the most widely used computer language. &lt;br /&gt;This tutorial should be your starting point only. &lt;br /&gt;&lt;br /&gt;Basic of C :&lt;br /&gt;Facts about C&lt;br /&gt;Why to use C ?&lt;br /&gt;C Program File&lt;br /&gt;C Compilers&lt;br /&gt;&lt;br /&gt;Program Structure :&lt;br /&gt;Simple C Program&lt;br /&gt;C Program Compilation&lt;br /&gt;&lt;br /&gt;Basic Datatypes :&lt;br /&gt;DataTypes&lt;br /&gt;Modifiers&lt;br /&gt;Qualifiers&lt;br /&gt;Arrays&lt;br /&gt;&lt;br /&gt;Variable Types :&lt;br /&gt;Local Variable&lt;br /&gt;Global Variable&lt;br /&gt;&lt;br /&gt;Storage Classes :&lt;br /&gt;auto - storage class&lt;br /&gt;register - storage class&lt;br /&gt;static - storage class&lt;br /&gt;extern - storage class&lt;br /&gt;&lt;br /&gt;Using Constants :&lt;br /&gt;Defining Constants&lt;br /&gt;The enum Data Type&lt;br /&gt;&lt;br /&gt;Operator Types :&lt;br /&gt;Arithmetic Operators&lt;br /&gt;Logical Operators&lt;br /&gt;Bitwise Operators&lt;br /&gt;Assignment Operators&lt;br /&gt;Misc Operators&lt;br /&gt;&lt;br /&gt;Control Statements :&lt;br /&gt;Branching&lt;br /&gt;Looping&lt;br /&gt;&lt;br /&gt;Input and Output :&lt;br /&gt;printf() function&lt;br /&gt;scanf() function&lt;br /&gt;&lt;br /&gt;Pointing to Data :&lt;br /&gt;Pointers and Arrays&lt;br /&gt;Pointer Arithmetic&lt;br /&gt;Using Pointer Arithmetic with Arrays&lt;br /&gt;&lt;br /&gt;Functions :&lt;br /&gt;Using Functions&lt;br /&gt;Declaration and Definition&lt;br /&gt;&lt;br /&gt;Strings :&lt;br /&gt;Reading and Writing Strings&lt;br /&gt;String Manipulation Function&lt;br /&gt;&lt;br /&gt;Structured Datatypes :&lt;br /&gt;Structure&lt;br /&gt;Pointer to Structure&lt;br /&gt;&lt;br /&gt;Working with Files :&lt;br /&gt;Files&lt;br /&gt;Basic I/O&lt;br /&gt;&lt;br /&gt;Bits :&lt;br /&gt;Bits Manipulation&lt;br /&gt;Bits Field&lt;br /&gt;&lt;br /&gt;Pre-Processors :&lt;br /&gt;Pre-Processors Examples&lt;br /&gt;Parameterized Macros&lt;br /&gt;Macro Caveats&lt;br /&gt;Useful Concepts&lt;br /&gt;&lt;br /&gt;Built-in Library Functions :&lt;br /&gt;String Manipulation Functions&lt;br /&gt;Memory Management Functions&lt;br /&gt;Buffer Manipulation&lt;br /&gt;Character Functions&lt;br /&gt;Error Handling Functions&lt;br /&gt;&lt;br /&gt;1.Basic Introduction&lt;br /&gt;C is a general-purpose high level language that was originally developed by Dennis Ritchie for the Unix operating system. It was first implemented on the Digital Equipment Corporation PDP-11 computer in 1972.&lt;br /&gt;&lt;br /&gt;The Unix operating system and virtually all Unix applications are written in the C language. C has now become a widely used professional language for various reasons.&lt;br /&gt;&lt;br /&gt;Easy to learn&lt;br /&gt;&lt;br /&gt;Structured language&lt;br /&gt;&lt;br /&gt;It produces efficient programs.&lt;br /&gt;&lt;br /&gt;It can handle low-level activities.&lt;br /&gt;&lt;br /&gt;It can be compiled on a variety of computers.&lt;br /&gt;&lt;br /&gt;Facts about C&lt;br /&gt;&lt;br /&gt;C was invented to write an operating system called UNIX.&lt;br /&gt;&lt;br /&gt;C is a successor of B language which was introduced around 1970&lt;br /&gt;&lt;br /&gt;The language was formalized in 1988 by the American National Standard Institute (ANSI).&lt;br /&gt;&lt;br /&gt;By 1973 UNIX OS almost totally written in C.&lt;br /&gt;&lt;br /&gt;Today C is the most widely used System Programming Language.&lt;br /&gt;&lt;br /&gt;Most of the state of the art software have been implemented using C&lt;br /&gt;&lt;br /&gt;Why to use C ?&lt;br /&gt;C was initially used for system development work, in particular the programs that make-up the operating system. C was adopted as a system development language because it produces code that runs nearly as fast as code written in assembly language. Some examples of the use of C might be:&lt;br /&gt;&lt;br /&gt;Operating Systems&lt;br /&gt;&lt;br /&gt;Language Compilers&lt;br /&gt;&lt;br /&gt;Assemblers&lt;br /&gt;&lt;br /&gt;Text Editors&lt;br /&gt;&lt;br /&gt;Print Spoolers&lt;br /&gt;&lt;br /&gt;Network Drivers&lt;br /&gt;&lt;br /&gt;Modern Programs&lt;br /&gt;&lt;br /&gt;Data Bases&lt;br /&gt;&lt;br /&gt;Language Interpreters&lt;br /&gt;&lt;br /&gt;Utilities&lt;br /&gt;&lt;br /&gt;C Program File&lt;br /&gt;All the C programs are written into text files with extension ".c" for example hello.c. You can use "vi" editor to write your C program into a file. &lt;br /&gt;&lt;br /&gt;This tutorial assumes that you know how to edit a text file and how to write programming instructions inside a program file.&lt;br /&gt;&lt;br /&gt;C Compilers&lt;br /&gt;When you write any program in C language then to run that program you need to compile that program using a C Compiler which converts your program into a language understandable by a computer. This is called machine language (ie. binary format). So before proceeding, make sure you have C Compiler available at your computer. It comes along with all flavors of Unix and Linux. &lt;br /&gt;&lt;br /&gt;If you are working over Unix or Linux then you can type gcc -v or cc -v and check the result. You can ask your system administrator or you can take help from anyone to identify an available C Compiler at your computer.&lt;br /&gt;&lt;br /&gt;If you don't have C compiler installed at your computer then you can use below given link to download a GNU C Compiler and use it&lt;br /&gt;2.Program Structure&lt;br /&gt;A C program basically has the following form:&lt;br /&gt;&lt;br /&gt;Preprocessor Commands&lt;br /&gt;&lt;br /&gt;Functions&lt;br /&gt;&lt;br /&gt;Variables&lt;br /&gt;&lt;br /&gt;Statements &amp; Expressions&lt;br /&gt;&lt;br /&gt;Comments&lt;br /&gt;&lt;br /&gt;The following program is written in the C programming language. Open a text file hello.c using vi editor and put the following lines inside that file.&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;/* My first program */&lt;br /&gt;printf("Hello, TechPreparation! \n");&lt;br /&gt;&lt;br /&gt;return 0;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Preprocessor Commands: &lt;br /&gt;These commands tells the compiler to do preprocessing before doing actual compilation. Like #include &lt;stdio.h&gt; is a preprocessor command which tells a C compiler to include stdio.h file before going to actual compilation. You will learn more about C Preprocessors in C Preprocessors session.&lt;br /&gt;&lt;br /&gt;Functions:&lt;br /&gt;Functions are main building blocks of any C Program. Every C Program will have one or more functions and there is one mandatory function which is called main() function. This function is prefixed with keyword int which means this function returns an integer value when it exits. This integer value is returned using return statement.&lt;br /&gt;&lt;br /&gt;The C Programming language provides a set of built-in functions. In the above example printf() is a C built-in function which is used to print anything on the screen.&lt;br /&gt;&lt;br /&gt;Variables:&lt;br /&gt;Variables are used to hold numbers, strings and complex data for manipulation. You will learn in detail about variables in C Variable Types.&lt;br /&gt;&lt;br /&gt;Statements &amp; Expressions : &lt;br /&gt;Expressions combine variables and constants to create new values. Statements are expressions, assignments, function calls, or control flow statements which make up C programs.&lt;br /&gt;&lt;br /&gt;Comments:&lt;br /&gt;Comments are used to give additional useful information inside a C Program. All the comments will be put inside /*...*/ as given in the example above. A comment can span through multiple lines.&lt;br /&gt;&lt;br /&gt;Note the followings&lt;br /&gt;&lt;br /&gt;C is a case sensitive programming language. It means in C printf and Printf will have different meanings.&lt;br /&gt;&lt;br /&gt;C has a free-form line structure. End of each C statement must be marked with a semicolon.&lt;br /&gt;&lt;br /&gt;Multiple statements can be one the same line. &lt;br /&gt;&lt;br /&gt;White Spaces (ie tab space and space bar ) are ignored.&lt;br /&gt;&lt;br /&gt;Statements can continue over multiple lines.&lt;br /&gt;&lt;br /&gt;C Program Compilation&lt;br /&gt;To compile a C program you would have to Compiler name and program files name. Assuming your compiler's name is cc and program file name is hello.c, give following command at Unix prompt.&lt;br /&gt;&lt;br /&gt;$cc hello.c &lt;br /&gt;&lt;br /&gt;This will produce a binary file called a.out and an object file hello.o in your current directory. Here a.out is your first program which you will run at Unix prompt like any other system program. If you don't like the name a.out then you can produce a binary file with your own name by using -o option while compiling C program. See an example below&lt;br /&gt;&lt;br /&gt;$cc -o hello hello.c &lt;br /&gt;&lt;br /&gt;Now you will get a binary with name hello. Execute this program at Unix prompt but before executing / running this program make sure that it has execute permission set. If you don't know what is execute permission then just follow these two steps&lt;br /&gt;&lt;br /&gt;$chmod 755 hello&lt;br /&gt;$./hello&lt;br /&gt;&lt;br /&gt;This will produce following result&lt;br /&gt;Hello, TechPreparation! &lt;br /&gt;&lt;br /&gt;Congratulations!! you have written your first program in "C". Now believe me its not difficult to learn "C".&lt;br /&gt;&lt;br /&gt;3.Basic Datatypes&lt;br /&gt;C has a concept of 'data types' which are used to define a variable before its use. The definition of a variable will assign storage for the variable and define the type of data that will be held in the location.&lt;br /&gt;&lt;br /&gt;The value of a variable can be changed any time.&lt;br /&gt;&lt;br /&gt;C has the following basic built-in datatypes.&lt;br /&gt;&lt;br /&gt;int&lt;br /&gt;&lt;br /&gt;float&lt;br /&gt;&lt;br /&gt;double&lt;br /&gt;&lt;br /&gt;char&lt;br /&gt;&lt;br /&gt;Please note that there is not a Boolean data type. C does not have the traditional view about logical comparison, but that's another story.&lt;br /&gt;&lt;br /&gt;int - data type&lt;br /&gt;int is used to define integer numbers.&lt;br /&gt;&lt;br /&gt; {&lt;br /&gt;int Count;&lt;br /&gt;Count = 5;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;float - data type&lt;br /&gt;float is used to define floating point numbers.&lt;br /&gt;&lt;br /&gt; {&lt;br /&gt;float Miles;&lt;br /&gt;Miles = 5.6;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;double - data type&lt;br /&gt;double is used to define BIG floating point numbers. It reserves twice the storage for the number. On PCs this is likely to be 8 bytes.&lt;br /&gt;&lt;br /&gt; {&lt;br /&gt;double Atoms;&lt;br /&gt;Atoms = 2500000;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;char - data type&lt;br /&gt;char defines characters.&lt;br /&gt;&lt;br /&gt; {&lt;br /&gt;char Letter;&lt;br /&gt;Letter = 'x';&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Modifiers&lt;br /&gt;The data types explained above have the following modifiers. &lt;br /&gt;&lt;br /&gt;short&lt;br /&gt;&lt;br /&gt;long&lt;br /&gt;&lt;br /&gt;signed&lt;br /&gt;&lt;br /&gt;unsigned&lt;br /&gt;&lt;br /&gt;The modifiers define the amount of storage allocated to the variable. The amount of storage allocated is not cast in stone. ANSI has the following rules:&lt;br /&gt;&lt;br /&gt; short int &lt;= int &lt;= long intfloat &lt;= double &lt;= long double What this means is that a 'short int' should assign less than or the same amount of storage as an 'int' and the 'int' should be less or the same bytes than a 'long int'. What this means in the real world is: Type Bytes Range   short int 2  -32,768 -&gt; +32,767 (32kb) &lt;br /&gt;unsigned short int 2 0 -&gt; +65,535 (64Kb) &lt;br /&gt;unsigned int 4 0 -&gt; +4,294,967,295 ( 4Gb) &lt;br /&gt;int 4 -2,147,483,648 -&gt; +2,147,483,647 ( 2Gb) &lt;br /&gt;long int  4 -2,147,483,648 -&gt; +2,147,483,647 ( 2Gb) &lt;br /&gt;signed char 1 -128 -&gt; +127   &lt;br /&gt;unsigned char 1 0 -&gt; +255   &lt;br /&gt;float 4     &lt;br /&gt;double 8     &lt;br /&gt;long double 12     &lt;br /&gt;&lt;br /&gt;These figures only apply to today's generation of PCs. Mainframes and midrange machines could use different figures, but would still comply with the rule above.&lt;br /&gt;&lt;br /&gt;You can find out how much storage is allocated to a data type by using the sizeof operator discussed in Operator Types Session.&lt;br /&gt;&lt;br /&gt;Here is an example to check size of memory taken by various datatypes.&lt;br /&gt;&lt;br /&gt;int&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;printf("sizeof(char) == %d\n", sizeof(char));&lt;br /&gt;printf("sizeof(short) == %d\n", sizeof(short));&lt;br /&gt;printf("sizeof(int) == %d\n", sizeof(int));&lt;br /&gt;printf("sizeof(long) == %d\n", sizeof(long));&lt;br /&gt;printf("sizeof(float) == %d\n", sizeof(float));&lt;br /&gt;printf("sizeof(double) == %d\n", sizeof(double));&lt;br /&gt;printf("sizeof(long double) == %d\n", sizeof(long double));&lt;br /&gt;printf("sizeof(long long) == %d\n", sizeof(long long));&lt;br /&gt;&lt;br /&gt;return 0;&lt;br /&gt;} &lt;br /&gt;4.Qualifiers&lt;br /&gt;A type qualifier is used to refine the declaration of a variable, a function, and parameters, by specifying whether:&lt;br /&gt;&lt;br /&gt;The value of a variable can be changed.&lt;br /&gt;&lt;br /&gt;The value of a variable must always be read from memory rather than from a register&lt;br /&gt;&lt;br /&gt;Standard C language recognizes the following two qualifiers:&lt;br /&gt;&lt;br /&gt;const&lt;br /&gt;&lt;br /&gt;volatile&lt;br /&gt;&lt;br /&gt;The const qualifier is used to tell C that the variable value can not change after initialization.&lt;br /&gt;const float pi=3.14159; &lt;br /&gt;&lt;br /&gt;Now pi cannot be changed at a later time within the program.&lt;br /&gt;&lt;br /&gt;Another way to define constants is with the #define preprocessor which has the advantage that it does not use any storage &lt;br /&gt;&lt;br /&gt;The volatile qualifier declares a data type that can have its value changed in ways outside the control or detection of the compiler (such as a variable updated by the system clock or by another program). This prevents the compiler from optimizing code referring to the object by storing the object's value in a register and re-reading it from there, rather than from memory, where it may have changed. You will use this qualifier once you will become expert in "C". So for now just proceed.&lt;br /&gt;&lt;br /&gt;What are Arrays:&lt;br /&gt;We have seen all basic data types. In C language it is possible to make arrays whose elements are basic types. Thus we can make an array of 10 integers with the declaration.&lt;br /&gt;&lt;br /&gt;int x[10]; &lt;br /&gt;&lt;br /&gt;The square brackets mean subscripting; parentheses are used only for function references. Array indexes begin at zero, so the elements of x are:&lt;br /&gt;&lt;br /&gt;Thus Array are special type of variables which can be used to store multiple values of same data type. Those values are stored and accessed using subscript or index.&lt;br /&gt;&lt;br /&gt;Arrays occupy consecutive memory slots in the computer's memory.&lt;br /&gt;&lt;br /&gt;x[0], x[1], x[2], ..., x[9] &lt;br /&gt;&lt;br /&gt;If an array has n elements, the largest subscript is n-1.&lt;br /&gt;&lt;br /&gt;Multiple-dimension arrays are provided. The declaration and use look like:&lt;br /&gt;&lt;br /&gt;int name[10] [20];&lt;br /&gt;n = name[i+j] [1] + name[k] [2]; &lt;br /&gt;&lt;br /&gt;Subscripts can be arbitrary integer expressions. Multi-dimension arrays are stored by row so the rightmost subscript varies fastest. In above example name has 10 rows and 20 columns.&lt;br /&gt;&lt;br /&gt;Same way, arrays can be defined for any data type. Text is usually kept as an array of characters. By convention in C, the last character in a character array should be a `\0' because most programs that manipulate character arrays expect it. For example, printf uses the `\0' to detect the end of a character array when printing it out with a `%s'.&lt;br /&gt;&lt;br /&gt;Here is a program which reads a line, stores it in a buffer, and prints its length (excluding the newline at the end).&lt;br /&gt;&lt;br /&gt; main( ) &lt;br /&gt;{&lt;br /&gt;int n, c;&lt;br /&gt;char line[100];&lt;br /&gt;n = 0;&lt;br /&gt;while( (c=getchar( )) != '\n' )&lt;br /&gt;{&lt;br /&gt;if( n &lt; 100 )line[n] = c;n++;}printf("length = %d\n", n);} Array InitializationAs with other declarations, array declarations can include an optional initializationScalar variables are initialized with a single valueArrays are initialized with a list of valuesThe list is enclosed in curly bracesint array [8] = {2, 4, 6, 8, 10, 12, 14, 16}; The number of initializes cannot be more than the number of elements in the array but it can be less in which case, the remaining elements are initialized to 0.if you like, the array size can be inferred from the number of initializes by leaving the square brackets empty so these are identical declarations:int array1 [8] = {2, 4, 6, 8, 10, 12, 14, 16};int array2 [] = {2, 4, 6, 8, 10, 12, 14, 16}; An array of characters ie string can be initialized as follows:char string[10] = "Hello"; 5.Variable TypesA variable is just a named area of storage that can hold a single value (numeric or character). The C language demands that you declare the name of each variable that you are going to use and its type, or class, before you actually try to do anything with it.The Programming language C has two main variable typesLocal VariablesGlobal VariablesLocal VariablesLocal variables scope is confined within the block or function where it is defined. Local variables must always be defined at the top of a block.When a local variable is defined - it is not initialized by the system, you must initialize it yourself.When execution of the block starts the variable is available, and when the block ends the variable 'dies'.Check following example's output main(){int i=4;int j=10;i++;if (j &gt; 0)&lt;br /&gt;{ &lt;br /&gt;/* i defined in 'main' can be seen */&lt;br /&gt;printf("i is %d\n",i); &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (j &gt; 0)&lt;br /&gt;{&lt;br /&gt;/* 'i' is defined and so local to this block */&lt;br /&gt;int i=100; &lt;br /&gt;printf("i is %d\n",i); &lt;br /&gt;}/* 'i' (value 100) dies here */&lt;br /&gt;&lt;br /&gt;printf("i is %d\n",i); /* 'i' (value 5) is now visable.*/&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This will generate following output&lt;br /&gt;i is 5&lt;br /&gt;i is 100&lt;br /&gt;i is 5 &lt;br /&gt;&lt;br /&gt;Here ++ is called incremental operator and it increase the value of any integer variable by 1. Thus i++ is equivalent to i = i + 1;&lt;br /&gt;&lt;br /&gt;You will see -- operator also which is called decremental operator and it decrease the value of any integer variable by 1. Thus i-- is equivalent to i = i - 1;&lt;br /&gt;&lt;br /&gt;Global Variables&lt;br /&gt;Global variable is defined at the top of the program file and it can be visible and modified by any function that may reference it.&lt;br /&gt;&lt;br /&gt;Global variables are initialized automatically by the system when you define them!&lt;br /&gt;&lt;br /&gt;Data Type Initialser &lt;br /&gt;int 0 &lt;br /&gt;char '\0' &lt;br /&gt;float 0 &lt;br /&gt;pointer NULL &lt;br /&gt;&lt;br /&gt;If same variable name is being used for global and local variable then local variable takes preference in its scope. But it is not a good practice to use global variables and local variables with the same name.&lt;br /&gt;&lt;br /&gt;int i=4;                 /* Global definition */&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;i++;                     /* Global variable */&lt;br /&gt;func();&lt;br /&gt;printf( "Value of i = %d -- main function\n", i );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;func()&lt;br /&gt;{&lt;br /&gt;int i=10;               /* Local definition */&lt;br /&gt;i++;                      /* Local variable */&lt;br /&gt;printf( "Value of i = %d -- func() function\n", i );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This will produce following result&lt;br /&gt;Value of i = 11 -- func() function&lt;br /&gt;Value of i = 5 -- main function &lt;br /&gt;&lt;br /&gt;i in main function is global and will be incremented to 5. i in func is internal and will be incremented to 11. When control returns to main the internal variable will die and and any reference to i will be to the global.&lt;br /&gt;&lt;br /&gt;6.Storage Classes&lt;br /&gt;A storage class defines the scope (visibility) and life time of variables and/or functions within a C Program.&lt;br /&gt;&lt;br /&gt;There are following storage classes which can be used in a C Program&lt;br /&gt;&lt;br /&gt;auto&lt;br /&gt;&lt;br /&gt;register&lt;br /&gt;&lt;br /&gt;static&lt;br /&gt;&lt;br /&gt;extern&lt;br /&gt;&lt;br /&gt;auto - Storage Class&lt;br /&gt;auto is the default storage class for all local variables.&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;int Count;&lt;br /&gt;auto int Month;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;The example above defines two variables with the same storage class. auto can only be used within functions, i.e. local variables.&lt;br /&gt;&lt;br /&gt;register - Storage Class&lt;br /&gt;register is used to define local variables that should be stored in a register instead of RAM. This means that the variable has a maximum size equal to the register size (usually one word) and cant have the unary '&amp;' operator applied to it (as it does not have a memory location).&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;register int Miles;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Register should only be used for variables that require quick access - such as counters. It should also be noted that defining 'register' goes not mean that the variable will be stored in a register. It means that it MIGHT be stored in a register - depending on hardware and implementation restrictions.&lt;br /&gt;&lt;br /&gt;static - Storage Class&lt;br /&gt;static is the default storage class for global variables. The two variables below (count and road) both have a static storage class.&lt;br /&gt;&lt;br /&gt;static int Count;&lt;br /&gt;int Road;&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;printf("%d\n", Road);&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;static variables can be 'seen' within all functions in this source file. At link time, the static variables defined here will not be seen by the object modules that are brought in.&lt;br /&gt;&lt;br /&gt;static can also be defined within a function. If this is done the variable is initialized at run time but is not reinitialized when the function is called. This inside a function static variable retains its value during various calls.&lt;br /&gt;&lt;br /&gt; void func(void);&lt;br /&gt;&lt;br /&gt;static count=10;   /* Global variable - static is the default */&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;while (count--) &lt;br /&gt;{&lt;br /&gt;func();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void func( void )&lt;br /&gt;{&lt;br /&gt;static i = 5;&lt;br /&gt;i++;&lt;br /&gt;printf("i is %d and count is %d\n", i, count);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This will produce following result&lt;br /&gt;&lt;br /&gt;i is 6 and count is 9&lt;br /&gt;i is 7 and count is 8&lt;br /&gt;i is 8 and count is 7&lt;br /&gt;i is 9 and count is 6&lt;br /&gt;i is 10 and count is 5&lt;br /&gt;i is 11 and count is 4&lt;br /&gt;i is 12 and count is 3&lt;br /&gt;i is 13 and count is 2&lt;br /&gt;i is 14 and count is 1&lt;br /&gt;i is 15 and count is 0 &lt;br /&gt;&lt;br /&gt;static variables can be 'seen' within all functions in this source file. At link time, the static variables defined here will not be seen by the object modules that are brought in.&lt;br /&gt;&lt;br /&gt;static can also be defined within a function. If this is done the variable is initialized at run time but is not reinitialized when the function is called. This inside a function static variable retains its value during various calls.&lt;br /&gt;&lt;br /&gt; void func(void);&lt;br /&gt;&lt;br /&gt;static count=10;    /* Global variable - static is the default */&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;while (count--) &lt;br /&gt;{&lt;br /&gt;func();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void func( void )&lt;br /&gt;{&lt;br /&gt;static i = 5;&lt;br /&gt;i++;&lt;br /&gt;printf("i is %d and count is %d\n", i, count);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This will produce following result&lt;br /&gt;&lt;br /&gt;i is 6 and count is 9&lt;br /&gt;i is 7 and count is 8&lt;br /&gt;i is 8 and count is 7&lt;br /&gt;i is 9 and count is 6&lt;br /&gt;i is 10 and count is 5&lt;br /&gt;i is 11 and count is 4&lt;br /&gt;i is 12 and count is 3&lt;br /&gt;i is 13 and count is 2&lt;br /&gt;i is 14 and count is 1&lt;br /&gt;i is 15 and count is 0 &lt;br /&gt;&lt;br /&gt;NOTE : Here keyword void means function does not return anything and it does not take any parameter. You can memories void as nothing. static variables are initialized to 0 automatically.&lt;br /&gt;&lt;br /&gt;Definition vs. Declaration :&lt;br /&gt;Before proceeding, let us understand the difference between definition and declaration of a variable or function. Definition means where a variable or function is defined in reality and actual memory is allocated for variable or function. Declaration means just giving a reference of a variable and function. Through declaration we assure to the complier that this variable or function has been defined somewhere else in the program and will be provided at the time of linking. In the above examples char *func(void) has been put at the top which is a declaration of this function where as this function has been defined below to main() function.&lt;br /&gt;&lt;br /&gt;There is one more very important use for 'static'. Consider this bit of code.&lt;br /&gt;&lt;br /&gt;char *func(void);&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char *Text1;&lt;br /&gt;Text1 = func();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;char *func(void)&lt;br /&gt;{&lt;br /&gt;char Text2[10]="martin";&lt;br /&gt;return(Text2);&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Now, 'func' returns a pointer to the memory location where 'text2' starts BUT text2 has a storage class of 'auto' and will disappear when we exit the function and could be overwritten but something else. The answer is to specify&lt;br /&gt;&lt;br /&gt; static char Text[10]="martin"; &lt;br /&gt;&lt;br /&gt;The storage assigned to 'text2' will remain reserved for the duration if the program.&lt;br /&gt;&lt;br /&gt;extern - Storage Class&lt;br /&gt;extern is used to give a reference of a global variable that is visible to ALL the program files. When you use 'extern' the variable cannot be initialized as all it does is point the variable name at a storage location that has been previously defined.&lt;br /&gt;&lt;br /&gt;When you have multiple files and you define a global variable or function which will be used in other files also, then extern will be used in another file to give reference of defined variable or function. Just for understanding extern is used to declare a global variable or function in another files.&lt;br /&gt;&lt;br /&gt;File 1: main.c&lt;br /&gt;&lt;br /&gt;int count=5;&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;write_extern();&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;File 2: write.c&lt;br /&gt;&lt;br /&gt;void write_extern(void);&lt;br /&gt;&lt;br /&gt;extern int count;&lt;br /&gt;&lt;br /&gt;void write_extern(void)&lt;br /&gt;{&lt;br /&gt;printf("count is %i\n", count);&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Here extern keyword is being used to declare count in another file.&lt;br /&gt;&lt;br /&gt;Now compile these two files as follows&lt;br /&gt;&lt;br /&gt; gcc main.c write.c -o write &lt;br /&gt;&lt;br /&gt;This fill produce write program which can be executed to produce result.&lt;br /&gt;&lt;br /&gt;Count in 'main.c' will have a value of 5. If main.c changes the value of count - write.c will see the new value&lt;br /&gt;&lt;br /&gt;NEXT &gt;&gt; Using Constants&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7.Using Constants&lt;br /&gt;A C constant is usually just the written version of a number. For example 1, 0, 5.73, 12.5e9. We can specify our constants in octal or hexadecimal, or force them to be treated as long integers.&lt;br /&gt;&lt;br /&gt;Octal constants are written with a leading zero - 015.&lt;br /&gt;&lt;br /&gt;Hexadecimal constants are written with a leading 0x - 0x1ae.&lt;br /&gt;&lt;br /&gt;Long constants are written with a trailing L - 890L.&lt;br /&gt;&lt;br /&gt;Character constants are usually just the character enclosed in single quotes; 'a', 'b', 'c'. Some characters can't be represented in this way, so we use a 2 character sequence as follows.&lt;br /&gt;&lt;br /&gt;'\n' newline &lt;br /&gt;'\t' tab &lt;br /&gt;'\\' backslash &lt;br /&gt;'\'' single quote &lt;br /&gt;'\0' null ( Used automatically to terminate character string ) &lt;br /&gt;&lt;br /&gt;In addition, a required bit pattern can be specified using its octal equivalent.&lt;br /&gt;&lt;br /&gt;'\044' produces bit pattern 00100100.&lt;br /&gt;&lt;br /&gt;Character constants are rarely used, since string constants are more convenient. A string constant is surrounded by double quotes eg "Brian and Dennis". The string is actually stored as an array of characters. The null character '\0' is automatically placed at the end of such a string to act as a string terminator.&lt;br /&gt;&lt;br /&gt;A character is a different type to a single character string. This is important point to note.&lt;br /&gt;&lt;br /&gt;Defining Constants&lt;br /&gt;ANSI C allows you to declare constants. When you declare a constant it is a bit like a variable declaration except the value cannot be changed.&lt;br /&gt;&lt;br /&gt;The const keyword is to declare a constant, as shown below:&lt;br /&gt;&lt;br /&gt;int const a = 1;&lt;br /&gt;const int a =2; &lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;You can declare the const before or after the type. Choose one an stick to it.&lt;br /&gt;It is usual to initialize a const with a value as it cannot get a value any other way.&lt;br /&gt;&lt;br /&gt;The preprocessor #define is another more flexible (see Preprocessor Chapters) method to define constants in a program.&lt;br /&gt;&lt;br /&gt;#define TRUE            1&lt;br /&gt;#define FALSE           0&lt;br /&gt;#define NAME_SIZE   20 &lt;br /&gt;&lt;br /&gt;Here TRUE, FALSE and NAME_SIZE are constant&lt;br /&gt;&lt;br /&gt;You frequently see const declaration in function parameters. This says simply that the function is not going to change the value of the parameter.&lt;br /&gt;&lt;br /&gt;The following function definition used concepts we have not met (see chapters on functions, strings, pointers, and standard libraries) but for completeness of this section it is is included here:&lt;br /&gt;&lt;br /&gt;void strcpy(char *buffer, char const *string) &lt;br /&gt;&lt;br /&gt;The enum Data type&lt;br /&gt;enum is the abbreviation for ENUMERATE, and we can use this keyword to declare and initialize a sequence of integer constants. Here's an example:&lt;br /&gt;&lt;br /&gt;enum colors {RED, YELLOW, GREEN, BLUE}; &lt;br /&gt;&lt;br /&gt;I've made the constant names uppercase, but you can name them which ever way you want. &lt;br /&gt;&lt;br /&gt;Here, colors is the name given to the set of constants - the name is optional. Now, if you don't assign a value to a constant, the default value for the first one in the list - RED in our case, has the value of 0. The rest of the undefined constants have a value 1 more than the one before, so in our case, YELLOW is 1, GREEN is 2 and BLUE is 3. &lt;br /&gt;&lt;br /&gt;But you can assign values if you wanted to:&lt;br /&gt;&lt;br /&gt;enum colors {RED=1, YELLOW, GREEN=6, BLUE }; &lt;br /&gt;&lt;br /&gt;Now RED=1, YELLOW=2, GREEN=6 and BLUE=7. &lt;br /&gt;&lt;br /&gt;The main advantage of enum is that if you don't initialize your constants, each one would have a unique value. The first would be zero and the rest would then count upwards. &lt;br /&gt;&lt;br /&gt;You can name your constants in a weird order if you really wanted...&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;enum {RED=5, YELLOW, GREEN=4, BLUE};&lt;br /&gt;&lt;br /&gt;printf("RED = %d\n", RED);&lt;br /&gt;printf("YELLOW = %d\n", YELLOW);&lt;br /&gt;printf("GREEN = %d\n", GREEN);&lt;br /&gt;printf("BLUE = %d\n", BLUE);&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This will produce following results&lt;br /&gt;&lt;br /&gt;RED = 5&lt;br /&gt;YELLOW = 6&lt;br /&gt;GREEN = 4&lt;br /&gt;BLUE = 5 &lt;br /&gt;8.Operator Types&lt;br /&gt;What is Operator? Simple answer can be given using expression 4 + 5 is equal to 9. Here 4 and 5 are called operands and + is called operator. C language supports following type of operators.&lt;br /&gt;&lt;br /&gt;Arithmetic Operators&lt;br /&gt;&lt;br /&gt;Logical (or Relational) Operators&lt;br /&gt;&lt;br /&gt;Bitwise Operators&lt;br /&gt;&lt;br /&gt;Assignment Operators&lt;br /&gt;&lt;br /&gt;Misc Operators&lt;br /&gt;&lt;br /&gt;Lets have a look on all operators one by one.&lt;br /&gt;&lt;br /&gt;Arithmetic Operators:&lt;br /&gt;There are following arithmetic operators supported by C language:&lt;br /&gt;&lt;br /&gt;Assume variable A holds 10 and variable holds 20 then:&lt;br /&gt;Show Examples&lt;br /&gt;&lt;br /&gt;Operator Description Example &lt;br /&gt;+ Adds two operands A + B will give 30 &lt;br /&gt;- Subtracts second operand from the first A - B will give -10 &lt;br /&gt;* Multiply both operands A * B will give 200 &lt;br /&gt;/ Divide numerator by denominator B / A will give 2 &lt;br /&gt;% Modulus Operator and remainder of after an integer division B % A will give 0 &lt;br /&gt;++ Increment operator, increases integer value by one A++ will give 11 &lt;br /&gt;-- Decrement operator, decreases integer value by one A-- will give 9 &lt;br /&gt;&lt;br /&gt;Logical (or Relational) Operators:&lt;br /&gt;There are following logical operators supported by C language&lt;br /&gt;&lt;br /&gt;Assume variable A holds 10 and variable holds 20 then:&lt;br /&gt;Show Examples&lt;br /&gt;&lt;br /&gt;Operator  Description Example &lt;br /&gt;== Checks if the value of two operands is equal or not, if yes then condition becomes true. (A == B) is not true. &lt;br /&gt;!= Checks if the value of two operands is equal or not, if values are not equal then condition becomes true. (A != B) is true. &lt;br /&gt;&gt; Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true. (A &gt; B) is not true. &lt;br /&gt;&lt; Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true. (A &lt; B) is true. &gt;= Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true. (A &gt;= B) is not true. &lt;br /&gt;&lt;= Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true. (A &lt;= B) is true. &amp;&amp; Called Logical AND operator. If both the operands are non zero then then condition becomes true. (A &amp;&amp; B) is true. || Called Logical OR Operator. If any of the two operands is non zero then then condition becomes true. (A || B) is true. ! Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true then Logical NOT operator will make false. !(A &amp;&amp; B) is false. 8.Bitwise Operators:Bitwise operator works on bits and perform bit by bit operation.Assume if B = 60; and B = 13; Now in binary format they will be as follows:A = 0011 1100B = 0000 1101-----------------A&amp;B = 0000 1000A|B = 0011 1101A^B = 0011 0001~A = 1100 0011Show ExamplesThere are following Bitwise operators supported by C languageOperator Description Example &amp; Binary AND Operator copies a bit to the result if it exists in both operands. (A &amp; B) will give 12 which is 0000 1100 | Binary OR Operator copies a bit if it exists in either operand. (A | B) will give 61 which is 0011 1101 ^ Binary XOR Operator copies the bit if it is set in one operand but not both. (A ^ B) will give 49 which is 0011 0001 ~ Binary Ones Complement Operator is unary and has the effect of 'flipping' bits. (~A ) will give -60 which is 1100 0011 &lt;&lt; Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. A &lt;&lt; 2 will give 240 which is 1111 0000 &gt;&gt; Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. A &gt;&gt; 2 will give 15 which is 0000 1111 &lt;br /&gt;&lt;br /&gt;Assignment Operators:&lt;br /&gt;There are following assignment operators supported by C language:&lt;br /&gt;Show Examples&lt;br /&gt;&lt;br /&gt;Operator Description Example &lt;br /&gt;= Simple assignment operator, Assigns values from right side operands to left side operand C = A + B will assign value of A + B into C &lt;br /&gt;+= Add AND assignment operator, It adds right operand to the left operand and assign the result to left operand C += A is equivalent to C = C + A &lt;br /&gt;-= Subtract AND assignment operator, It subtracts right operand from the left operand and assign the result to left operand C -= A is equivalent to C = C - A &lt;br /&gt;*= Multiply AND assignment operator, It multiplies right operand with the left operand and assign the result to left operand C *= A is equivalent to C = C * A &lt;br /&gt;/= Divide AND assignment operator, It divides left operand with the right operand and assign the result to left operand C /= A is equivalent to C = C / A &lt;br /&gt;%= Modulus AND assignment operator, It takes modulus using two operands and assign the result to left operand C %= A is equivalent to C = C % A &lt;br /&gt;&lt;&lt;= Left shift AND assignment operator C &lt;&lt;= 2 is same as C = C &lt;&lt; 2 &gt;&gt;= Right shift AND assignment operator C &gt;&gt;= 2 is same as C = C &gt;&gt; 2 &lt;br /&gt;&amp;= Bitwise AND assignment operator C &amp;= 2 is same as C = C &amp; 2 &lt;br /&gt;^= bitwise exclusive OR and assignment operator C ^= 2 is same as C = C ^ 2 &lt;br /&gt;|= bitwise inclusive OR and assignment operator C |= 2 is same as C = C | 2 &lt;br /&gt;&lt;br /&gt;Short Notes on L-VALUE and R-VALUE:&lt;br /&gt;x = 1; takes the value on the right (e.g. 1) and puts it in the memory referenced by x. Here x and 1 are known as L-VALUES and R-VALUES respectively L-values can be on either side of the assignment operator where as R-values only appear on the right.&lt;br /&gt;&lt;br /&gt;So x is an L-value because it can appear on the left as we've just seen, or on the right like this: y = x; However, constants like 1 are R-values because 1 could appear on the right, but 1 = x; is invalid.&lt;br /&gt;&lt;br /&gt;Misc Operators&lt;br /&gt;There are few other operators supported by C Language.&lt;br /&gt;Show Examples&lt;br /&gt;&lt;br /&gt;Operator Description Example &lt;br /&gt;sizeof() Returns the size of an variable. sizeof(a), where a is integer, will return 4. &lt;br /&gt;&amp; Returns the address of an variable. &amp;a; will give actual address of the variable. &lt;br /&gt;* Pointer to a variable. *a; will pointer to a variable &lt;br /&gt;? : Conditional Expression If Condition is true ? Then value X : Otherwise value Y &lt;br /&gt;&lt;br /&gt;Operators Categories:&lt;br /&gt;All the operators we have discussed above can be categorized into following categories:&lt;br /&gt;&lt;br /&gt;Postfix operators, which follow a single operand.&lt;br /&gt;&lt;br /&gt;Unary prefix operators, which precede a single operand.&lt;br /&gt;&lt;br /&gt;Binary operators, which take two operands and perform a variety of arithmetic and logical operations.&lt;br /&gt;&lt;br /&gt;The conditional operator (a ternary operator), which takes three operands and evaluates either the second or third expression, depending on the evaluation of the first expression.&lt;br /&gt;&lt;br /&gt;Assignment operators, which assign a value to a variable.&lt;br /&gt;&lt;br /&gt;The comma operator, which guarantees left-to-right evaluation of comma-separated expressions.&lt;br /&gt;&lt;br /&gt;Precedence of C Operators:&lt;br /&gt;Operator precedence determines the grouping of terms in an expression. This affects how an expression is evaluated. Certain operators have higher precedence than others; for example, the multiplication operator has higher precedence than the addition operator:&lt;br /&gt;&lt;br /&gt;For example x = 7 + 3 * 2; Here x is assigned 13, not 20 because operator * has higher precedence than + so it first get multiplied with 3*2 and then adds into 7.&lt;br /&gt;&lt;br /&gt;Here operators with the highest precedence appear at the top of the table, those with the lowest appear at the bottom. Within an expression, higher precedence operators will be evaluated first.&lt;br /&gt;&lt;br /&gt;Category  Operator  Associativity  &lt;br /&gt;Postfix () [] -&gt; . ++ - -  Left to right  &lt;br /&gt;Unary  + - ! ~ ++ - - (type) * &amp; sizeof  Right to left  &lt;br /&gt;Multiplicative  * / %  Left to right  &lt;br /&gt;Additive + -  Left to right  &lt;br /&gt;Shift  &lt;&lt; &gt;&gt;  Left to right  &lt;br /&gt;Relational  &lt; &lt;= &gt; &gt;=  Left to right  &lt;br /&gt;Equality  == !=  Left to right  &lt;br /&gt;Bitwise AND &amp;  Left to right  &lt;br /&gt;Bitwise XOR ^ Left to right  &lt;br /&gt;Bitwise OR  |  Left to right  &lt;br /&gt;Logical AND  &amp;&amp;  Left to right  &lt;br /&gt;Logical OR || Left to right  &lt;br /&gt;Conditional  ?: Right to left  &lt;br /&gt;Assignment  = += -= *= /= %= &gt;&gt;= &lt;&lt;= &amp;= ^= |= Right to left  Comma  ,  Left to right  9.Flow Control StatementsC provides two styles of flow control:BranchingLoopingBranching is deciding what actions to take and looping is deciding how many times to take a certain action.Branching:Branching is so called because the program chooses to follow one branch or another.if statementThis is the most simple form of the branching statements.It takes an expression in parenthesis and an statement or block of statements. if the expression is true then the statement or block of statements gets executed otherwise these statements are skipped.NOTE: Expression will be assumed to be true if its evaluated values is non-zero.if statements take the following form:Show Exampleif (expression)statement;orif (expression){Block of statements;}orif (expression){Block of statements;}else{Block of statements;}orif (expression){Block of statements;}else if(expression){Block of statements;}else{Block of statements;} ? : OperatorThe ? : operator is just like an if ... else statement except that because it is an operator you can use it within expressions.? : is a ternary operator in that it takes three values, this is the only ternary operator C has.? : takes the following form:Show Exampleif condition is true ? then X return value : otherwise Y value; switch statement:The switch statement is much like a nested if .. else statement. Its mostly a matter of preference which you use, switch statement can be slightly more efficient and easier to read.Show Exampleswitch( expression ){case constant-expression1: statements1;[case constant-expression2: statements2;] [case constant-expression3: statements3;][default : statements4;]} Using break keyword:If a condition is met in switch case then execution continues on into the next case clause also if it is not explicitly specified that the execution should exit the switch statement. This is achieved by using break keyword.What is default condition:If none of the listed conditions is met then default condition executed.10.LoopingLoops provide a way to repeat commands and control how many times they are repeated. C provides a number of looping way.while loopThe most basic loop in C is the while loop. A while statement is like a repeating if statement. Like an If statement, if the test condition is true: the statements get executed. The difference is that after the statements have been executed, the test condition is checked again. If it is still true the statements get executed again. This cycle repeats until the test condition evaluates to false.Basic syntax of while loop is as follows:Show Examplewhile ( expression ){Single statement orBlock of statements;} for loopfor loop is similar to while, it's just written differently. for statements are often used to process lists such a range of numbers:Basic syntax of for loop is as follows:Show Examplefor( expression1; expression2; expression3){Single statementorBlock of statements;} In the above syntax:expression1 - Initializes variables.expression2 - Conditional expression, as long as this condition is true, loop will keep executing.expression3 - expression3 is the modifier which may be simple increment of a variable.do...while loopdo ... while is just like a while loop except that the test condition is checked at the end of the loop rather than the start. This has the effect that the content of the loop are always executed at least once.Basic syntax of do...while loop is as follows:Show Exampledo{Single statementorBlock of statements;}while(expression); break and continue statementsC provides two commands to control how we loop:break -- exit form loop or switch.continue -- skip 1 iteration of loop.You already have seen example of using break statement. Here is an example showing usage of continue statement.#include main(){int i;int j = 10;for( i = 0; i &lt;= j; i ++ ){if( i == 5 ){continue;}printf("Hello %d\n", i );}} This will produce following output:Hello 0Hello 1Hello 2Hello 3Hello 4Hello 6Hello 7Hello 8Hello 9Hello 10 11.Input and OutputInput : In any programming language input means to feed some data into program. This can be given in the form of file or from command line. C programming language provides a set of built-in functions to read given input and feed it to the program as per requirement.Output : In any programming language output means to display some data on screen, printer or in any file. C programming language provides a set of built-in functions to output required data.printf() functionThis is one of the most frequently used functions in C for output. ( we will discuss what is function in subsequent chapter. ).Try following program to understand printf() function.#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int dec = 5;&lt;br /&gt;char str[] = "abc";&lt;br /&gt;char ch = 's';&lt;br /&gt;float pi = 3.14;&lt;br /&gt;&lt;br /&gt;printf("%d %s %f %c\n", dec, str, pi, ch);&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;The output of the above would be:&lt;br /&gt;&lt;br /&gt; 5 abc 3.140000 c &lt;br /&gt;&lt;br /&gt;Here %d is being used to print an integer, %s is being usedto print a string, %f is being used to print a float and %c is being used to print a character.&lt;br /&gt;&lt;br /&gt;scanf() function&lt;br /&gt;This is the function which can be used to to read an input from the command line.&lt;br /&gt;&lt;br /&gt;Try following program to understand scanf() function.&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int x;&lt;br /&gt;int args;&lt;br /&gt;&lt;br /&gt;printf("Enter an integer: ");&lt;br /&gt;if (( args = scanf("%d", &amp;x)) == 0)&lt;br /&gt;{&lt;br /&gt;printf("Error: not an integer\n");&lt;br /&gt;} else {&lt;br /&gt;printf("Read in %d\n", x);&lt;br /&gt;}&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Here %d is being used to read an integer value and we are passing &amp;x to store the vale read input. Here &amp;indicates the address of variable x.&lt;br /&gt;&lt;br /&gt;This program will prompt you to enter a value. Whatever value you will enter at command prompt that will be output at the screen using printf() function. If you enter a non-integer value then it will display an error message.&lt;br /&gt;&lt;br /&gt;Enter an integer: 20&lt;br /&gt;Read in 20 &lt;br /&gt;13.Pointing to Data&lt;br /&gt;A pointer is a special kind of variable. Pointers are designed for storing memory address i.e. the address of another variable. Declaring a pointer is the same as declaring a normal variable except you stick an asterisk '*' in front of the variables identifier. &lt;br /&gt;&lt;br /&gt;There are two new operators you will need to know to work with pointers. The "address of" operator '&amp;' and the "dereferencing" operator '*'. Both are prefix unary operators.&lt;br /&gt;&lt;br /&gt;When you place an ampersand in front of a variable you will get it's address, this can be stored in a pointer variable.&lt;br /&gt;&lt;br /&gt;When you place an asterisk in front of a pointer you will get the value at the memory address pointed to.&lt;br /&gt;&lt;br /&gt;Here is an example to understand what I have stated above.&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;int my_variable = 6, other_variable = 10;&lt;br /&gt;int *my_pointer;&lt;br /&gt;&lt;br /&gt;printf("the address of my_variable is : %p\n", &amp;my_variable);&lt;br /&gt;printf("the address of other_variable is : %p\n", &amp;other_variable);&lt;br /&gt;&lt;br /&gt;my_pointer = &amp;my_variable;&lt;br /&gt;&lt;br /&gt;printf("\nafter \"my_pointer = &amp;my_variable\":\n");&lt;br /&gt;printf("\tthe value of my_pointer is %p\n", my_pointer);&lt;br /&gt;printf("\tthe value at that address is %d\n", *my_pointer);&lt;br /&gt;&lt;br /&gt;my_pointer = &amp;other_variable;&lt;br /&gt;&lt;br /&gt;printf("\nafter \"my_pointer = &amp;other_variable\":\n");&lt;br /&gt;printf("\tthe value of my_pointer is %p\n", my_pointer);&lt;br /&gt;printf("\tthe value at that address is %d\n", *my_pointer);&lt;br /&gt;&lt;br /&gt;return 0;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;This will produce following result.&lt;br /&gt;&lt;br /&gt;the address of my_variable is : 0xbfffdac4&lt;br /&gt;the address of other_variable is : 0xbfffdac0&lt;br /&gt;&lt;br /&gt;after "my_pointer = &amp;my_variable":&lt;br /&gt;the value of my_pointer is 0xbfffdac4&lt;br /&gt;the value at that address is 6&lt;br /&gt;&lt;br /&gt;after "my_pointer = &amp;other_variable":&lt;br /&gt;the value of my_pointer is 0xbfffdac0&lt;br /&gt;the value at that address is 10 &lt;br /&gt;&lt;br /&gt;Pointers and Arrays&lt;br /&gt;The most frequent use of pointers in C is for walking efficiently along arrays. In fact, in the implementation of an array, the array name represents the address of the zeroth element of the array, so you can't use it on the left side of an expression. For example:&lt;br /&gt;&lt;br /&gt; char *y;&lt;br /&gt;char x[100]; &lt;br /&gt;&lt;br /&gt;y is of type pointer to character (although it doesn't yet point anywhere). We can make y point to an element of x by either of&lt;br /&gt;&lt;br /&gt; y = &amp;x[0];&lt;br /&gt;y = x; &lt;br /&gt;&lt;br /&gt;Since x is the address of x[0] this is legal and consistent. Now `*y' gives x[0]. More importantly notice the following:&lt;br /&gt;&lt;br /&gt; *(y+1) gives x[1]&lt;br /&gt;*(y+i) gives x[i]&lt;br /&gt;&lt;br /&gt;and the sequence&lt;br /&gt;&lt;br /&gt;y = &amp;x[0];&lt;br /&gt;y++;&lt;br /&gt;&lt;br /&gt;leaves y pointing at x[1]. &lt;br /&gt;&lt;br /&gt;Pointer Arithmetic:&lt;br /&gt;C is one of the few languages that allows pointer arithmetic. In other words, you actually move the pointer reference by an arithmetic operation. For example:&lt;br /&gt;&lt;br /&gt;int x = 5, *ip = &amp;x;&lt;br /&gt;&lt;br /&gt;ip++; &lt;br /&gt;&lt;br /&gt;On a typical 32-bit machine, *ip would be pointing to 5 after initialization. But ip++; increments the pointer 32-bits or 4-bytes. So whatever was in the next 4-bytes, *ip would be pointing at it.&lt;br /&gt;&lt;br /&gt;Pointer arithmetic is very useful when dealing with arrays, because arrays and pointers share a special relationship in C.&lt;br /&gt;&lt;br /&gt;15.Using Pointer Arithmetic With Arrays:&lt;br /&gt;Arrays occupy consecutive memory slots in the computer's memory. This is where pointer arithmetic comes in handy - if you create a pointer to the first element, incrementing it one step will make it point to the next element.&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;int *ptr;&lt;br /&gt;int arrayInts[10] = {1,2,3,4,5,6,7,8,9,10};&lt;br /&gt;&lt;br /&gt;ptr = arrayInts; /* ptr = &amp;arrayInts[0]; is also fine */&lt;br /&gt;&lt;br /&gt;printf("The pointer is pointing to the first ");&lt;br /&gt;printf("array element, which is %d.\n", *ptr);&lt;br /&gt;printf("Let's increment it.....\n");&lt;br /&gt;&lt;br /&gt;ptr++;&lt;br /&gt;&lt;br /&gt;printf("Now it should point to the next element,");&lt;br /&gt;printf(" which is %d.\n", *ptr);&lt;br /&gt;printf("But suppose we point to the 3rd and 4th: %d %d.\n", &lt;br /&gt;*(ptr+1),*(ptr+2));&lt;br /&gt;&lt;br /&gt;ptr+=2;&lt;br /&gt;&lt;br /&gt;printf("Now skip the next 4 to point to the 8th: %d.\n", &lt;br /&gt;*(ptr+=4));&lt;br /&gt;&lt;br /&gt;ptr--;&lt;br /&gt;&lt;br /&gt;printf("Did I miss out my lucky number %d?!\n", *(ptr++));&lt;br /&gt;printf("Back to the 8th it is then..... %d.\n", *ptr);&lt;br /&gt;&lt;br /&gt;return 0;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;This will produce following result:&lt;br /&gt;&lt;br /&gt;The pointer is pointing to the first array element, which is 1.&lt;br /&gt;Let's increment it.....&lt;br /&gt;Now it should point to the next element, which is 2.&lt;br /&gt;But suppose we point to the 3rd and 4th: 3 4.&lt;br /&gt;Now skip the next 4 to point to the 8th: 8.&lt;br /&gt;Did I miss out my lucky number 7?!&lt;br /&gt;Back to the 8th it is then..... 8.  &lt;br /&gt;&lt;br /&gt;See more examples on Pointers and Array&lt;br /&gt;&lt;br /&gt;Modifying Variables Using Pointers:&lt;br /&gt;You know how to access the value pointed to using the dereference operator, but you can also modify the content of variables. To achieve this, put the dereferenced pointer on the left of the assignment operator, as shown in this example, which uses an array:&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;char *ptr;&lt;br /&gt;char arrayChars[8] = {'F','r','i','e','n','d','s','\0'};&lt;br /&gt;&lt;br /&gt;ptr = arrayChars;&lt;br /&gt;&lt;br /&gt;printf("The array reads %s.\n", arrayChars);&lt;br /&gt;printf("Let's change it..... ");&lt;br /&gt;&lt;br /&gt;*ptr = 'f'; /* ptr points to the first element */&lt;br /&gt;&lt;br /&gt;printf(" now it reads %s.\n", arrayChars);&lt;br /&gt;printf("The 3rd character of the array is %c.\n", &lt;br /&gt;*(ptr+=2));&lt;br /&gt;printf("Let's change it again..... ");&lt;br /&gt;&lt;br /&gt;*(ptr - 1) = ' ';&lt;br /&gt;&lt;br /&gt;printf("Now it reads %s.\n", arrayChars);&lt;br /&gt;return 0;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;This will produce following result:&lt;br /&gt;&lt;br /&gt;The array reads Friends.&lt;br /&gt;Let's change it..... now it reads friends.&lt;br /&gt;The 3rd character of the array is i.&lt;br /&gt;Let's change it again..... Now it reads f iends.  &lt;br /&gt;&lt;br /&gt;Generic Pointers: ( void Pointer )&lt;br /&gt;When a variable is declared as being a pointer to type void it is known as a generic pointer. Since you cannot have a variable of type void, the pointer will not point to any data and therefore cannot be dereferenced. It is still a pointer though, to use it you just have to cast it to another kind of pointer first. Hence the term Generic pointer. This is very useful when you want a pointer to point to data of different types at different times.&lt;br /&gt;&lt;br /&gt;Try the following code to understand Generic Pointers.&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;char c;&lt;br /&gt;void *the_data;&lt;br /&gt;&lt;br /&gt;i = 6;&lt;br /&gt;c = 'a';&lt;br /&gt;&lt;br /&gt;the_data = &amp;i;&lt;br /&gt;printf("the_data points to the integer value %d\n", &lt;br /&gt;*(int*) the_data);&lt;br /&gt;&lt;br /&gt;the_data = &amp;c;&lt;br /&gt;printf("the_data now points to the character %c\n", &lt;br /&gt;*(char*) the_data);&lt;br /&gt;&lt;br /&gt;return 0;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;NOTE-1 : Here in first print statement, the_data is prefixed by *(int*). This is called type casting in C language. Type is used to caste a variable from one data type to another datatype to make it compatible to the lvalue.&lt;br /&gt;&lt;br /&gt;NOTE-2 : lvalue is something which is used to left side of a statement and in which we can assign some value. A constant can't be an lvalue because we can not assign any value in contact. For example x = y, here x is lvalue and y is rvalue.&lt;br /&gt;&lt;br /&gt;However, above example will produce following result:&lt;br /&gt;&lt;br /&gt;the_data points to the integer value 6&lt;br /&gt;the_data now points to the character a &lt;br /&gt;&lt;br /&gt;NEXT &gt;&gt; Using Functions&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;16.Using Functions&lt;br /&gt;A function is a module or block of program code which deals with a particular task. Making functions is a way of isolating one block of code from other independent blocks of code.&lt;br /&gt;&lt;br /&gt;Functions serve two purposes.&lt;br /&gt;&lt;br /&gt;They allow a programmer to say: `this piece of code does a specific job which stands by itself and should not be mixed up with anything else',&lt;br /&gt;&lt;br /&gt;Second they make a block of code reusable since a function can be reused in many different contexts without repeating parts of the program text.&lt;br /&gt;&lt;br /&gt;A function can take a number of parameters, do required processing and then return a value. There may be a function which does not return any value.&lt;br /&gt;&lt;br /&gt;You already have seen couple of built-in functions like printf(); Similar way you can define your own functions in C language.&lt;br /&gt;&lt;br /&gt;Consider the following chunk of code&lt;br /&gt;&lt;br /&gt; int total = 10;&lt;br /&gt;printf("Hello World");&lt;br /&gt;total = total + l; &lt;br /&gt;&lt;br /&gt;To turn it into a function you simply wrap the code in a pair of curly brackets to convert it into a single compound statement and write the name that you want to give it in front of the brackets:&lt;br /&gt;&lt;br /&gt;Demo()&lt;br /&gt;{&lt;br /&gt;int total = 10;&lt;br /&gt;printf("Hello World");&lt;br /&gt;total = total + l;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;curved brackets after the function's name are required. You can pass one or more parameters to a function as follows:&lt;br /&gt;&lt;br /&gt;Demo( int par1, int par2)&lt;br /&gt;{&lt;br /&gt;int total = 10;&lt;br /&gt;printf("Hello World");&lt;br /&gt;total = total + l;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;By default function does not return anything. But you can make a function to return any value as follows:&lt;br /&gt;&lt;br /&gt;int Demo( int par1, int par2)&lt;br /&gt;{&lt;br /&gt;int total = 10;&lt;br /&gt;printf("Hello World");&lt;br /&gt;total = total + l;&lt;br /&gt;&lt;br /&gt;return total;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;A return keyword is used to return a value and datatype of the returned value is specified before the name of function. In this case function returns total which is int type. If a function does not return a value then void keyword can be used as return value.&lt;br /&gt;&lt;br /&gt;Once you have defined your function you can use it within a program:&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;Demo();&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Functions and Variables:&lt;br /&gt;Each function behaves the same way as C language standard function main(). So a function will have its own local variables defined. In the above example total variable is local to the function Demo.&lt;br /&gt;&lt;br /&gt;A global variable can be accessed in any function in similar way it is accessed in main() function&lt;br /&gt;17.Declaration and Definition&lt;br /&gt;When a function is defined at any place in the program then it is called function definition. At the time of definition of a function actual logic is implemented with-in the function.&lt;br /&gt;&lt;br /&gt;A function declaration does not have any body and they just have their interfaces.&lt;br /&gt;&lt;br /&gt;A function declaration is usually declared at the top of a C source file, or in a separate header file.&lt;br /&gt;&lt;br /&gt;A function declaration is sometime called function prototype or function signature. For the above Demo() function which returns an integer, and takes two parameters a function declaration will be as follows:&lt;br /&gt;&lt;br /&gt;int Demo( int par1, int par2); &lt;br /&gt;&lt;br /&gt;Passing Parameters to a Function&lt;br /&gt;There are two ways to pass parameters to a function:&lt;br /&gt;&lt;br /&gt;Pass by Value: mechanism is used when you don't want to change the value of passed parameters. When parameters are passed by value then functions in C create copies of the passed in variables and do required processing on these copied variables.&lt;br /&gt;&lt;br /&gt;Pass by Reference mechanism is used when you want a function to do the changes in passed parameters and reflect those changes back to the calling function. In this case only addresses of the variables are passed to a function so that function can work directly over the addresses.&lt;br /&gt;&lt;br /&gt;Here are two programs to understand the difference: First example is for Pass by value:&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;/* function declaration goes here.*/&lt;br /&gt;void swap( int p1, int p2 );&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;int a = 10;&lt;br /&gt;int b = 20;&lt;br /&gt;&lt;br /&gt;printf("Before: Value of a = %d and value of b = %d\n", a, b );&lt;br /&gt;swap( a, b );&lt;br /&gt;printf("After: Value of a = %d and value of b = %d\n", a, b );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void swap( int p1, int p2 )&lt;br /&gt;{&lt;br /&gt;int t;&lt;br /&gt;&lt;br /&gt;t = p2;&lt;br /&gt;p2 = p1;&lt;br /&gt;p1 = t;&lt;br /&gt;printf("Value of a (p1) = %d and value of b(p2) = %d\n", p1, p2 );&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Here is the result produced by the above example. Here the values of a and b remain unchanged before calling swap function and after calling swap function.&lt;br /&gt;&lt;br /&gt;Before: Value of a = 10 and value of b = 20&lt;br /&gt;Value of a (p1) = 20 and value of b(p2) = 10&lt;br /&gt;After: Value of a = 10 and value of b = 20 &lt;br /&gt;&lt;br /&gt;Following is the example which demonstrate the concept of pass by reference&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;/* function declaration goes here.*/&lt;br /&gt;void swap( int *p1, int *p2 );&lt;br /&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;int a = 10;&lt;br /&gt;int b = 20;&lt;br /&gt;&lt;br /&gt;printf("Before: Value of a = %d and value of b = %d\n", a, b );&lt;br /&gt;swap( &amp;a, &amp;b );&lt;br /&gt;printf("After: Value of a = %d and value of b = %d\n", a, b );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void swap( int *p1, int *p2 )&lt;br /&gt;{&lt;br /&gt;int t;&lt;br /&gt;&lt;br /&gt;t = *p2;&lt;br /&gt;*p2 = *p1;&lt;br /&gt;*p1 = t;&lt;br /&gt;printf("Value of a (p1) = %d and value of b(p2) = %d\n", *p1, *p2 );&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Here is the result produced by the above example. Here the values of a and b are changes after calling swap function.&lt;br /&gt;&lt;br /&gt;Before: Value of a = 10 and value of b = 20&lt;br /&gt;Value of a (p1) = 20 and value of b(p2) = 10&lt;br /&gt;After: Value of a = 20 and value of b = 10 &lt;br /&gt;18.Strings&lt;br /&gt;&lt;br /&gt;In C language Strings are defined as an array of characters or a pointer to a portion of memory containing ASCII characters. A string in C is a sequence of zero or more characters followed by a NULL '\0' character:&lt;br /&gt;&lt;br /&gt;It is important to preserve the NULL terminating character as it is how C defines and manages variable length strings. All the C standard library functions require this for successful operation.&lt;br /&gt;&lt;br /&gt;All the string handling functions are prototyped in: string.h or stdio.h standard header file. So while using any string related function, don't forget to include either stdio.h or string.h. May be your compiler differs so please check before going ahead.&lt;br /&gt;&lt;br /&gt;If you were to have an array of characters WITHOUT the null character as the last element, you'd have an ordinary character array, rather than a string constant.&lt;br /&gt;&lt;br /&gt;String constants have double quote marks around them, and can be assigned to char pointers as shown below. Alternatively, you can assign a string constant to a char array - either with no size specified, or you can specify a size, but don't forget to leave a space for the null character!&lt;br /&gt;&lt;br /&gt;char *string_1 = "Hello";&lt;br /&gt;char string_2[] = "Hello";&lt;br /&gt;char string_3[6] = "Hello"; &lt;br /&gt;&lt;br /&gt;Reading and Writing Strings:&lt;br /&gt;One possible way to read in a string is by using scanf. However, the problem with this, is that if you were to enter a string which contains one or more spaces, scanf would finish reading when it reaches a space, or if return is pressed. As a result, the string would get cut off. So we could use the gets function&lt;br /&gt;&lt;br /&gt;A gets takes just one argument - a char pointer, or the name of a char array, but don't forget to declare the array / pointer variable first! What's more, is that it automatically prints out a newline character, making the output a little neater.&lt;br /&gt;&lt;br /&gt;A puts function is similar to gets function in the way that it takes one argument - a char pointer. This also automatically adds a newline character after printing out the string. Sometimes this can be a disadvantage, so printf could be used instead.&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;int main() {&lt;br /&gt;char array1[50];&lt;br /&gt;char *array2;&lt;br /&gt;&lt;br /&gt;printf("Now enter another string less than 50");&lt;br /&gt;printf(" characters with spaces: \n");&lt;br /&gt;gets(array1);&lt;br /&gt;&lt;br /&gt;printf("\nYou entered: ");&lt;br /&gt;puts(array1);&lt;br /&gt;&lt;br /&gt;printf("\nTry entering a string less than 50");&lt;br /&gt;printf(" characters, with spaces: \n");&lt;br /&gt;scanf("%s", array2);&lt;br /&gt;&lt;br /&gt;printf("\nYou entered: %s\n", array2);&lt;br /&gt;&lt;br /&gt;return 0;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;This will produce following result:&lt;br /&gt;&lt;br /&gt;Now enter another string less than 50 characters with spaces:&lt;br /&gt;hello world&lt;br /&gt;&lt;br /&gt;You entered: hello world&lt;br /&gt;&lt;br /&gt;Try entering a string less than 50 characters, with spaces:&lt;br /&gt;hello world&lt;br /&gt;&lt;br /&gt;You entered: hello  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;String Manipulation Functions:&lt;br /&gt;&lt;br /&gt;char *strcpy (char *dest, char *src); &lt;br /&gt;Copy src string into dest string.&lt;br /&gt;&lt;br /&gt;char *strncpy(char *string1, char *string2, int n); &lt;br /&gt;Copy first n characters of string2 to stringl .&lt;br /&gt;&lt;br /&gt;int strcmp(char *string1, char *string2); &lt;br /&gt;Compare string1 and string2 to determine alphabetic order.&lt;br /&gt;&lt;br /&gt;int strncmp(char *string1, char *string2, int n); &lt;br /&gt;Compare first n characters of two strings.&lt;br /&gt;&lt;br /&gt;int strlen(char *string);&lt;br /&gt;Determine the length of a string.&lt;br /&gt;&lt;br /&gt;char *strcat(char *dest, const char *src); &lt;br /&gt;Concatenate string src to the string dest.&lt;br /&gt;&lt;br /&gt;char *strncat(char *dest, const char *src, int n); &lt;br /&gt;Concatenate n characters from string src to the string dest.&lt;br /&gt;&lt;br /&gt;char *strchr(char *string, int c); &lt;br /&gt;Find first occurrence of character c in string.&lt;br /&gt;&lt;br /&gt;char *strrchr(char *string, int c); &lt;br /&gt;Find last occurrence of character c in string.&lt;br /&gt;&lt;br /&gt;char *strstr(char *string2, char string*1); &lt;br /&gt;Find first occurrence of string string1 in string2.&lt;br /&gt;&lt;br /&gt;char *strtok(char *s, const char *delim) ;&lt;br /&gt;Parse the string s into tokens using delim as delimiter&lt;br /&gt;19.Structured Datatypes&lt;br /&gt;&lt;br /&gt;A structure in C is a collection of items of different types. You can think of a structure as a "record" is in Pascal or a class in Java without methods.&lt;br /&gt;&lt;br /&gt;Structures, or structs, are very useful in creating data structures larger and more complex than the ones we have discussed so far.&lt;br /&gt;&lt;br /&gt;Simply you can group various built-in data types into a structure.&lt;br /&gt;&lt;br /&gt;Object concepts was derived from Structure concept. You can achieve few object oriented goals using C structure but it is very complex.&lt;br /&gt;&lt;br /&gt;Following is the example how how to define a structure.&lt;br /&gt;&lt;br /&gt;struct student &lt;br /&gt;{&lt;br /&gt;char firstName[20];&lt;br /&gt;char lastName[20];&lt;br /&gt;char SSN[9];&lt;br /&gt;float gpa;&lt;br /&gt;}; &lt;br /&gt;&lt;br /&gt;Now you have a new datatype called student and you can use this datatype define your variables of student type:&lt;br /&gt;&lt;br /&gt;struct student student_a, student_b;&lt;br /&gt;&lt;br /&gt;or an array of students as&lt;br /&gt;&lt;br /&gt;struct student students[50]; &lt;br /&gt;&lt;br /&gt;Another way to declare the same thing is:&lt;br /&gt;&lt;br /&gt;struct {&lt;br /&gt;char firstName[20];&lt;br /&gt;char lastName[20];&lt;br /&gt;char SSN[10];&lt;br /&gt;float gpa;&lt;br /&gt;} student_a, student_b; &lt;br /&gt;&lt;br /&gt;All the variables inside an structure will be accessed using these values as student_a.firstName will give value of firstName variable. Similarly we can access other variables.&lt;br /&gt;&lt;br /&gt;Structure Example:&lt;br /&gt;Try out following example to understand the concept:&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;struct student {&lt;br /&gt;char firstName[20];&lt;br /&gt;char lastName[20];&lt;br /&gt;char SSN[10];&lt;br /&gt;float gpa;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;struct student student_a;&lt;br /&gt;&lt;br /&gt;strcpy(student_a.firstName, "Deo");&lt;br /&gt;strcpy(student_a.lastName, "Dum");&lt;br /&gt;strcpy(student_a.SSN, "2333234" );&lt;br /&gt;student_a.gpa = 2009.20;&lt;br /&gt;&lt;br /&gt;printf( "First Name: %s\n", student_a.firstName );&lt;br /&gt;printf( "Last Name: %s\n", student_a.lastName );&lt;br /&gt;printf( "SNN : %s\n", student_a.SSN );&lt;br /&gt;printf( "GPA : %f\n", student_a.gpa );&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;This will produce following results:&lt;br /&gt;&lt;br /&gt;First Name: Deo&lt;br /&gt;Last Name: Dum&lt;br /&gt;SSN : 2333234&lt;br /&gt;GPA : 2009. &lt;br /&gt;&lt;br /&gt;Pointers to Structs:&lt;br /&gt;Sometimes it is useful to assign pointers to structures (this will be evident in the next section with self-referential structures). Declaring pointers to structures is basically the same as declaring a normal pointer:&lt;br /&gt;&lt;br /&gt;struct student *student_a; &lt;br /&gt;&lt;br /&gt;To dereference, you can use the infix operator: -&gt;.&lt;br /&gt;&lt;br /&gt;printf("%s\n", student_a-&gt;SSN); &lt;br /&gt;&lt;br /&gt;typedef Keyword&lt;br /&gt;There is an easier way to define structs or you could "alias" types you create. For example:&lt;br /&gt;&lt;br /&gt;typedef struct{&lt;br /&gt;char firstName[20];&lt;br /&gt;char lastName[20];&lt;br /&gt;char SSN[10];&lt;br /&gt;float gpa;&lt;br /&gt;}student; &lt;br /&gt;&lt;br /&gt;Now you can use student directly to define variables of student type without using struct keyword. Following is the example:&lt;br /&gt;&lt;br /&gt;student student_a; &lt;br /&gt;&lt;br /&gt;You can use typedef for non-structs:&lt;br /&gt;&lt;br /&gt;typedef long int *pint32;&lt;br /&gt;&lt;br /&gt;pint32 x, y, z; &lt;br /&gt;&lt;br /&gt;x, y and z are all pointers to long ints&lt;br /&gt;&lt;br /&gt;Unions Datatype&lt;br /&gt;Unions are declared in the same fashion as structs, but have a fundamental difference. Only one item within the union can be used at any time, because the memory allocated for each item inside the union is in a shared memory location.&lt;br /&gt;&lt;br /&gt;Here is how we define a Union&lt;br /&gt;&lt;br /&gt;union Shape &lt;br /&gt;{&lt;br /&gt;int circle;&lt;br /&gt;int triangle;&lt;br /&gt;int ovel;&lt;br /&gt;}; &lt;br /&gt;&lt;br /&gt;We use union in such case where only one condition will be applied and only one variable will be used.&lt;br /&gt;&lt;br /&gt;Conclusion:&lt;br /&gt;You can create arrays of structs.&lt;br /&gt;Structs can be copied or assigned.&lt;br /&gt;The &amp; operator may be used with structs to show addresses.&lt;br /&gt;Structs can be passed into functions. Structs can also be returned from functions.&lt;br /&gt;Structs cannot be compared!&lt;br /&gt;Structures can store non-homogenous data types into a single collection, much like an array does for common data (except it isn't accessed in the same manner).&lt;br /&gt;Pointers to structs have a special infix operator: -&gt; for dereferencing the pointer.&lt;br /&gt;typedef can help you clear your code up and can help save some keystrokes&lt;br /&gt;20.Working with Files&lt;br /&gt;When accessing files through C, the first necessity is to have a way to access the files. For C File I/O you need to use a FILE pointer, which will let the program keep track of the file being accessed. For Example:&lt;br /&gt;&lt;br /&gt;FILE *fp; &lt;br /&gt;&lt;br /&gt;To open a file you need to use the fopen function, which returns a FILE pointer. Once you've opened a file, you can use the FILE pointer to let the compiler perform input and output functions on the file.&lt;br /&gt;&lt;br /&gt;FILE *fopen(const char *filename, const char *mode); &lt;br /&gt;&lt;br /&gt;Here filename is string literal which you will use to name your file and mode can have one of the following values&lt;br /&gt;&lt;br /&gt;w - open for writing (file need not exist)&lt;br /&gt;a - open for appending (file need not exist)&lt;br /&gt;r+ - open for reading and writing, start at beginning&lt;br /&gt;w+ - open for reading and writing (overwrite file)&lt;br /&gt;a+ - open for reading and writing (append if file exists) &lt;br /&gt;&lt;br /&gt;Note that it's possible for fopen to fail even if your program is perfectly correct: you might try to open a file specified by the user, and that file might not exist (or it might be write-protected). In those cases, fopen will return 0, the NULL pointer.&lt;br /&gt;&lt;br /&gt;Here's a simple example of using fopen:&lt;br /&gt;&lt;br /&gt;FILE *fp;&lt;br /&gt;&lt;br /&gt;fp=fopen("/home/techpreparation/test.txt", "r"); &lt;br /&gt;&lt;br /&gt;This code will open test.txt for reading in text mode. To open a file in a binary mode you must add a b to the end of the mode string; for example, "rb" (for the reading and writing modes, you can add the b either after the plus sign - "r+b" - or before - "rb+")&lt;br /&gt;&lt;br /&gt;To close a function you can use the function:&lt;br /&gt;&lt;br /&gt;int fclose(FILE *a_file); &lt;br /&gt;&lt;br /&gt;fclose returns zero if the file is closed successfully.&lt;br /&gt;&lt;br /&gt;An example of fclose is:&lt;br /&gt;&lt;br /&gt;fclose(fp); &lt;br /&gt;&lt;br /&gt;To work with text input and output, you use fprintf and fscanf, both of which are similar to their friends printf and scanf except that you must pass the FILE pointer as first argument. &lt;br /&gt;&lt;br /&gt;Try out following example:&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;FILE *fp;&lt;br /&gt;&lt;br /&gt;fp = fopen("/tmp/test.txt", "w");&lt;br /&gt;fprintf(fp, "This is testing...\n");&lt;br /&gt;fclose(fp;);&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;This will create a file test.txt in /tmp directory and will write This is testing in that file.&lt;br /&gt;&lt;br /&gt;Here is an example which will be used to read lines from a file:&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;FILE *fp;&lt;br /&gt;char buffer[20];&lt;br /&gt;&lt;br /&gt;fp = fopen("/tmp/test.txt", "r");&lt;br /&gt;fscanf(fp, "%s", buffer);&lt;br /&gt;printf("Read Buffer: %s\n", %buffer );&lt;br /&gt;flcose(fp;);&lt;br /&gt;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;It is also possible to read (or write) a single character at a time--this can be useful if you wish to perform character-by-character input. The fgetc function, which takes a file pointer, and returns an int, will let you read a single character from a file:&lt;br /&gt;&lt;br /&gt;int fgetc (FILE *fp); &lt;br /&gt;&lt;br /&gt;The fgetc returns an int. What this actually means is that when it reads a normal character in the file, it will return a value suitable for storing in an unsigned char (basically, a number in the range 0 to 255). On the other hand, when you're at the very end of the file, you can't get a character value--in this case, fgetc will return "EOF", which is a constant that indicates that you've reached the end of the file.&lt;br /&gt;&lt;br /&gt;The fputc function allows you to write a character at a time--you might find this useful if you wanted to copy a file character by character. It looks like this:&lt;br /&gt;&lt;br /&gt;int fputc( int c, FILE *fp ); &lt;br /&gt;&lt;br /&gt;Note that the first argument should be in the range of an unsigned char so that it is a valid character. The second argument is the file to write to. On success, fputc will return the value c, and on failure, it will return EOF.&lt;br /&gt;&lt;br /&gt;Binary I/O&lt;br /&gt;There are following two functions which will be used for binary input and output:&lt;br /&gt;&lt;br /&gt;size_t fread(void *ptr, size_t size_of_elements, &lt;br /&gt;size_t number_of_elements, FILE *a_file);&lt;br /&gt;&lt;br /&gt;size_t fwrite(const void *ptr, size_t size_of_elements, &lt;br /&gt;size_t number_of_elements, FILE *a_file); &lt;br /&gt;&lt;br /&gt;Both of these functions deal with blocks of memories - usually arrays. Because they accept pointers, you can also use these functions with other data structures; you can even write structs to a file or a read struct into memory.&lt;br /&gt;&lt;br /&gt;21.Bits Manipulation&lt;br /&gt;Bit manipulation is the act of algorithmically manipulating bits or other pieces of data shorter than a byte. C language is very efficient in manipulating bits.&lt;br /&gt;&lt;br /&gt;Here are following operators to perform bits manipulation:&lt;br /&gt;Bitwise Operators:&lt;br /&gt;&lt;br /&gt;Bitwise operator works on bits and perform bit by bit operation.&lt;br /&gt;&lt;br /&gt;Assume if B = 60; and B = 13; Now in binary format they will be as follows:&lt;br /&gt;&lt;br /&gt;A = 0011 1100&lt;br /&gt;&lt;br /&gt;B = 0000 1101&lt;br /&gt;&lt;br /&gt;-----------------&lt;br /&gt;&lt;br /&gt;A&amp;B = 0000 1000&lt;br /&gt;&lt;br /&gt;A|B = 0011 1101&lt;br /&gt;&lt;br /&gt;A^B = 0011 0001&lt;br /&gt;&lt;br /&gt;~A = 1100 0011&lt;br /&gt;&lt;br /&gt;Show Examples&lt;br /&gt;&lt;br /&gt;There are following Bitwise operators supported by C language&lt;br /&gt;&lt;br /&gt;Operator Description Example &lt;br /&gt;&amp; Binary AND Operator copies a bit to the result if it exists in both operands. (A &amp; B) will give 12 which is 0000 1100 &lt;br /&gt;| Binary OR Operator copies a bit if it exists in either operand. (A | B) will give 61 which is 0011 1101 &lt;br /&gt;^ Binary XOR Operator copies the bit if it is set in one operand but not both. (A ^ B) will give 49 which is 0011 0001 &lt;br /&gt;~ Binary Ones Complement Operator is unary and has the effect of 'flipping' bits. (~A ) will give -60 which is 1100 0011 &lt;br /&gt;&lt;&lt; Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. A &lt;&lt; 2 will give 240 which is 1111 0000 &gt;&gt; Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. A &gt;&gt; 2 will give 15 which is 0000 1111 &lt;br /&gt;&lt;br /&gt;The shift operators perform appropriate shift by operator on the right to the operator on the left. The right operator must be positive. The vacated bits are filled with zero.&lt;br /&gt;&lt;br /&gt;For example: x &lt;&lt; 2 shifts the bits in x by 2 places to the left.if x = 00000010 (binary) or 2 (decimal)then: x &gt;&gt;= 2 =&gt; x = 00000000 or just 0 (decimal)&lt;br /&gt;&lt;br /&gt;Also: if x = 00000010 (binary) or 2 (decimal) &lt;br /&gt;then&lt;br /&gt;x &lt;&lt;= 2 =&gt; x = 00001000 or 8 (decimal)  &lt;br /&gt;&lt;br /&gt;Therefore a shift left is equivalent to a multiplication by 2. Similarly a shift right is equal to division by 2. Shifting is much faster than actual multiplication (*) or division (/) by 2. So if you want fast multiplications or division by 2 use shifts.&lt;br /&gt;&lt;br /&gt;To illustrate many points of bitwise operators let us write a function, Bitcount, that counts bits set to 1 in an 8 bit number (unsigned char) passed as an argument to the function.&lt;br /&gt;&lt;br /&gt;int bitcount(unsigned char x) &lt;br /&gt;{ &lt;br /&gt;int count;&lt;br /&gt;&lt;br /&gt;for ( count=0; x != 0; x&gt;&gt;=1);&lt;br /&gt;{&lt;br /&gt;if ( x &amp; 01)&lt;br /&gt;count++;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;return count;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;This function illustrates many C program points:&lt;br /&gt;&lt;br /&gt;for loop not used for simple counting operation.&lt;br /&gt;&lt;br /&gt;x &gt;&gt;= 1 =&gt; x = x&gt;&gt; 1;&lt;br /&gt;&lt;br /&gt;for loop will repeatedly shift right x until x becomes 0&lt;br /&gt;&lt;br /&gt;use expression evaluation of x &amp; 01 to control if&lt;br /&gt;&lt;br /&gt;x &amp; 01 masks of 1st bit of x if this is 1 then count++&lt;br /&gt;&lt;br /&gt;Bit Fields&lt;br /&gt;Bit Fields allow the packing of data in a structure. This is especially useful when memory or data storage is at a premium. Typical examples:&lt;br /&gt;&lt;br /&gt;Packing several objects into a machine word. e.g. 1 bit flags can be compacted.&lt;br /&gt;&lt;br /&gt;Reading external file formats -- non-standard file formats could be read in. E.g. 9 bit integers.&lt;br /&gt;&lt;br /&gt;C allows us do this in a structure definition by putting :bit length after the variable. For example:&lt;br /&gt;&lt;br /&gt;struct packed_struct {&lt;br /&gt;unsigned int f1:1;&lt;br /&gt;unsigned int f2:1;&lt;br /&gt;unsigned int f3:1;&lt;br /&gt;unsigned int f4:1;&lt;br /&gt;unsigned int type:4;&lt;br /&gt;unsigned int my_int:9;&lt;br /&gt;} pack; &lt;br /&gt;&lt;br /&gt;Here the packed_struct contains 6 members: Four 1 bit flags f1..f3, a 4 bit type and a 9 bit my_int.&lt;br /&gt;&lt;br /&gt;C automatically packs the above bit fields as compactly as possible, provided that the maximum length of the field is less than or equal to the integer word length of the computer. If this is not the case then some compilers may allow memory overlap for the fields whilst other would store the next field in the next word&lt;br /&gt;22.Pre-Processors&lt;br /&gt;The C Preprocessor is not part of the compiler, but is a separate step in the compilation process. In simplistic terms, a C Preprocessor is just a text substitution tool. We'll refer to the C Preprocessor as the CPP.&lt;br /&gt;&lt;br /&gt;All preprocessor lines begin with #&lt;br /&gt;&lt;br /&gt;The unconditional directives are:&lt;br /&gt;#include - Inserts a particular header from another file&lt;br /&gt;#define - Defines a preprocessor macro&lt;br /&gt;#undef - Undefines a preprocessor macro&lt;br /&gt;&lt;br /&gt;The conditional directives are:&lt;br /&gt;#ifdef - If this macro is defined&lt;br /&gt;#ifndef - If this macro is not defined&lt;br /&gt;#if - Test if a compile time condition is true&lt;br /&gt;#else - The alternative for #if&lt;br /&gt;#elif - #else an #if in one statement&lt;br /&gt;#endif - End preprocessor conditional&lt;br /&gt;&lt;br /&gt;Other directives include:&lt;br /&gt;# - Stringization, replaces a macro parameter with a string constant&lt;br /&gt;## - Token merge, creates a single token from two adjacent ones&lt;br /&gt;&lt;br /&gt;Pre-Processors Examples:&lt;br /&gt;Analyze following examples to understand various directives&lt;br /&gt;&lt;br /&gt; #define MAX_ARRAY_LENGTH 20 &lt;br /&gt;&lt;br /&gt;Tells the CPP to replace instances of MAX_ARRAY_LENGTH with 20. Use #define for constants to increase readability.&lt;br /&gt;&lt;br /&gt; #include &lt;stdio.h&gt;&lt;br /&gt;#include "myheader.h" &lt;br /&gt;&lt;br /&gt;Tells the CPP to get stdio.h from System Libraries and add the text to this file. The next line tells CPP to get myheader.h from the local directory and add the text to the file.&lt;br /&gt;&lt;br /&gt; #undef FILE_SIZE&lt;br /&gt;#define FILE_SIZE 42 &lt;br /&gt;&lt;br /&gt;Tells the CPP to undefined FILE_SIZE and define it for 42.&lt;br /&gt;&lt;br /&gt;#ifndef MESSAGE&lt;br /&gt;#define MESSAGE "You wish!"&lt;br /&gt;#endif &lt;br /&gt;&lt;br /&gt;Tells the CPP to define MESSAGE only if MESSAGE isn't defined already.&lt;br /&gt;&lt;br /&gt; #ifdef DEBUG&lt;br /&gt;/* Your debugging statements here */&lt;br /&gt;#endif &lt;br /&gt;&lt;br /&gt;Tells the CPP to do the following statements if DEBUG is defined. This is useful if you pass the -DDEBUG flag to gcc. This will define DEBUG, so you can turn debugging on and off on the fly!&lt;br /&gt;&lt;br /&gt;Stringize (#):&lt;br /&gt;The stringize or number-sign operator ('#'), when used within a macro definition, converts a macro parameter into a string constant. This operator may be used only in a macro that has a specified argument or parameter list.&lt;br /&gt;&lt;br /&gt;When the stringize operator immediately precedes the name of one of the macro parameters, the parameter passed to the macro is enclosed within quotation marks and is treated as a string literal. For example:&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;#define message_for(a, b) \&lt;br /&gt;printf(#a " and " #b ": We love you!\n")&lt;br /&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;message_for(Carole, Debra);&lt;br /&gt;return 0;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;This will produce following result using stringization macro message_for&lt;br /&gt;&lt;br /&gt;Carole and Debra: We love you! &lt;br /&gt;&lt;br /&gt;Token Pasting (##):&lt;br /&gt;The token-pasting operator (##) within a macro definition combines two arguments. It permits two separate tokens in the macro definition to be joined into a single token.&lt;br /&gt;&lt;br /&gt;If the name of a macro parameter used in the macro definition is immediately preceded or followed by the token-pasting operator, the macro parameter and the token-pasting operator are replaced by the value of the passed parameter. Text that is adjacent to the token-pasting operator that is not the name of a macro parameter is not affected. For example:&lt;br /&gt;&lt;br /&gt;#define tokenpaster(n) printf ("token" #n " = %d", token##n)&lt;br /&gt;&lt;br /&gt;tokenpaster(34); &lt;br /&gt;&lt;br /&gt;This example results in the following actual output from the preprocessor:&lt;br /&gt;&lt;br /&gt;printf ("token34 = %d", token34); &lt;br /&gt;&lt;br /&gt;This example shows the concatenation of token##n into token34. Both the stringize and the token-pasting operators are used in this example.&lt;br /&gt;&lt;br /&gt;Parameterized Macros:&lt;br /&gt;One of the powerful functions of the CPP is the ability to simulate functions using parameterized macros. For example, we might have some code to square a number:&lt;br /&gt;&lt;br /&gt;int square(int x) &lt;br /&gt;{&lt;br /&gt;return x * x;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;We can instead rewrite this using a macro:&lt;br /&gt;&lt;br /&gt;#define square(x) ((x) * (x)) &lt;br /&gt;&lt;br /&gt;Macros with arguments must be defined using the #define directive before they can be used. The argument list is enclosed in parentheses and must immediately follow the macro name. Spaces are not allowed between and macro name and open parenthesis. For example:&lt;br /&gt;&lt;br /&gt;#define MAX(x,y) ((x) &gt; (y) ? (x) : (y)) &lt;br /&gt;&lt;br /&gt;Macro Caveats:&lt;br /&gt;&lt;br /&gt;Macro definitions are not stored in the object file. They are only active for the duration of a single source file starting when they are defined and ending when they are undefined (using #undef), redefined, or when the end of the source file is found.&lt;br /&gt;&lt;br /&gt;Macro definitions you wish to use in multiple source files may be defined in an include file which may be included in each source file where the macros are required.&lt;br /&gt;&lt;br /&gt;When a macro with arguments is invoked, the macro processor substitutes the arguments into the macro body and then processes the results again for additional macro calls. This makes it possible, but confusing, to piece together a macro call from the macro body and from the macro arguments.&lt;br /&gt;&lt;br /&gt;Most experienced C programmers enclose macro arguments in parentheses when they are used in the macro body. This technique prevents undesired grouping of compound expressions used as arguments and helps avoid operator precedence rules overriding the intended meaning of a macro.&lt;br /&gt;&lt;br /&gt;While a macro may contain references to other macros, references to itself are not expanded. Self-referencing macros are a special feature of ANSI Standard C in that the self-reference is not interpreted as a macro call. This special rule also applies to indirectly self-referencing macros (or macros that reference themselves through another macro).&lt;br /&gt;&lt;br /&gt;23.Useful Concepts&lt;br /&gt;Error Reporting:&lt;br /&gt;Many times it is useful to report errors in a C program. The standard library perror() is an easy to use and convenient function. It is used in conjunction with errno and frequently on encountering an error you may wish to terminate your program early. We will meet these concepts in other parts of the function reference chapter also.&lt;br /&gt;&lt;br /&gt;void perror(const char *message) - produces a message on standard error output describing the last error encountered.&lt;br /&gt;&lt;br /&gt;errno: - is a special system variable that is set if a system call cannot perform its set task. It is defined in #include &lt;errno.h&gt;.&lt;br /&gt;&lt;br /&gt;Predefined Streams:&lt;br /&gt;UNIX defines 3 predefined streams ie. virtual files&lt;br /&gt;&lt;br /&gt;stdin, stdout, stderr  &lt;br /&gt;&lt;br /&gt;They all use text a the method of I/O. stdin and stdout can be used with files, programs, I/O devices such as keyboard, console, etc.. stderr always goes to the console or screen.&lt;br /&gt;&lt;br /&gt;The console is the default for stdout and stderr. The keyboard is the default for stdin.&lt;br /&gt;&lt;br /&gt;Dynamic Memory Allocation:&lt;br /&gt;Dynamic allocation is a pretty unique feature to C. It enables us to create data types and structures of any size and length to suit our programs need within the program. We use dynamic memory allocation concept when we don't know how in advance about memory requirement.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There are following functions to use for dynamic memory manipulation:&lt;br /&gt;&lt;br /&gt;void *calloc(size_t num elems, size_t elem_size) - Allocate an array and initialise all elements to zero .&lt;br /&gt;&lt;br /&gt;void free(void *mem address) - Free a block of memory.&lt;br /&gt;&lt;br /&gt;void *malloc(size_t num bytes) - Allocate a block of memory.&lt;br /&gt;&lt;br /&gt;void *realloc(void *mem address, size_t newsize) - Reallocate (adjust size) a block of memory.&lt;br /&gt;&lt;br /&gt;Command Line Arguments:&lt;br /&gt;It is possible to pass arguments to C programs when they are executed. The brackets which follow main are used for this purpose. argc refers to the number of arguments passed, and argv[] is a pointer array which points to each argument which is passed to mainA simple example follows, which checks to see if a single argument is supplied on the command line when the program is invoked.&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.&gt;h&lt;br /&gt;main( int argc, char *argv[] ) &lt;br /&gt;{&lt;br /&gt;if( argc == 2 )&lt;br /&gt;printf("The argument supplied is %s\n", argv[1]);&lt;br /&gt;else if( argc &gt; 2 )&lt;br /&gt;printf("Too many arguments supplied.\n");&lt;br /&gt;else&lt;br /&gt;printf("One argument expected.\n");&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Note that *argv[0] is the name of the program invoked, which means that *argv[1] is a pointer to the first argument supplied, and *argv[n] is the last argument. If no arguments are supplied, argc will be one. Thus for n arguments, argc will be equal to n + 1. The program is called by the command line:&lt;br /&gt;&lt;br /&gt;$myprog argument1 &lt;br /&gt;&lt;br /&gt;More clearly, Suppose a program is compiled to an executable program myecho and that the program is executed with the following command.&lt;br /&gt;&lt;br /&gt;$myeprog aaa bbb ccc &lt;br /&gt;&lt;br /&gt;When this command is executed, the command interpreter calls the main() function of the myprog program with 4 passed as the argc argument and an array of 4 strings as the argv argument.&lt;br /&gt;&lt;br /&gt;argv[0]  -  "myprog"&lt;br /&gt;argv[1]  -  "aaa"&lt;br /&gt;argv[2]  -  "bbb"&lt;br /&gt;argv[3]  -  "ccc" &lt;br /&gt;&lt;br /&gt;Multidimensional Arrays:&lt;br /&gt;The array we used in the last example was a one dimensional array. Arrays can have more than one dimension, these arrays-of-arrays are called multidimensional arrays. They are very similar to standard arrays with the exception that they have multiple sets of square brackets after the array identifier. A two dimensional array can be though of as a grid of rows and columns.&lt;br /&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;const int num_rows = 7;&lt;br /&gt;const int num_columns = 5;&lt;br /&gt;&lt;br /&gt;int&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;int box[num_rows][num_columns];&lt;br /&gt;int row, column;&lt;br /&gt;&lt;br /&gt;for(row = 0; row &lt; num_rows; row++)for(column = 0; column &lt; num_columns; column++)box[row][column] = column + (row * num_columns);for(row = 0; row &lt; num_rows; row++){for(column = 0; column &lt; num_columns; column++){printf("%4d", box[row][column]);}printf("\n");}return 0;} This will produce following result: 0    1    2    3    45     6    7    8    910  11  12  13  1415  16  17  18  1920  21  22  23  2425  26  27  28  2930  31  32  33  34 The above array has two dimensions and can be called a doubly subscripted array. GCC allows arrays of up to 29 dimensions although actually using an array of more than three dimensions is very rare.24String Manipulation Functions:char *strcpy (char *dest, char *src); Copy src string into dest string.char *strncpy(char *string1, char *string2, int n); Copy first n characters of string2 to stringl .int strcmp(char *string1, char *string2); Compare string1 and string2 to determine alphabetic order.int strncmp(char *string1, char *string2, int n); Compare first n characters of two strings.int strlen(char *string);Determine the length of a string.char *strcat(char *dest, const char *src); Concatenate string src to the string dest.char *strncat(char *dest, const char *src, int n); Concatenate n characters from string src to the string dest.char *strchr(char *string, int c); Find first occurrence of character c in string.char *strrchr(char *string, int c); Find last occurrence of character c in string.char *strstr(char *string2, char string*1); Find first occurrence of string string1 in string2.char *strtok(char *s, const char *delim) ;Parse the string s into tokens using delim as delimiter.Memory Management Functions:void *calloc(int num elems, int elem_size); Allocate an array and initialise all elements to zero .void free(void *mem address); Free a block of memory.void *malloc(int num bytes); Allocate a block of memory.void *realloc(void *mem address, int newsize); Reallocate (adjust size) a block of memory.Buffer Manipulation:void* memcpy(void* s, const void* ct, int n); Copies n characters from ct to s and returns s. s may be corrupted if objects overlap.int memcmp(const void* cs, const void* ct, int n); Compares at most (the first) n characters of cs and ct, returning negative value if cs&lt;ct, zero if cs==ct, positive value if cs&gt;ct.&lt;br /&gt;&lt;br /&gt;void* memchr(const void* cs, int c, int n); &lt;br /&gt;Returns pointer to first occurrence of c in first n characters of cs, or NULL if not found.&lt;br /&gt;&lt;br /&gt;void* memset(void* s, int c, int n); &lt;br /&gt;Replaces each of the first n characters of s by c and returns s.&lt;br /&gt;&lt;br /&gt;void* memmove(void* s, const void* ct, int n); &lt;br /&gt;Copies n characters from ct to s and returns s. s will not be corrupted if objects overlap.&lt;br /&gt;&lt;br /&gt;Character Functions:&lt;br /&gt;&lt;br /&gt;int isalnum(int c); &lt;br /&gt;The function returns nonzero if c is alphanumeric&lt;br /&gt;&lt;br /&gt;int isalpha(int c); &lt;br /&gt;The function returns nonzero if c is alphabetic only&lt;br /&gt;&lt;br /&gt;int iscntrl(int c); &lt;br /&gt;The function returns nonzero if c is a control character&lt;br /&gt;&lt;br /&gt;int isdigit(int c); &lt;br /&gt;The function returns nonzero if c is a numeric digit&lt;br /&gt;&lt;br /&gt;int isgraph(int c); &lt;br /&gt;The function returns nonzero if c is any character for which either isalnum or ispunct returns nonzero.&lt;br /&gt;&lt;br /&gt;int islower(int c);&lt;br /&gt;The function returns nonzero if c is a lower case character.&lt;br /&gt;&lt;br /&gt;int isprint(int c); &lt;br /&gt;The function returns nonzero if c is space or a character for which isgraph returns nonzero.&lt;br /&gt;&lt;br /&gt;int ispunct(int c);&lt;br /&gt;The function returns nonzero if c is punctuation&lt;br /&gt;&lt;br /&gt;int isspace(int c); &lt;br /&gt;The function returns nonzero if c is space character&lt;br /&gt;&lt;br /&gt;int isupper(int c); &lt;br /&gt;The function returns nonzero if c is upper case character&lt;br /&gt;&lt;br /&gt;int isxdigit(int c); &lt;br /&gt;The function returns nonzero if c is hexa digit&lt;br /&gt;&lt;br /&gt;int tolower(int c); &lt;br /&gt;The function returns the corresponding lowercase letter if one exists and if isupper(c); otherwise, it returns c.&lt;br /&gt;&lt;br /&gt;int toupper(int c); &lt;br /&gt;The function returns the corresponding uppercase letter if one exists and if islower(c); otherwise, it returns c.&lt;br /&gt;&lt;br /&gt;Error Handling Functions:&lt;br /&gt;&lt;br /&gt;void perror(const char *s); &lt;br /&gt;produces a message on standard error output describing the last error encountered.&lt;br /&gt;&lt;br /&gt;char *strerror(int errnum );&lt;br /&gt;returns a string describing the error code passed in the argument errnum.&lt;br /&gt;&lt;br /&gt;25.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-3117324469980996269?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/3117324469980996269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/c-tutorials.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/3117324469980996269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/3117324469980996269'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/c-tutorials.html' title='c tutorials'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-2368688494702182268</id><published>2010-08-14T01:02:00.000-07:00</published><updated>2010-08-14T01:02:03.673-07:00</updated><title type='text'>c apptitude in prog....</title><content type='html'>Predict the output or error(s) for the following:&lt;br /&gt;1.    void main()&lt;br /&gt;{&lt;br /&gt;            int  const * p=5;&lt;br /&gt;            printf("%d",++(*p));&lt;br /&gt;}&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". But we tried to change the value of the "constant integer".&lt;br /&gt;&lt;br /&gt;2.    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;&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. Generally  array name is the base address for that array. Here s is the base address. i is the index number/displacement from the base address. So, indirecting it with * is same as s[i]. i[s] may be surprising. But in the  case of  C  it is same as s[i].&lt;br /&gt;&lt;br /&gt;3.      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;&lt;br /&gt;Answer: &lt;br /&gt;I hate U&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;For floating point numbers (float, double, long double) the values cannot be predicted exactly. Depending on the number of bytes, the precession with of the value  represented varies. Float takes 4 bytes and long double takes 10 bytes. So float stores 0.9 with less precision than long double.&lt;br /&gt;Rule of Thumb: &lt;br /&gt;Never compare or at-least be cautious when using floating point numbers with relational operators (== , &gt;, &lt;, &lt;=, &gt;=,!= ) .  &lt;br /&gt;&lt;br /&gt;4.      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;&lt;br /&gt;Answer:&lt;br /&gt;5 4 3 2 1&lt;br /&gt;&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;br /&gt;5.      main()&lt;br /&gt;{&lt;br /&gt;             int c[ ]={2.8,3.4,4,6.7,5};&lt;br /&gt;             int j,*p=c,*q=c;&lt;br /&gt;             for(j=0;j&lt;5;j++) {                        printf(" %d ",*c);                        ++q;     }             for(j=0;j&lt;5;j++){printf(" %d ",*p);++p;     }} Answer:                        2 2 2 2 2 2 3 4 6 5Predict the output or error(s) for the following:7.      main(){            int i=-1,j=-1,k=0,l=2,m;            m=i++&amp;&amp;j++&amp;&amp;k++||l++;            printf("%d %d %d %d %d",i,j,k,l,m);}Answer:                        0 0 1 3 1Explanation :Logical operations always give a result of 1 or 0 . And also the logical AND (&amp;&amp;) operator has higher priority over the logical OR (||) operator. So the expression  ‘i++ &amp;&amp; j++ &amp;&amp; k++’ is executed first. The result of this expression is 0    (-1 &amp;&amp; -1 &amp;&amp; 0 = 0). Now the expression is 0 || 2 which evaluates to 1 (because OR operator always gives 1 except for ‘0 || 0’ combination- for which it gives 0). So the value of m is 1. The values of other variables are also incremented by 1.8.      main(){            char *p;            printf("%d %d ",sizeof(*p),sizeof(p));} Answer:                         1 2Explanation:The sizeof() operator gives the number of bytes taken by its operand. P is a character pointer, which needs one byte for storing its value (a character). Hence sizeof(*p) gives a value of 1. Since it needs two bytes to store the address of the character pointer sizeof(p) gives 2.9.      main(){            int i=3;            switch(i)             {                default:printf("zero");                case 1: printf("one");                           break;               case 2:printf("two");                          break;              case 3: printf("three");                          break;              }  }Answer :threeExplanation :The default case can be placed anywhere inside the loop. It is executed only when all other cases doesn't match.10.      main(){              printf("%x",-1&lt;&lt;4);}Answer: fff0Explanation :-1 is internally represented as all 1's. When left shifted four times the least significant 4 bits are filled with 0's.The %x format specifier specifies that the integer value be printed as a hexadecimal value.11.      main(){            char string[]="Hello World";            display(string);}void display(char *string){            printf("%s",string);}Answer:Compiler Error : Type mismatch in redeclaration of function display Explanation :In third line, when the function display is encountered, the compiler doesn't know anything about the function display. It assumes the arguments and return types to be integers, (which is the default type). When it sees the actual function display, the arguments and type contradicts with what it has assumed previously. Hence a compile time error occurs.12.      main(){            int c=- -2;            printf("c=%d",c);}Answer:                                    c=2;Explanation:Here unary minus (or negation) operator is used twice. Same maths  rules applies, ie. minus * minus= plus.Note: However you cannot give like --2. Because -- operator can  only be applied to variables as a decrement operator (eg., i--). 2 is a constant and not a variable.13.      #define int charmain(){            int i=65;            printf("sizeof(i)=%d",sizeof(i));}Answer:                        sizeof(i)=1Explanation:Since the #define replaces the string  int by the macro char 14.      main(){int i=10;i=!i&gt;14;&lt;br /&gt;Printf ("i=%d",i);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;i=0&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;In the expression !i&gt;14 , NOT (!) operator has more precedence than ‘ &gt;’ symbol.  ! is a unary logical operator. !i (!10) is 0 (not of true is false).  0&gt;14 is false (zero).&lt;br /&gt;&lt;br /&gt;Predict the output or error(s) for the following:&lt;br /&gt;15.      #include&lt;br /&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;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;&lt;br /&gt;Answer:&lt;br /&gt;77        &lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;p is pointing to character '\n'. str1 is pointing to character 'a' ++*p. "p is pointing to '\n' and that is incremented by one." the ASCII value of '\n' is 10, which is then incremented to 11. The value of ++*p is 11. ++*str1, str1 is pointing to 'a' that is incremented by 1 and it becomes 'b'. ASCII value of 'b' is 98.&lt;br /&gt; Now performing (11 + 98 – 32), we get 77("M");&lt;br /&gt; So we get the output 77 :: "M" (Ascii is 77).&lt;br /&gt;&lt;br /&gt;16.      #include&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;a[2][2][2];&lt;br /&gt;*q=***a;&lt;br /&gt;printf("%d----%d",*p,*q);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;SomeGarbageValue---1&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;p=&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;17.      #include&lt;br /&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;&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;You should not initialize variables in declaration&lt;br /&gt;&lt;br /&gt;18.      #include&lt;br /&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;&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error&lt;br /&gt;&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;19.      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;&lt;br /&gt;Answer:&lt;br /&gt;hai&lt;br /&gt;&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;20.      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;&lt;br /&gt;Answer:&lt;br /&gt;45545&lt;br /&gt;&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;21.      #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;&lt;br /&gt;Answer:&lt;br /&gt;64&lt;br /&gt;&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;22.      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;&lt;br /&gt;Answer:&lt;br /&gt;ibj!gsjfoet&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;                        ++*p++ will be parse in the given order&lt;br /&gt;Ø  *p that is value at the location currently pointed by p will be taken&lt;br /&gt;Ø  ++*p the retrieved value will be incremented &lt;br /&gt;Ø  when ; is encountered the location will be incremented that is p++ will be executed&lt;br /&gt;Hence, in the while loop initial value pointed by p is ‘h’, which is changed to ‘i’ by executing ++*p and pointer moves to point, ‘a’ which is similarly changed to ‘b’ and so on. Similarly blank space is converted to ‘!’. Thus, we obtain value in p becomes “ibj!gsjfoet” and since p reaches ‘\0’ and p1 points to p thus p1doesnot print anything. &lt;br /&gt;&lt;br /&gt;23.      #include &lt;br /&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;&lt;br /&gt;Answer:&lt;br /&gt;50&lt;br /&gt;&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;24.      #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;&lt;br /&gt;Answer:&lt;br /&gt;100&lt;br /&gt;&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;Predict the output or error(s) for the following:&lt;br /&gt;25.   main()&lt;br /&gt;{&lt;br /&gt;printf("%p",main);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;                        Some address will be printed.&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;            Function names are just addresses (just like array names are addresses).&lt;br /&gt;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;26.       main()&lt;br /&gt;{&lt;br /&gt;clrscr();&lt;br /&gt;}&lt;br /&gt;clrscr();&lt;br /&gt;            &lt;br /&gt;Answer:&lt;br /&gt;No output/error&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;The first clrscr() occurs inside a function. So it becomes a function call. In the second clrscr(); is a function declaration (because it is not inside any function).&lt;br /&gt;&lt;br /&gt;27.       enum colors {BLACK,BLUE,GREEN}&lt;br /&gt; main()&lt;br /&gt;{&lt;br /&gt;  &lt;br /&gt; printf("%d..%d..%d",BLACK,BLUE,GREEN);&lt;br /&gt;   &lt;br /&gt; return(1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;0..1..2&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;enum assigns numbers starting from 0, if not explicitly defined.&lt;br /&gt;&lt;br /&gt;28.       void main()&lt;br /&gt;{&lt;br /&gt; char far *farther,*farthest;&lt;br /&gt;  &lt;br /&gt; printf("%d..%d",sizeof(farther),sizeof(farthest));&lt;br /&gt;   &lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;4..2  &lt;br /&gt;&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;29.       main()&lt;br /&gt;{&lt;br /&gt; int i=400,j=300;&lt;br /&gt; printf("%d..%d");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;400..300&lt;br /&gt;&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;30.       main()&lt;br /&gt;{&lt;br /&gt; char *p;&lt;br /&gt; p="Hello";&lt;br /&gt; printf("%c\n",*&amp;*p);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;H &lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;* is a dereference operator &amp; is a reference  operator. They can be    applied any number of times provided it is meaningful. Here  p points to  the first character in the string "Hello". *p dereferences it and so its value is H. Again  &amp; references it to an address and * dereferences it to the value H.&lt;br /&gt;&lt;br /&gt;31.       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;&lt;br /&gt;Answer:&lt;br /&gt;Compiler error: Undefined label 'here' in function main&lt;br /&gt;&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;32.       main()&lt;br /&gt;{&lt;br /&gt;   static char names[5][20]={"pascal","ada","cobol","fortran","perl"};&lt;br /&gt;    int i;&lt;br /&gt;    char *t;&lt;br /&gt;    t=names[3];&lt;br /&gt;    names[3]=names[4];&lt;br /&gt;    names[4]=t; &lt;br /&gt;    for (i=0;i&lt;=4;i++)            printf("%s",names[i]);}Answer:Compiler error: Lvalue required in function mainExplanation:Array names are pointer constants. So it cannot be modified.33.     void main(){            int i=5;            printf("%d",i++ + ++i);}Answer:Output Cannot be predicted  exactly.Explanation:Side effects are involved in the evaluation of   i34.       void main(){            int i=5;            printf("%d",i+++++i);}Answer:Compiler Error Explanation:The expression i+++++i is parsed as i ++ ++ + i which is an illegal combination of operators. 35.       #includemain(){int i=1,j=2;switch(i) { case 1:  printf("GOOD");                break; case j:  printf("BAD");               break; }}Answer:Compiler Error: Constant expression required in function main.Explanation:The case statement can have only constant expressions (this implies that we cannot use variable names directly so an error).            Note:Enumerated types can be used in case statementsPredict the output or error(s) for the following:36.    main(){int i;printf("%d",scanf("%d",&amp;i));  // value 10 is given as input here}Answer:1Explanation: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. 37.       #define f(g,g2) g##g2main(){int var12=100;printf("%d",f(var,12));            }Answer:100 38.      main(){int i=0; for(;i++;printf("%d",i)) ;printf("%d",i);}Answer:            1Explanation:before entering into the for loop the checking condition is "evaluated". Here it evaluates to 0 (false) and comes out of the loop, and i is incremented (note the semicolon after the for loop).39.       #includemain(){  char s[]={'a','b','c','\n','c','\0'};  char *p,*str,*str1;  p=&amp;s[3];  str=p;  str1=s;  printf("%d",++*p + ++*str1-32);}Answer:MExplanation: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. i.e. (11+98-32)=77("M");40.       #includemain(){  struct xx   {      int x=3;      char name[]="hello";   };struct xx *s=malloc(sizeof(struct xx));printf("%d",s-&gt;x);&lt;br /&gt;printf("%s",s-&gt;name);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;Initialization should not be done for structure members inside the structure declaration&lt;br /&gt;&lt;br /&gt;41.       #include&lt;br /&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;&lt;br /&gt;Answer:&lt;br /&gt;Compiler Error&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;in the end of nested structure yy a member have to be declared&lt;br /&gt;&lt;br /&gt;42.       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;&lt;br /&gt;Answer:&lt;br /&gt;Linker error: undefined symbol '_i'.&lt;br /&gt;&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 flags an error.&lt;br /&gt;&lt;br /&gt;43.       main()&lt;br /&gt;{&lt;br /&gt;printf("%d", out);&lt;br /&gt;}&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;&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;Predict the output or error(s) for the following:&lt;br /&gt;44.    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;&lt;br /&gt;Answer:&lt;br /&gt;100      &lt;br /&gt;&lt;br /&gt;            Explanation:   &lt;br /&gt;This is the correct way of writing the previous program.&lt;br /&gt;&lt;br /&gt;45.       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;&lt;br /&gt;Answer:&lt;br /&gt;Compier error: Type mismatch in redeclaration of show.&lt;br /&gt;&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;The solutions are as follows:&lt;br /&gt;1. declare void show() in main() .&lt;br /&gt;2. define show() before main().&lt;br /&gt;3. declare extern void show() before the use of show().&lt;br /&gt;&lt;br /&gt;46.  main( )&lt;br /&gt;{&lt;br /&gt;  int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}};&lt;br /&gt;  printf(“%u %u %u %d \n”,a,*a,**a,***a);&lt;br /&gt;        printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1);&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;100, 100, 100, 2&lt;br /&gt;114, 104, 102, 3&lt;br /&gt;&lt;br /&gt;47.   main( )&lt;br /&gt;{&lt;br /&gt;  int a[ ] = {10,20,30,40,50},j,*p;&lt;br /&gt;  for(j=0; j&lt;5; j++)&lt;br /&gt;    {&lt;br /&gt;printf(“%d” ,*a); &lt;br /&gt;a++;&lt;br /&gt;    }&lt;br /&gt;    p = a;&lt;br /&gt;   for(j=0; j&lt;5; j++) &lt;br /&gt;      {&lt;br /&gt;printf(“%d ” ,*p); &lt;br /&gt;p++;&lt;br /&gt;      }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;Compiler error: lvalue required.&lt;br /&gt;                        &lt;br /&gt;Explanation:&lt;br /&gt;Error is in line with statement a++. The operand must be an lvalue and may be of any of scalar type for the any operator, array name only when subscripted is an lvalue. Simply array name is a non-modifiable lvalue.&lt;br /&gt;&lt;br /&gt;48.       main( )&lt;br /&gt;{&lt;br /&gt; static int  a[ ]   = {0,1,2,3,4};&lt;br /&gt; int  *p[ ] = {a,a+1,a+2,a+3,a+4};&lt;br /&gt; int  **ptr =  p;&lt;br /&gt; ptr++;&lt;br /&gt; printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr); &lt;br /&gt; *ptr++;&lt;br /&gt; printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr); &lt;br /&gt; *++ptr;&lt;br /&gt; printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr); &lt;br /&gt; ++*ptr;&lt;br /&gt;       printf(“\n %d  %d  %d”, ptr-p, *ptr-a, **ptr); &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;            111&lt;br /&gt;            222&lt;br /&gt;            333&lt;br /&gt;            344&lt;br /&gt;&lt;br /&gt;49.       main( )&lt;br /&gt;{&lt;br /&gt; void *vp;&lt;br /&gt; char ch = ‘g’, *cp = “goofy”;&lt;br /&gt; int j = 20;&lt;br /&gt; vp = &amp;ch;&lt;br /&gt; printf(“%c”, *(char *)vp);&lt;br /&gt; vp = &amp;j;&lt;br /&gt; printf(“%d”,*(int *)vp);&lt;br /&gt; vp = cp;&lt;br /&gt; printf(“%s”,(char *)vp + 3);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;            g20fy&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;Since a void pointer is used it can be type casted to any  other type pointer. vp = &amp;ch  stores address of char ch and the next statement prints the value stored in vp after type casting it to the proper data type pointer. the output is ‘g’. Similarly  the output from second printf is ‘20’. The third printf statement type casts it to print the string from the 4th value hence the output is ‘fy’.&lt;br /&gt;&lt;br /&gt;50.    main ( )&lt;br /&gt;{&lt;br /&gt; static char *s[ ]  = {“black”, “white”, “yellow”, “violet”};&lt;br /&gt; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p;&lt;br /&gt; p = ptr;&lt;br /&gt; **++p;&lt;br /&gt; printf(“%s”,*--*++p + 3);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;            ck&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;In this problem we have an array of char pointers pointing to start of 4 strings. Then we have ptr which is a pointer to a pointer of type char and a variable p which is a pointer to a pointer to a pointer of type char. p hold the initial value of ptr, i.e. p = s+3. The next statement increment value in p by 1 , thus now value of p =  s+2. In the printf statement the expression is evaluated *++p causes gets value s+1 then the pre decrement is executed and we get s+1 – 1 = s . the indirection operator now gets the value from the array of s and adds 3 to the starting address. The string is printed starting from this position. Thus, the output is ‘ck’.&lt;br /&gt;&lt;br /&gt;51.    main()&lt;br /&gt;{&lt;br /&gt; int  i, n;&lt;br /&gt; char *x = “girl”;&lt;br /&gt; n = strlen(x);&lt;br /&gt; *x = x[n];&lt;br /&gt; for(i=0; i   {&lt;br /&gt;printf(“%s\n”,x);&lt;br /&gt;x++;&lt;br /&gt;   }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;(blank space)&lt;br /&gt;irl&lt;br /&gt;rl&lt;br /&gt;l&lt;br /&gt; &lt;br /&gt;Explanation:&lt;br /&gt;Here a string (a pointer to char) is initialized with a value “girl”.  The strlen function returns the length of the string, thus n has a value 4. The next statement assigns value at the nth location (‘\0’) to the first location. Now the string becomes “\0irl” . Now the printf statement prints the string after each iteration it increments it starting position.  Loop starts from 0 to 4. The first time x[0] = ‘\0’ hence it prints nothing and pointer value is incremented. The second time it prints from x[1] i.e “irl” and the third time it prints “rl” and the last time it prints “l” and the loop terminates&lt;br /&gt;52.     int i,j;&lt;br /&gt;            for(i=0;i&lt;=10;i++)&lt;br /&gt;            {&lt;br /&gt;            j+=5;&lt;br /&gt;            assert(i&lt;5);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;Answer: &lt;br /&gt;Runtime error: Abnormal program termination. &lt;br /&gt;                                    assert failed (i&lt;5), , &lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&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,&lt;br /&gt;            #undef NDEBUG&lt;br /&gt;and this will disable all the assertions from the source code. Assertion&lt;br /&gt;is a good debugging tool to make use of.  &lt;br /&gt;&lt;br /&gt;53.       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;&lt;br /&gt;Answer:&lt;br /&gt; i = -1, +i = -1&lt;br /&gt;&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;54. 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;55.  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&lt;br /&gt;            of the file.&lt;br /&gt;&lt;br /&gt;56.       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;57.       What is the problem with the following code segment?&lt;br /&gt;            while ((fgets(receiving array,50,file_ptr)) != EOF)&lt;br /&gt;                                    ;&lt;br /&gt;Answer &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;58.   main()&lt;br /&gt;            {&lt;br /&gt;            main();&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt; Runtime error : Stack overflow.&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;main function calls itself again and again. Each time the function is called its return address is stored in the call stack. Since there is no condition to terminate the function call, the call stack overflows at runtime. So it terminates the program and results in an error.&lt;br /&gt;&lt;br /&gt;59.      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;&lt;br /&gt;Answer:&lt;br /&gt;Compiler error (at line number 4): size of v is Unknown.&lt;br /&gt;&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;60.       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;&lt;br /&gt;Answer:&lt;br /&gt;2 5 5&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;In first sizeof, str1 is a character pointer so it gives you the size of the pointer variable. In second sizeof the name str2 indicates the name of the array whose size is 5 (including the '\0' termination character). The third sizeof is similar to the second one.&lt;br /&gt;&lt;br /&gt;61.      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;&lt;br /&gt;Answer:&lt;br /&gt;0&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;! is a logical operator. In C the value 0 is considered to be the boolean value FALSE, and any non-zero value is considered to be the boolean value TRUE. Here 2 is a non-zero value so TRUE. !TRUE is FALSE (0) so it prints 0.&lt;br /&gt;&lt;br /&gt;62.       #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;&lt;br /&gt;Answer:&lt;br /&gt;TRUE&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;The input program to the compiler after processing by the preprocessor is,&lt;br /&gt;            main(){&lt;br /&gt;                        if(0)&lt;br /&gt;                                    puts("NULL");&lt;br /&gt;            else if(-1)&lt;br /&gt;                                    puts("TRUE");&lt;br /&gt;            else&lt;br /&gt;                                    puts("FALSE");&lt;br /&gt;                        }&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;63.     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;&lt;br /&gt;Answer:&lt;br /&gt;1==1 is TRUE&lt;br /&gt;&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;64.       main()&lt;br /&gt;            {&lt;br /&gt;            int y;&lt;br /&gt;            scanf("%d",&amp;y); // input given is 2000&lt;br /&gt;            if( (y%4==0 &amp;&amp; y%100 != 0) || y%100 == 0 )&lt;br /&gt;                 printf("%d is a leap year");&lt;br /&gt;            else&lt;br /&gt;                 printf("%d is not a leap year");&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;2000 is a leap year&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;An ordinary program to check if leap year or not.&lt;br /&gt;&lt;br /&gt;65.       #define max 5&lt;br /&gt;            #define int arr1[max]&lt;br /&gt;            main()&lt;br /&gt;            {&lt;br /&gt;            typedef char arr2[max];&lt;br /&gt;            arr1 list={0,1,2,3,4};&lt;br /&gt;            arr2 name="name";&lt;br /&gt;            printf("%d %s",list[0],name);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;Compiler error (in the line arr1 list = {0,1,2,3,4})&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;arr2 is declared of type array of size 5 of characters. So it can be used to declare the variable name of the type arr2. But it is not the case of arr1. Hence an error.&lt;br /&gt;Rule of Thumb: &lt;br /&gt;#defines are used for textual replacement whereas typedefs are used for declaring new types.&lt;br /&gt;&lt;br /&gt;66.       int i=10;&lt;br /&gt;            main()&lt;br /&gt;            {&lt;br /&gt;             extern int i;&lt;br /&gt;              {&lt;br /&gt;                 int i=20;&lt;br /&gt;                        {&lt;br /&gt;                         const volatile unsigned i=30;&lt;br /&gt;                         printf("%d",i);&lt;br /&gt;                        }&lt;br /&gt;                  printf("%d",i);&lt;br /&gt;               }&lt;br /&gt;            printf("%d",i);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;30,20,10&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;'{' introduces new block and thus new scope. In the innermost block i is declared as, &lt;br /&gt;            const volatile unsigned&lt;br /&gt;which is a valid declaration. i is assumed of type int. So printf prints 30. In the next block, i has value 20 and so printf prints 20. In the outermost block, i is declared as extern, so no storage space is allocated for it. After compilation is over the linker resolves it to global variable i (since it is the only variable visible there). So it prints i's value as 10.&lt;br /&gt;&lt;br /&gt;67.       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;&lt;br /&gt;Answer:&lt;br /&gt;10&lt;br /&gt;&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;68.      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;&lt;br /&gt;Answer:&lt;br /&gt;i = -1, -i = 1&lt;br /&gt;&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;69.       #include&lt;br /&gt;main()&lt;br /&gt; {&lt;br /&gt;   const int i=4;&lt;br /&gt;   float j;&lt;br /&gt;   j = ++i;&lt;br /&gt;   printf("%d  %f", i,++j);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;Compiler error &lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;i is a constant. you cannot change the value of constant &lt;br /&gt;&lt;br /&gt;70.       #include&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;a[2][2][2];&lt;br /&gt;  *q=***a;&lt;br /&gt;  printf("%d..%d",*p,*q);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;garbagevalue..1&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;p=&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 meAnswer:it will print first element of 3D array.&lt;br /&gt;&lt;br /&gt;71.      #include&lt;br /&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;&lt;br /&gt;Answer:&lt;br /&gt;hello 5&lt;br /&gt;&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;72.      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;&lt;br /&gt;Answer:&lt;br /&gt;11&lt;br /&gt;&lt;br /&gt;Explanation:&lt;br /&gt;the expression i+++j is treated as (i++ + j)    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Explanation: &lt;br /&gt;Initially pointer c is assigned to both p and q. In the first loop, since only q is incremented and not c , the value 2 will be printed 5 times. In second loop p itself is incremented. So the values 2 3 4 6 5 will be printed. &lt;br /&gt;&lt;br /&gt;6.      main()&lt;br /&gt;{&lt;br /&gt;            extern int i;&lt;br /&gt;            i=20;&lt;br /&gt;printf("%d",i);&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;Answer:  &lt;br /&gt;Linker Error : Undefined symbol '_i'&lt;br /&gt;Explanation: &lt;br /&gt;                        extern storage class in the following declaration,&lt;br /&gt;                                    extern int i;&lt;br /&gt;specifies to the compiler that the memory for i is allocated in some other program and that address will be given to the current program at the time of linking. But linker finds that no other variable of name i is available in any other program with memory space allocated for it. Hence a linker error has occurred .&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-2368688494702182268?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/2368688494702182268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/c-apptitude-in-prog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/2368688494702182268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/2368688494702182268'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/c-apptitude-in-prog.html' title='c apptitude in prog....'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-7406924195356828427</id><published>2010-08-13T23:50:00.001-07:00</published><updated>2010-08-13T23:50:59.680-07:00</updated><title type='text'>c intreview quesitions</title><content type='html'>What is C language ?&lt;br /&gt;&lt;br /&gt;What does static variable mean?&lt;br /&gt;&lt;br /&gt;What are the different storage classes in C ?&lt;br /&gt;&lt;br /&gt;What is hashing ?&lt;br /&gt;&lt;br /&gt;Can static variables be declared in a header file ? &lt;br /&gt;&lt;br /&gt;Can a variable be both constant and volatile ?&lt;br /&gt;&lt;br /&gt;Can include files be nested?&lt;br /&gt;&lt;br /&gt;What is a null pointer ?&lt;br /&gt;&lt;br /&gt;What is the output of printf("%d") ?&lt;br /&gt;&lt;br /&gt;What is the difference between calloc() and malloc() ?&lt;br /&gt;&lt;br /&gt;What is the difference between printf() and sprintf() ?&lt;br /&gt;&lt;br /&gt;How to reduce a final size of executable ?&lt;br /&gt;&lt;br /&gt;Can you tell me how to check whether a linked list is circular ?&lt;br /&gt;&lt;br /&gt;Advantages of a macro over a function ? &lt;br /&gt;&lt;br /&gt;What is the difference between strings and character arrays ?&lt;br /&gt;&lt;br /&gt;Write down the equivalent pointer expression for referring the same element a[i][j][k][l] ?&lt;br /&gt;&lt;br /&gt;Which bit wise operator is suitable for checking whether a particular bit is on or off ?&lt;br /&gt;&lt;br /&gt;Which bit wise operator is suitable for turning off a particular bit in a number ?&lt;br /&gt;&lt;br /&gt;Which bit wise operator is suitable for putting on a particular bit in a number ?&lt;br /&gt;&lt;br /&gt;Does there exist any other function which can be used to convert an integer or a float to a string ?&lt;br /&gt;&lt;br /&gt;Why does malloc(0) return valid memory address ? What's the use ?&lt;br /&gt;&lt;br /&gt;Difference between const char* p and char const* p &lt;br /&gt;&lt;br /&gt;What is the result of using Option Explicit ?&lt;br /&gt;&lt;br /&gt;What is the benefit of using an enum rather than a #define constant ?&lt;br /&gt;&lt;br /&gt;What is the quickest sorting method to use ?&lt;br /&gt;&lt;br /&gt;When should the volatile modifier be used ?&lt;br /&gt;&lt;br /&gt;When should the register modifier be used? Does it really help ?&lt;br /&gt;&lt;br /&gt;How can you determine the size of an allocated portion of memory ?&lt;br /&gt;&lt;br /&gt;What is page thrashing ?&lt;br /&gt;&lt;br /&gt;When does the compiler not implicitly generate the address of the first element of an array ?&lt;br /&gt;&lt;br /&gt;What is the benefit of using #define to declare a constant ?&lt;br /&gt;&lt;br /&gt;How can I search for data in a linked list ?&lt;br /&gt;&lt;br /&gt;Why should we assign NULL to the elements (pointer) after freeing them ?&lt;br /&gt;&lt;br /&gt;What is a null pointer assignment error ? What are bus errors, memory faults, and core dumps ?&lt;br /&gt;&lt;br /&gt;When should a type cast be used ?&lt;br /&gt;&lt;br /&gt;What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?&lt;br /&gt;&lt;br /&gt;How can I convert a string to a number ?&lt;br /&gt;&lt;br /&gt;How can I convert a number to a string ?&lt;br /&gt;&lt;br /&gt;Is it possible to execute code even after the program exits the main() function?&lt;br /&gt;&lt;br /&gt;What is the stack ?&lt;br /&gt;&lt;br /&gt;How do you print an address ?&lt;br /&gt;&lt;br /&gt;Can a file other than a .h file be included with #include ?&lt;br /&gt;&lt;br /&gt;What is Preprocessor ?&lt;br /&gt;&lt;br /&gt;How can you restore a redirected standard stream ?&lt;br /&gt;&lt;br /&gt;What is the purpose of realloc( ) ?&lt;br /&gt;&lt;br /&gt;What is the heap ?&lt;br /&gt;&lt;br /&gt;How do you use a pointer to a function ?&lt;br /&gt;&lt;br /&gt;What is the purpose of main( ) function ?&lt;br /&gt;&lt;br /&gt;Why n++ executes faster than n+1 ?&lt;br /&gt;&lt;br /&gt;What will the preprocessor do for a program ?&lt;br /&gt;&lt;br /&gt;What is the benefit of using const for declaring constants ?&lt;br /&gt;&lt;br /&gt;What is the easiest sorting method to use ?&lt;br /&gt;&lt;br /&gt;Is it better to use a macro or a function ?&lt;br /&gt;&lt;br /&gt;What are the standard predefined macros ?&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Have a Question ? post your questions here. It will be answered as soon as possible.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-7406924195356828427?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/7406924195356828427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/c-intreview-quesitions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/7406924195356828427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/7406924195356828427'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/c-intreview-quesitions.html' title='c intreview quesitions'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-4914523225570872454</id><published>2010-08-13T02:48:00.000-07:00</published><updated>2010-08-13T02:48:31.628-07:00</updated><title type='text'>tcs4</title><content type='html'>Test Paper :19 &lt;br /&gt;&lt;br /&gt;  Paper Type     : Whole Testpaper  &lt;br /&gt; Test Date        : 21  January  2010   &lt;br /&gt; Test Location  : UIT RGPV, Bhopal  &lt;br /&gt; Posted By        : Brashaket Pratap Singh &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;TCS PAPER ON 21st JANUARY AT BHOPAL&lt;br /&gt;&lt;br /&gt;Hello Guys This is Brashaket Pratap Singh Bais one of the student of the Technocrats Institute of Technology, Bhopal Pursuing MCA.&lt;br /&gt;TCS on January 21st , 2010 at RGPV BHOPAL (in the UIT Bhopal).&lt;br /&gt;It was an open campus. All the reputed Colleges of Bhopal appear in the online test.&lt;br /&gt;Nearly 360 students From my college attended for online test, out of which 138 were short listed for interview. Out of the 360 there r 81 students from the MCA, and only 7 students including me are able to clear the online test and short listed for the Interview. All the remaining students are from the B.E.&lt;br /&gt;&lt;br /&gt;Complete tcs selection procedure consists of :&lt;br /&gt;1) Online Test     2) Technical Interview     3) M.R. Round     4) H.R. Round&lt;br /&gt; &lt;br /&gt;(PAPER) TCS Online Test&lt;br /&gt;&lt;br /&gt;The test was divided in three sections as:&lt;br /&gt;1. Verbal reasoning (20 min - 32 Qs )&lt;br /&gt;2. Quantitative aptitude (40 min – 36 Qs) &lt;br /&gt;3. Critical reasoning (30 min - 3 passages - 12 Qs)&lt;br /&gt;&lt;br /&gt;No Sectional Cut off.&lt;br /&gt;No Negative Marks.&lt;br /&gt;No Psychometric Test was there for us.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Verbal reasoning: (20 min 32 Qs) &lt;br /&gt;&lt;br /&gt;Antonyms and Synonyms: (20) (I don’t remember which were for antonyms and which were for synonym)\&lt;br /&gt;1. Effrontery -- extreme rudeness and lack of ability to understand that your behavior is not acceptable to other people.&lt;br /&gt; &lt;br /&gt;2. ERRATIC(SYNONYM)&lt;br /&gt;a. Unromantic&lt;br /&gt;b.  Free&lt;br /&gt;c. Popular&lt;br /&gt;d. Steady&lt;br /&gt;e. Unknown(answer)&lt;br /&gt;&lt;br /&gt;3.what is the synonyms of RAPT&lt;br /&gt;Ans:- concealed&lt;br /&gt;&lt;br /&gt;4. SYNONYMS OF tranquil&lt;br /&gt;Ans:- serene&lt;br /&gt;&lt;br /&gt;5. Awry – skewed, crooked, wrong&lt;br /&gt;&lt;br /&gt;6. Repellent x attractive(antonym)&lt;br /&gt;&lt;br /&gt;7. Raucous – rough, wild, hoarse, guttering(synonym)&lt;br /&gt;&lt;br /&gt;8. Benign – kind, benevolent, compassionate&lt;br /&gt;&lt;br /&gt;9. Pristine x sullied&lt;br /&gt;&lt;br /&gt;10. Florid= Ornate, Showy(SYN)&lt;br /&gt;&lt;br /&gt;11. Servility= Surrender(SYN)&lt;br /&gt;&lt;br /&gt;12. Chide * praise(ANT)&lt;br /&gt;&lt;br /&gt;13. Stilted * natural(ANT)&lt;br /&gt; &lt;br /&gt;I don’t Know all the words, but for scoring good marks in this section Refer Barrons 750 word list. As Well as refer FreshersWorld.com mug up all the synonyms and antonyms of approx last 50-70 papers.&lt;br /&gt;Definitely you will Score good marks here, Attempt all the question as there is no negative marking.&lt;br /&gt;I Think my score is good in this section.&lt;br /&gt; &lt;br /&gt;There was paragraph making which i cud not do all the questions of that as it was very tough, so i guessed the answers and hoped atleast few hits the target the. RC had a passage from barons, i had practiced all the barrons RC and it helped . &lt;br /&gt;For better score refer Barron’s for this section.&lt;br /&gt; &lt;br /&gt;Quantitative aptitude: - &lt;br /&gt;FOR THE QUANT SECTION I WILL SUGGEST U TO SOLVE THE R.S.AGRAWAL AND A LOT BETTER TO SOLVE THE LAST 3-4 YEARS QUESTION PAPERS FROM THE FreshersWorld.com. It Will really Help You.&lt;br /&gt;&lt;br /&gt;Sorry I don’t remember the questions. But I am able to correctly solve the 33 questions and remaining r the targeted hits. &lt;br /&gt;I m Sending U some sample questions with their solutions, questions on my paper r like these,&lt;br /&gt; &lt;br /&gt;1) Complete the series 7, 9 , 13 , __ , 27, 37  &lt;br /&gt;Ans: 19&lt;br /&gt;&lt;br /&gt;2) What is the largest prime number that can be stored in an 8-bit memory?&lt;br /&gt;Ans: 127&lt;br /&gt;&lt;br /&gt;3) Number of faces, vertices and edges of a cube     &lt;br /&gt;Ans : 6,8,12(Sometimes they change the sequence as on my paper it comes as number of vertices ,faces and edges , so first make a very close look to the question and decide the sequence of values that matching the one of the options).&lt;br /&gt;&lt;br /&gt;4).In a triangle which one is not possible. Sides are (5 ,5 ,5.), (5 ,4 ,5 ), (4 ,4, 9 ), (3,4 ,5,)?&lt;br /&gt;Ans: (4,4,9). (HINT : for a triangle sum of smaller 2 sides should be greater than the other one which is larger)&lt;br /&gt;&lt;br /&gt;5) Match the following:&lt;br /&gt;1. Male - Boy                                 a. A type of&lt;br /&gt;2. Square - Polygon                        b. A part of&lt;br /&gt;3. Roof - Building                           c. Not a type of&lt;br /&gt;4. Mushroom – Vegetables             d. A superset of         &lt;br /&gt;Ans: 1- d, 2- a, 3- b, 4- c&lt;br /&gt;&lt;br /&gt;6) Given $ means Tripling and % means change of sign then find the value of $%$6-%$%6 ?&lt;br /&gt;Ans : -72&lt;br /&gt;&lt;br /&gt;8) In a two-dimensional array, X (9, 7), with each element occupying 4 bytes of memory, with the address of the first element X (1, 1) is 3000, find the address of X (8, 5). &lt;br /&gt;Ans : 3212&lt;br /&gt;(Hint : Every 1 deg longitude is equal to 4 minutes . If west to east add time else subtract time) &lt;br /&gt;&lt;br /&gt;9) Select the odd one out. a. Java b. Lisp c. Smalltalk d. Eiffel.&lt;br /&gt;Ans: LISP&lt;br /&gt;&lt;br /&gt;10) In which of the system, decimal number 194 is equal to 1234? &lt;br /&gt;Ans: 5&lt;br /&gt;&lt;br /&gt;11) A power unit is there by the bank of the river of 750 meters width. A cable is made from power unit to power a plant opposite to that of the river and 1500mts away from the power unit. The cost of the cable below water is Rs. 15/- per meter and cost of cable on the bank is Rs.12/- per meter. Find the total of laying the cable.&lt;br /&gt;Ans: 20250&lt;br /&gt;&lt;br /&gt;12) Which of the following are orthogonal pairs? a. 3i+2j b. i+j c. 2i-3j d. -7i+j &lt;br /&gt;Ans : (A) &amp; (C).&lt;br /&gt;&lt;br /&gt;13) If VXUPLVH is written as SURMISE, what is SHDVD?  &lt;br /&gt;Ans : PEASA&lt;br /&gt;&lt;br /&gt;14) If A, B and C are the mechanisms used separately to reduce the wastage of fuel by 30%, 20% and 10%. What will be the fuel economy if they were used combined.&lt;br /&gt;Ans : 20%&lt;br /&gt;&lt;br /&gt;15) A can copy 50 papers in 10 hours while both A &amp; B can copy 70 papers in 10 hours. Then for how many hours required for B to copy 26 papers?&lt;br /&gt;Ans : 13&lt;br /&gt;&lt;br /&gt;16) Find the singularity matrix from a given set of matrices? (Hint determinant(A)=0)&lt;br /&gt;&lt;br /&gt;17) units of basic quantities :&lt;br /&gt;(energy * time * time)/(mass * dist) = distance&lt;br /&gt;&lt;br /&gt;18) For a round trip, a car used 4 1/2 gallons of gasoline. If it used 1/4 more gasoline going than coming back, how much gasoline was used coming back?&lt;br /&gt;Ans: 2 gallons&lt;br /&gt;&lt;br /&gt;19)A shopkeeper bought a watch for Rs.400 and sold it for Rs.500.What is his profit percentage? &lt;br /&gt;Ans. 25% &lt;br /&gt;&lt;br /&gt;20)g[0]=1,g[1]=-1,g[n]=2*g[n-1]-3*g[n-2] then calculate g[4]=&lt;br /&gt;&lt;br /&gt;21) .The ratio of boys to girls is 6:4.60% of the boys and 40% of girls take lunch in the canteen.What % of class takes lunch?      &lt;br /&gt;Ans) 52%&lt;br /&gt;&lt;br /&gt;22) Which of the following set of numbers has the highest Standard deviation? &lt;br /&gt;a)1,0,1,0,1,0                     b) -1, -1, -1, -1, -1, -1 &lt;br /&gt;c)1,1,1,1,1,1                     d) -1,1,-1, 1,-1, 1&lt;br /&gt;Ans : D&lt;br /&gt;&lt;br /&gt;23) (momentum * velocity)/(force * time) = velocity&lt;br /&gt;&lt;br /&gt;24-27) there were 3 questions on venn diagrams (like 20 spek eng,30 speak hindi 3 speak both and so on….)&lt;br /&gt;&lt;br /&gt;28). The size of a program is N. And the memory occupied by the program is given by M = square root of 100N. If the size of the program is increased by 1% then how much memory now occupied?&lt;br /&gt;Ans. 0.5%.&lt;br /&gt;&lt;br /&gt;29).Odd one out:&lt;br /&gt;a. Linux b.windows NT c. SQL server d. Unix  &lt;br /&gt;&lt;br /&gt;30). In the word ORGANISATIONAL, if the first and second, third and forth, forth and fifth, fifth and sixth words are interchanged up to the last letter, what would be the tenth letter from right?     &lt;br /&gt;&lt;br /&gt;31). If TAFJHH is coded as RBEKGI then RBDJK can be coded as?&lt;br /&gt;&lt;br /&gt;32). FIND THE MISSING NO. IN  SERIES ?&lt;br /&gt;9  10 11 13 15 ? 21 28 &lt;br /&gt;Ans: 19&lt;br /&gt;&lt;br /&gt;33). In the word CHAMPIONSHIP, if the first and second, third and forth, fifth and sixth, etc words are interchanged, what would be the 8th letter from right? (Ans: ‘I’) &lt;br /&gt;&lt;br /&gt;34). If A, B, C are the mechanisms used separately to reduce the wastage of fuel by 30%, 40%,     10%.What will be the fuel economy if they were used combine? &lt;br /&gt;1.68.4         2.62.2         3.58         4.27 &lt;br /&gt;(Ans- 62.2)          sol:  (70/100)*(60/100)*(90/100)*100=37.8 Eco = (100-37.8) =62.2 &lt;br /&gt;&lt;br /&gt;35). What is the value of the following expression M(373,5)+T(7.7)+R(4.4)-T(3.6) &lt;br /&gt;Where M- MODULAS R- ROUNDOFF T- TRUNCATE &lt;br /&gt;(Ans : 11) Sol: 3 + 7+ 4 - 3 ==11 &lt;br /&gt;&lt;br /&gt;36). Match the following (this type of question but not same) &lt;br /&gt;A B &lt;br /&gt;1. Mammal, cow                    ---&gt;                 a. A type of&lt;br /&gt;2. Snake reptile                      ---&gt;                 b. A part of&lt;br /&gt;3. Roof - Building                   ---&gt;                 c. Not a type of&lt;br /&gt;4. Mushroom - Vegetables     ---&gt;                 d. A superset of &lt;br /&gt;(Ans: 1-d, 2-c, 3-b, 4-a) &lt;br /&gt;&lt;br /&gt;37). If G(0) = -1 G(1)= 1 and G(N)=G(N-1) - G(N-2) then &lt;br /&gt;What is the value  of G(6)?(Ans: -3) &lt;br /&gt;&lt;br /&gt;Sol: g(2)=g(1)-g(0) ==1-(-1)=2, similarly g(3),…g(6); &lt;br /&gt;ONCE DO R.S.AGGARWAL (QUANT) (arithmetic section) &lt;br /&gt;GOOD FOR U. &lt;br /&gt;&lt;br /&gt;38). Which set of data exhibits a higher Standard Deviation?&lt;br /&gt;(a) 9, 0, -9, 9, 0, -9             (b) 9, 9, 9, 0, 9, 9         (c) -9, -9, -9, -9, -9, -9         (d) 9, 9, 9, 9, 9, 9         (e) 9, -9, 9, -9, 9, -9&lt;br /&gt;Ans: e……….take mean(sumof all/no.of elmnts),take difference of all frm mean,now apply formula (s.d)^2=(sum of (diff)^2/n) &lt;br /&gt;&lt;br /&gt;39). In Chennai , temperature at noon varies according to -t^2/2 + 8t + 3, where t is elapsed time. Find how much temperature more or less in 4pm to 9pm.&lt;br /&gt;Ans. (put 9 &amp; 4in eq. n subtract ) &lt;br /&gt;&lt;br /&gt;40). Largest prime no 3 digit&lt;br /&gt;Ans: 997&lt;br /&gt;&lt;br /&gt;41). Find the value of @@+25 - ++@16, where @ denotes "square" and + denotes "square root".&lt;br /&gt;Ans. 621&lt;br /&gt;&lt;br /&gt;42). (Momentum*Velocity)/(Acceleration * distance ) find units.&lt;br /&gt;Ans. Mass&lt;br /&gt;&lt;br /&gt;43). In a two-dimensional array, X(9,7), with each element occupying 2 bytes of memory, with the address of the element X(1,1) is 3000,&lt;br /&gt;find the address of X(8,5)?&lt;br /&gt;Ans: 3106 &lt;br /&gt;&lt;br /&gt;44). Find the fourth row, having the bit pattern as an integer in an 8-bit computer, and express the answer in its decimal value.&lt;br /&gt;A 0 0 0 0 1 1 1 1&lt;br /&gt;B 0 0 1 1 0 0 1 1&lt;br /&gt;C 0 1 0 1 0 1 0 1&lt;br /&gt;(A OR(B AND C)) ?&lt;br /&gt;Ans: B AND C&lt;br /&gt;1 AND 1=1 else 0&lt;br /&gt;1 OR 0/1=1&lt;br /&gt;So B AND C--à 00010001 This OR A-&gt;00011111&lt;br /&gt;&lt;br /&gt;45). An aircraft takes off from A (89o N Lat, 20o E ) at 6.00 AM local time to B (50o S , 40o W ). If the flying time is 10 hours what is the local time of landing at B?&lt;br /&gt;Ans:12:00pm&lt;br /&gt;don’t take care of N &amp; S.E &amp; W matters only.&lt;br /&gt;1o change == 4mins&lt;br /&gt;Here 20 o+40 o=60 o&lt;br /&gt;So 60*4=240 mins……4hrs&lt;br /&gt;If time change not considered then After 10 hrs it il reach at the same palce after 6:00+10:00=4:00pm&lt;br /&gt;Going frm east to west so substract 4hrs frm 4:00pm…&lt;br /&gt;4:00pm-4hrs=12:00pm&lt;br /&gt;(if plane is going frm west to east then then Add those hrs)&lt;br /&gt;&lt;br /&gt;46). Select the odd one out&lt;br /&gt; a. SMTP b.WAP c. SAP d.ARP&lt;br /&gt;Ans : c&lt;br /&gt;&lt;br /&gt;47). select odd one- sql,db2,sybase,http {ans-htttp} &lt;br /&gt;&lt;br /&gt;48). select odd one-sybase,db2,oracle,unix {ans-unix} &lt;br /&gt;&lt;br /&gt;49). A can copy 50 papers in 10 hrs while A &amp;B together can copy 70 papers in 10 hrs.how many hrs will be required for B to copy 26 papers?&lt;br /&gt;Ans: 13hrs &lt;br /&gt;&lt;br /&gt;50). Find eqn of line having intercepts (0,3) &amp; (-2,0)&lt;br /&gt;Ans Y=(3/2)X + 3&lt;br /&gt;Formula x/a + y/b = 1&lt;br /&gt;&lt;br /&gt;51). ) if n=68*12*51 which one is not int?&lt;br /&gt;a&gt;n/136 b&gt;n/244 c&gt; n/72&lt;br /&gt;Ans: c&lt;br /&gt;&lt;br /&gt;52). Which shape will be obtained by using the following values for X and Y &lt;br /&gt;X 0 10 100 1000 9999 &lt;br /&gt;Y 0.00001 1.02 1.72 3.00 4.72 &lt;br /&gt;Ans: Y= log10(X) &lt;br /&gt;&lt;br /&gt;53). If log 0.317=0.3332 and log 0.318=0.3364 then find log 0.319 ?&lt;br /&gt;Sol) log 0.317=0.3332 and log 0.318=0.3364, then&lt;br /&gt;log 0.319=log0.318+(log(0.318-0.317)) = 0.3396&lt;br /&gt;&lt;br /&gt;54). A box of 150 packets consists of 1kg packets and 2kg packets. Total weight of box is 264kg. How many 2kg packets are there ?&lt;br /&gt;Sol) x= 2 kg Packs&lt;br /&gt;y= 1 kg packs&lt;br /&gt;x + y = 150 .......... Eqn 1&lt;br /&gt;2x + y = 264 .......... Eqn 2&lt;br /&gt;Solve the Simultaneous equation; x = 114&lt;br /&gt;so, y = 36&lt;br /&gt;Ans : Number of 2 kg Packs = 114.&lt;br /&gt;&lt;br /&gt;55). A plane moves from 9°N40°E to 9°N40°W. If the plane starts at 10 am and takes 8 hours to reach the destination, find the local arrival time ?&lt;br /&gt;Sol) Since it is moving from east to west longitide we need to add both&lt;br /&gt;ie,40+40=80&lt;br /&gt;multiply the ans by 4&lt;br /&gt;=&gt;80*4=320min&lt;br /&gt;convert this min to hours ie, 5hrs 20min&lt;br /&gt;It takes 8hrs totally . So 8-5hr 20 min=2hr 40min&lt;br /&gt;So the ans is 10am+2hr 30 min&lt;br /&gt;=&gt;ans is 12:30 it will reach&lt;br /&gt;&lt;br /&gt;56). A fisherman's day is rated as good if he catches 9 fishes, fair if 7 fishes and bad if 5 fishes. He catches 53 fishes in a week n had all good, fair n bad days in the week. So how many good, fair n bad days did the fisher man had in the week&lt;br /&gt;Ans:4 good, 1 fair n 2 bad days&lt;br /&gt;Sol) Go to river catch fish&lt;br /&gt;4*9=36&lt;br /&gt;7*1=7&lt;br /&gt;2*5=10&lt;br /&gt;36+7+10=53...&lt;br /&gt;take what is given 53&lt;br /&gt;good days means --- 9 fishes so 53/9=4(remainder=17) if u assume 5 then there is no chance for bad days.&lt;br /&gt;fair days means ----- 7 fishes so remaining 17 --- 17/7=1(remainder=10) if u assume 2 then there is no chance for bad days.&lt;br /&gt;bad days means -------5 fishes so remaining 10---10/5=2days.&lt;br /&gt;Ans: 4 good, 1 fair, 2bad. ==== total 7 days.&lt;br /&gt;x+y+z=7--------- eq1&lt;br /&gt;9*x+7*y+5*z=53 -------eq2&lt;br /&gt;multiply eq 1 by 9,&lt;br /&gt;9*x+9*y+9*z=35 -------------eq3&lt;br /&gt;from eq2 and eq3&lt;br /&gt;2*y+4*z=10-----eq4&lt;br /&gt;since all x,y and z are integer i sud put a integer value of y such that z sud be integer in eq 4 .....and ther will be two value y=1 or 3 then z = 2 or 1 from eq 4&lt;br /&gt;for first y=1,z=2 then from eq1 x= 4&lt;br /&gt;so 9*4+1*7+2*5=53.... satisfied&lt;br /&gt;now for second y=3 z=1 then from eq1 x=3&lt;br /&gt;so 9*3+3*7+1*5=53 ......satisfied&lt;br /&gt;so finally there are two solution of this question&lt;br /&gt;(x,y,z)=(4,1,2) and (3,3,1)...&lt;br /&gt;&lt;br /&gt;57) Y catches 5 times more fishes than X. If total number of fishes caught by X and Y is 42, then number of fishes caught by X?&lt;br /&gt;Sol) Let no. of fish x catches=p&lt;br /&gt;no. caught by y =r&lt;br /&gt;r=5p.&lt;br /&gt;r+p=42&lt;br /&gt;then p=7,r=35&lt;br /&gt;&lt;br /&gt;58) Three companies are working independently and receiving the savings 20%, 30%, 40%. If the companies work combinely, what will be their net savings?&lt;br /&gt;suppose total income is 100&lt;br /&gt;so amount x is getting is 80&lt;br /&gt;y is 70&lt;br /&gt;z =60&lt;br /&gt;total=210&lt;br /&gt;but total money is 300&lt;br /&gt;300-210=90&lt;br /&gt;so they are getting 90 rs less&lt;br /&gt;90 is 30% of 300 so they r getting 30% discount&lt;br /&gt;&lt;br /&gt;59) The ratio of incomes of C and D is 3:4.the ratio of their expenditures is 4:5. Find the ratio of their savings if the savings of C is one fourths of his income?&lt;br /&gt;Sol) incomes:3:4&lt;br /&gt;expenditures:4:5&lt;br /&gt;3x-4y=1/4(3x)&lt;br /&gt;12x-16y=3x&lt;br /&gt;9x=16y&lt;br /&gt;y=9x/16&lt;br /&gt;(3x-4(9x/16))/((4x-5(9x/16)))&lt;br /&gt;Ans:12/19&lt;br /&gt;&lt;br /&gt;60).The size of a program is N. And the memory occupied by the program is given by M = square root of 100N. If the size of the program is increased by 1% then how much memory now occupied ?&lt;br /&gt;Sol) M=sqrt(100N)&lt;br /&gt;N is increased by 1%&lt;br /&gt;therefore new value of N=N + (N/100)&lt;br /&gt;=101N/100&lt;br /&gt;M=sqrt(100 * (101N/100) )&lt;br /&gt;Hence, we get M=sqrt(101 * N).&lt;br /&gt;&lt;br /&gt;61). A person had to multiply two numbers. Instead of multiplying by 35, he multiplied by 53 and the product went up by 540. What was the raised product?&lt;br /&gt;a) 780 b) 1040 c) 1590 d) 1720&lt;br /&gt;Sol) x*53-x*35=540=&gt; x=30 therefore, 53*30=1590 Ans&lt;br /&gt;&lt;br /&gt;Just Go through the previous year question papers and solve all the questions. The pattern of the questions r same only the values are changed, so go through and solve those questions.&lt;br /&gt;Wishing U all the best.&lt;br /&gt;&lt;br /&gt;Critical reasoning (30 min - 3 passages - 12 Qs)&lt;br /&gt;For the Critical reasoning section refer barons 12th edition critical reasoning and solve all the model question papers that are given there. As try to mug up the answers.&lt;br /&gt; &lt;br /&gt;Out of the 12 questions 8 are from the model test papers and other 4s are easily solvable.&lt;br /&gt;As I think all the 12 answers of this section is of mine are correct.&lt;br /&gt; &lt;br /&gt;RESULT OF THE ONLINE TEST DECLARED AT EVENING 09:50 Approx.&lt;br /&gt; &lt;br /&gt;I am one of the candidates who was short listed for the Technical Interview.&lt;br /&gt; &lt;br /&gt;As it is was very late. So they Call Us at the next day at 1:00 PM sharp.&lt;br /&gt; &lt;br /&gt;Technical Interview&lt;br /&gt;TechnAs the technical round was supposed to take place at 1:00 PM, but unfortunately the technical interviews for the our college starts at 07:00 pm, My Technical Interview takes place at 08:30 Pm.&lt;br /&gt;I have to wait for the long time at the door of the Interviewer cabin as the Interviewer is writing something on the paper.&lt;br /&gt;As I entered the room. &lt;br /&gt;ME:-Good Evening Sir.&lt;br /&gt;SIR: Have seat.&lt;br /&gt;ME: Thank you very much sir, and takes the seat.&lt;br /&gt;SIR: Tell me about yourself.&lt;br /&gt;Me: I said my name, my college name, my degree, about my family and my hobbies, some of my positive qualities, my role model.&lt;br /&gt;SIR: Can U write the program of string palindrome in C++.&lt;br /&gt;Me: Yes Sir I Can. He gave me a paper , And Then I wrote The whole Code for the String palindrome using pointers. Please Be specific and don’t waste time , if u don’t know the code, just say sorry sir/mam.&lt;br /&gt;SIR: Can U write the program &lt;br /&gt;1 4. &lt;br /&gt;2 3&lt;br /&gt;3 2&lt;br /&gt;4 1. &lt;br /&gt;Me: Yes Sir I Can. And then I wrote the code , It just take two for loops(nested) one move from 1 to 4 and other from the 4 to 1.&lt;br /&gt;Sir: What are your core (favorite) subjects in MCA?&lt;br /&gt;Me: I said Computer Networks sir.&lt;br /&gt;Sir:-Oh Really Computer Networks.&lt;br /&gt;Me:-Yes Sir, I think as I said computer networks that was out of the leak no MCA students before me told that answer(As I think), But I gave that answer because I m having very good knowledge about the Computer networks both theoretically as well as practically. (Please don’t bluff).&lt;br /&gt;SIR:- OK, Brashaket Tell me What Is WINC?&lt;br /&gt;ME:- It was an blunder for me as said Computer networks , and I don’t know the answer of that question . But I m still confident and simply say very politely sorry sir.&lt;br /&gt;SIR:-OK, What is URL?&lt;br /&gt;Me- URL Means Uniform Resource Locator. And then told all the methods and the whole working of URL.&lt;br /&gt;SIR:- What is DNS.&lt;br /&gt;ME:-DNS means (Domain name systems) and then told whole working of the DNS.&lt;br /&gt;SIR:-Can U tell me what is SMTP?&lt;br /&gt;ME:-It means Simple Mail Transfer Protocol. And told the working of the SMTP.&lt;br /&gt;SIR:-What is Cryptography?&lt;br /&gt;ME:-Told.&lt;br /&gt;SIR:- Sir: What are the different types of Topologies?, what are merits &amp;demerits of each?&lt;br /&gt;Me:-BUS,STAR,MESH,RING,TREE,PARTIAL MESH topology. And told the merits and demerits of all.&lt;br /&gt;Sir: what is the Topology used in Ur college?&lt;br /&gt;ME:- I said  it is star topology.&lt;br /&gt;SIR:-What r the different networking devices?&lt;br /&gt;ME:- Sir, HUB, Switch, Routers, Bridges, etc.&lt;br /&gt;SIR:-What is the difference between the switch, routers and bridges?&lt;br /&gt;Me:-I Told.&lt;br /&gt;SIR:- Then He made a very close look to my resume. (Be prepare with each and every aspect of your resume and don’t write any single thing that u don’t know.). Then He asked me About IBM DB2, as I have wrote IBM DB2 in the technical skills section in my resume.&lt;br /&gt;ME:-Told.(As I did the training of  DB2 in our College).&lt;br /&gt;SIR:-Ok Brashaket. Then He asked me about my projects? Please explain?&lt;br /&gt;Me:-As I wrote the 2 of my projects their.  I Explained. At that time when I was explaining I asked him for a blank paper , and I explained that on a paper. My Project is on Data Dictionary of Oracle, SQL-Server and MS-ACCESS. It was titled Data dictionary management system. It eliminate the writing of complex queries.&lt;br /&gt;I told Each and every aspect of the project from the technologies to the reports.(the explanation took approx 15-20 minutes.&lt;br /&gt;SIR:- He said Very good Brashaket. And then he asks me that R U really interested in development ?&lt;br /&gt;Me: I told yes very much sir.(I don’t know why he asks that question).&lt;br /&gt;SIR:-Ok Brashaket You may leave now . Then He Offer shake hands to me ?&lt;br /&gt;Me:-Shake hand with him and Said thank you sir? Have a good day. And leave the room.&lt;br /&gt;My technical round took about 40-45 minutes .&lt;br /&gt;At 09:30 PM the results of the technical round was declared , My name is in the list of the selected candidates . and then they gave us a form to fill. And as it was very late they told us to come tomorrow at 09:00 AM sharp.&lt;br /&gt;As 138 students of my college appeared for the tech. round . out of 138 , 70 are short listed for the Managerial reasoning (M.R.) round.&lt;br /&gt;&lt;br /&gt;Speak very polite and be confident in the interview. Don’t try answering the question that you really don’t know. Be very careful with the resumes keep it as simple as you can .&lt;br /&gt;&lt;br /&gt;MR Interview &lt;br /&gt;At 09:AM sharp the M.R. interviews of the students of my college had started.&lt;br /&gt;My Number came at approx 11:00 AM.&lt;br /&gt;Me:- I have to go to the panel number 9.&lt;br /&gt;Me:- Knocked the door. And said Sir, May I come in ? There is an gentle man of age approx 50.&lt;br /&gt;Sir:-Please come in?&lt;br /&gt;Sir:- Have Seat?&lt;br /&gt;Me:- I took and told thank u very much sir.&lt;br /&gt;Sir:- He asked me what is the correct pronunciation of your name?&lt;br /&gt;Me:- I told.&lt;br /&gt;Sir:- Then he asked me that what is the meaning of ur name?&lt;br /&gt;Me:-Told (It is one the name of the lord Shiva).&lt;br /&gt;Sir:- Ok Brashaket . Tell me about yourself?&lt;br /&gt;Me:- I told blah blah ?&lt;br /&gt;Sir:- Tell me something about the family background?&lt;br /&gt;Me:- Told.&lt;br /&gt;Sir:- Then He gave me a puzzle to solve.&lt;br /&gt;Me:- I am  able to solve that one perfectly.&lt;br /&gt;Sir:- What do u know about the new technology?&lt;br /&gt;Me:-I told abt the nano technology.&lt;br /&gt;Sir:-Then He asked me about the criteria behind launching the new OS?&lt;br /&gt;ME:- I Told. That For the better appearance and for the better GUI and For the Better Security the new OS is lunched.&lt;br /&gt;Sir:-he seem to looked that he is not satisfied with the answer and then he told me that on the basis of these thing u will launch a new OS.&lt;br /&gt;Me:-yes Sir, Try to explain more, but he is not satisfied, as I think he is checking my patient . Again he was tried to frustrate me but I said sir in my opinion the new OS are launched on these basis. And the other third party s/w can easily be installed.&lt;br /&gt;Sir:- Ok , Any Questions Brashaket?&lt;br /&gt;Me:-Sir what kind of preparation I have to do before joining the   TCS training program?&lt;br /&gt;Sir:- Just learn new and more languages and technologies.&lt;br /&gt;Sir:- Thank U very much Brashaket?&lt;br /&gt;Me:- Thank U very much sir , It was really nice Meeting U?&lt;br /&gt;Sir:- Ok, You may leave now?&lt;br /&gt;Me:- Leave and told again thank u sir and have a good day sir. and left.&lt;br /&gt;My M.R. Interview lasting approx for about 35 minutes.&lt;br /&gt;I m very scared as the persons whose name is called think that he has cleared the MR round but some of the candidates r called the interviewers who took the MR interviews shake hands with them and then said “You may leave for home now”. It was a blunder for the person that think that he is selected but the result is that he is rejected.&lt;br /&gt;After 2  hour  I was Called for the HR round. Luckily I m selected for the HR Round.&lt;br /&gt;&lt;br /&gt;HR Interview &lt;br /&gt;Again I have to wait for a long time as the interviewer is writing something. But he was as decent personality. He said sorry for that, that u have to wait for a long time, I told Its OK, No problem sir.&lt;br /&gt;SIR:- May I know Ur good name please?&lt;br /&gt;ME:-Told.&lt;br /&gt;SIR:-What is the meaning of the name?&lt;br /&gt;Me:-Told&lt;br /&gt;Sir:- How was the Day Brashaket ?&lt;br /&gt;Me:- It was Nice Sir.&lt;br /&gt;Sir:- How was Previous two interviews?&lt;br /&gt;Me: Both of the interviews are Very nice sir.&lt;br /&gt;SIR:-Tell me something abt ur family background?&lt;br /&gt;Me:-Told&lt;br /&gt;SIR:- How many siblings do u have?&lt;br /&gt;Me:- Told&lt;br /&gt;Sir:- what Ur father is doing?&lt;br /&gt;Me:- Told( As my father is working in a cement industry In Maihar)&lt;br /&gt;Sir:- He asked me abt the other cement plants there?&lt;br /&gt;Me:-Told.&lt;br /&gt;Sir:- He told that satna is known for the cement industries naa , can u tell me the names of the cement industries situated their?&lt;br /&gt;Me:-Told.&lt;br /&gt;Sir:- Ok Brashaket Suppose U have nine dots and u have to connect these dots with the help of the four line and u don’t have to lift ur pen. Can U?&lt;br /&gt;Me:- I said I will Try.&lt;br /&gt;&lt;br /&gt;He gave me the pattern like this&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;I m able to solve that one , just put ur pen in the middle dot of the second row and then make to diagonals line and to perpendicular lines. like that:-&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;Sir:- OK , Suppose that U have a pencil and U have to cross a river with the help of that pencil. How you will cross?&lt;br /&gt;&lt;br /&gt;Me:- I gave the answer like this&lt;br /&gt;Sir there might be the probability that there is no water is available on the river. Or we can map the depth of the river with the help of that pencil by dipping it in the river and if the river is not so deep then we can cross the river easily.&lt;br /&gt;Sir:-Oh, really?&lt;br /&gt;Me:-Yes sir , As I think.&lt;br /&gt;Sir:- Then He gave me a situation , that suppose u r appointed in a team in a s/w company. The team consist of the 4 members. He said U belongs to a very low ranked institute like TIT suppose one of the member of the team is from IIT kanpur, one from IIT Bombay and one from the Other IITs and they think that u belongs to a very low standard institute so they r not coordination with u , in that situation what u will do?&lt;br /&gt;Me:- Told , I am trying to satisfy him and I am able to satisfy him with my answer.&lt;br /&gt;Sir:- Is their any pan for the higher studies?&lt;br /&gt;Me:- No Sir, As I m going to complete My PG program and Now I wanted do job now.&lt;br /&gt;Sir:- Tell me something about ur weaknesses?&lt;br /&gt;Me:-Told.(BE Prepare and don’t bluff).&lt;br /&gt;Sir:-Asked some more questions abt the my strengths and weaknesses?&lt;br /&gt;Me:-I told.&lt;br /&gt;Sir:- Is there any location constraints?&lt;br /&gt;Me:- No Sir, Yoy can through me in any part of the the world.&lt;br /&gt;Sir:-laughed. Are U ready to sign the bond ?&lt;br /&gt;Me:-Yes sir.&lt;br /&gt;Sir:- All The Best Brashaket.&lt;br /&gt;Me:-Thank U Sir.&lt;br /&gt;&lt;br /&gt;Sir:-Ok Brashaket , Thanks and U may leave Now.&lt;br /&gt;Me:-Thank U very much Sir and have a good day sir and left.&lt;br /&gt;&lt;br /&gt;My H.R. Interview lasting approx for about 45 minutes.&lt;br /&gt;After Waiting for a long time the final result of the selection process is declared at 10:00 PM . And Bhagwan ki Kripa aur maa &amp; papa ke ashirwaad aur meri mehnat ke karan I Was One of the candidates who is declared as a part of TCS.&lt;br /&gt;Finally 56 Students r selected from our college, but only 4 r from the MCA. Remaining 52 r from B.E..&lt;br /&gt;It was the happiest moment in my life.&lt;br /&gt;Friends any one can easiliy grab TCS if you are technically strong in 3 of your department paper and with 100% confidence and positive attitude. GOOD LUCK. Meet you in TCS. &lt;br /&gt;Regards&lt;br /&gt;Brashaket Pratap Singh Bais&lt;br /&gt;&lt;br /&gt;(TIT Bhopal)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-4914523225570872454?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/4914523225570872454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/tcs4.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/4914523225570872454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/4914523225570872454'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/tcs4.html' title='tcs4'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-2180270473650513817</id><published>2010-08-13T00:32:00.000-07:00</published><updated>2010-08-13T00:32:03.897-07:00</updated><title type='text'>android os</title><content type='html'>ANDROID TUTORIAL&lt;br /&gt;&lt;br /&gt;------------------------&lt;br /&gt;&lt;br /&gt;  Google has recently released the Android platform for developing  Mobile applications. The language used for   developing  Android programs, is Java.  But, it is not j2me.  &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;    No wireless application developer can ignore  Android. Google   is the best known brand name, among the users of the web and Android comes from Google..  &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;   I am presenting this hands-on tutorial, as a sequel to my j2me series. Adequate  knowledge of core-java , especially, Event-handling , Swing and inner-classes is assumed.   Though Android does not make use of Swing, it uses  similar ideas.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;  We can develop Android lessons and applications in Eclipse environment. Google have provided an Eclipse-plugin for Android. This is the popular method. Google have not given direct support to Netbeans. But, some Netbeans users have developed a method for running Android in Netbeans .It is available at  http://undroid.nolimit.cz/. You can find more screenshots and guidance in:&lt;br /&gt;&lt;br /&gt;http://eppleton.com/blog/.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; But, we can develop Android lessons without using either Eclipse or Netbeans. The necessary command-line tools have been provided by Google. I found that using these command-line tools is  easier than either Eclipse or Netbeans method. So, I am basing all the following lessons on these tools. I think, most readers will agree with my view, after they try this method as well as Eclipse method. The Android site at 'code.google.com/android'  has already given step-by-step instructions about Android in Eclipse. You can also get more details with screen shots from  a wonderful website &lt;br /&gt;&lt;br /&gt;at www.tanguay.info/web/welcome.php"             &lt;br /&gt;&lt;br /&gt;titled 'Edward's Web Developer site'. He gives excellent guidance with plenty of screen shots&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;    But, the Android site lacks clarity, about the command-line method. Hence, I think I am adding something useful by writing on command-line method instead of  simply repeating the material ,in Android site.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;------------------------------------------&lt;br /&gt;&lt;br /&gt;   Let us begin  from the beginning. The first step is downloading the Android SDK from &lt;br /&gt;&lt;br /&gt;code.google.com/android/download&lt;br /&gt;&lt;br /&gt;(version m5-rc14, Feb-12, 2008). Android was released in November, 2007 . It has been revised in the Feb-2008  version.Some of the earlier examples may not work in the newer version.&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;&lt;br /&gt;I am working in Windows-2000 and so I downloaded the windows version. The supported platform in Windows is either Windows-XP or Vista.( Mac OS 10 &amp; Ubuntu Linux are the other platforms mentioned). However, it works well in my Win-2000. It is advisable to have atleast 512MB memory. The android SDK is a zip file. I unzipped it to C:\unzipped\android and later, I copied that folder to d:\android. If you want, you can simply copy it to another drive like g:\android also. In the following lessons &lt;br /&gt;&lt;br /&gt;  d:\android. is used.&lt;br /&gt;&lt;br /&gt;  If you want to develop using Eclipse, you must have installed either Eclipse3.2 or Eclipse3.3(Europa). I have tested with Eclipse3.2. No problem.It works. But, we require ADT  (ie) Android Development Tools plugin for Eclipse, if you are using Eclipse.You can get this plugin from code.google.com/android/adt_download.You have to be careful about the ADT version number.It is       ADT-0.3.3.&lt;br /&gt;&lt;br /&gt;--&lt;br /&gt;&lt;br /&gt; As my present focus is on command-line method, let me begin straight away and give a simple demo.&lt;br /&gt;&lt;br /&gt;The procedure given here is common for all our experiments and so I will not be repeating it in each demo. So, please note it down carefully. &lt;br /&gt;&lt;br /&gt;In my first demo, I will have a customary button and textbox ( called EditField in Android). When I click the button, I want the message "SUCCESS!" to be displayed in textbox. Just as an exercise, I am using two buttons and two textboxes.&lt;br /&gt;&lt;br /&gt;-------------------------------------&lt;br /&gt;&lt;br /&gt;The first step is to start the Emulator&lt;br /&gt;&lt;br /&gt;cd to d:\android\tools &lt;br /&gt;&lt;br /&gt;d:\android\tools&gt;emulator&lt;br /&gt;&lt;br /&gt;It will take a long time to get started. Do not be in a hurry. Wait till it gets fully started. And do not  close that window carelessly by mistake. In that case, you will have to start it again and wait for a long time again. Finally, we get the emulator screen( starting)..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt; xml="true" ns="urn:schemas-microsoft-com:vml" prefix="v" namespace=""&gt;&lt;br /&gt;&lt;br /&gt;  The second step is to give the following command., from another command window.&lt;br /&gt;&lt;br /&gt;d:\android\tools&gt;&lt;br /&gt;&lt;br /&gt;activityCreator --out  demo                                   mypack.mydemos.demo&lt;br /&gt;&lt;br /&gt;This  means that my project is 'demo' and my package is 'mypack.mydemos'. Clear enough.&lt;br /&gt;&lt;br /&gt;A number of folders are created automatically by this command. such as &lt;br /&gt;&lt;br /&gt;tools\demo\src,                                                                      tools\demo\bin ,  &lt;br /&gt;&lt;br /&gt;tools\demo\res.   &lt;br /&gt;&lt;br /&gt;  We need to note  the src and res folders carefully. We will place the java source file in src folder and main.xml file in res\layout, overwriting any files that are generated automatically. For the moment, we can think of the res\layout folder as the one which decides the gui design. As in asp.net, flex etc, the gui details are specified in xml file. But how shall we write the XML file? by hand? Not too difficult .But....Luckily, there is an open-source gui designer named 'DroidDraw' available in www.droiddraw.org .It is a nice tool and if you like it, you can send your appreciation to brendan.d.burns@gmail.com. He has given a simple tutorial too, on how to use this gui tool.&lt;br /&gt;&lt;br /&gt; I downloaded this software from the above site. I unzipped it. ( any folder). When we click on the icon, we get the screen as given below.(droid-draw)&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;( drawing canvas area)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;======================================&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;( toolbox &amp; blank area)&lt;br /&gt;&lt;br /&gt;====================================&lt;br /&gt;&lt;br /&gt;Thus we get a window, showing the drawing canvas on leftside and toolbox and a blank area in the rightside. ( for printing purpose, I have split them into two screens) as above.&lt;br /&gt;&lt;br /&gt;From the toolbox, we learn that we are having controls like button,check,radio,spinner,edittext(textbox) and  textview (label) etc. There is also a combo  to choose  layout, in the canvas screen. . I am choosing 'absolute layout'. I simply drag and drop a button and an editview on the canvas.( drag and drop..do not click and drop! It won't work!).You will notice a number of tabs in toolbox. Select 'properties' tab.. After clicking the button on the canvas, give the id property of button as @id/button1. Similarly, for editview as @id/text1. Also, button2 and text2 After this, just click the 'generate' button at the bottom of  the blank window. We get the following XML file(main.xml) automatically generated. &lt;br /&gt;&lt;br /&gt;============================================&lt;br /&gt;&lt;br /&gt;// main.xml&lt;br /&gt;&lt;br /&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;br /&gt;&lt;br /&gt;&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"                  android:layout_height="wrap_content"              android:padding="10px"&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;EditText android:id="@+id/text1" android:layout_width="fill_parent"  android:layout_height="wrap_content"              /&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  &lt;Button  android:id="@+id/button1"  android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:layout_below="@id/text1"   android:layout_alignParentRight="true"   android:layout_marginLeft="10px"   android:text="click" /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;  &lt;EditText  android:id="@+id/text2"  android:layout_width="fill_parent"   android:layout_height="wrap_content"   android:layout_below="@id/button1"   /&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;  &lt;Button  android:id="@+id/button2"  android:layout_width="wrap_content"   android:layout_height="wrap_content"   android:layout_below="@id/text2"  android:layout_alignParentRight="true"  android:layout_marginLeft="10px" android:text="click" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/RelativeLayout&gt;&lt;br /&gt;&lt;br /&gt;We can now create our java source file. The code refers to main.xml for id of the controls.&lt;br /&gt;&lt;br /&gt;( d:\android\mydemos\ex1\demo.java).This is our work folder.&lt;br /&gt;&lt;br /&gt;//demo.java&lt;br /&gt;&lt;br /&gt;package mypack.mydemos;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;import android.app.Activity;&lt;br /&gt;&lt;br /&gt;import android.os.Bundle;&lt;br /&gt;&lt;br /&gt;import android.view.View;&lt;br /&gt;&lt;br /&gt;import android.widget.*;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;public class demo extends Activity  &lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Button     button1,button2;&lt;br /&gt;&lt;br /&gt;EditText   text1,text2;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;&lt;br /&gt;    public void onCreate(Bundle icicle)&lt;br /&gt;&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        super.onCreate(icicle);&lt;br /&gt;&lt;br /&gt;       setContentView(R.layout.main);&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;text1=  (EditText) findViewById(R.id.text1);&lt;br /&gt;&lt;br /&gt;button1 = (Button) findViewById(R.id.button1);&lt;br /&gt;&lt;br /&gt;text2=  (EditText) findViewById(R.id.text2);&lt;br /&gt;&lt;br /&gt;button2 = (Button) findViewById(R.id.button2);&lt;br /&gt;&lt;br /&gt;  button1.setOnClickListener(new clicker());&lt;br /&gt;&lt;br /&gt;  button2.setOnClickListener(new clicker());&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; //-----------------------------------&lt;br /&gt;&lt;br /&gt; class  clicker implements &lt;br /&gt;&lt;br /&gt;                         Button.OnClickListener&lt;br /&gt;&lt;br /&gt;  {               &lt;br /&gt;&lt;br /&gt;  public void onClick(View v)&lt;br /&gt;&lt;br /&gt;     {&lt;br /&gt;&lt;br /&gt;     if(v==button1){text1.setText("welcome"); }&lt;br /&gt;&lt;br /&gt;     if(v==button2){text2.setText("hello");   }     &lt;br /&gt;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  //----------------------------&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//******************************************&lt;br /&gt;&lt;br /&gt; The Android documentation and sample programs use anonymous inner class. I think , it is quite unnecessary and is very tedious to follow. Instead , I have used  user-defined  'clicker'. This makes the code cleaner and more readable.&lt;br /&gt;&lt;br /&gt;   This is just like any swing program. In Android Terminology, an Activity is like a frame in swing ( a screen). Just like ActionListener, here also we have, OnClickListener. &lt;br /&gt;&lt;br /&gt;    I am not going into detailed theory now. I just  want to show how to develop and run a program first. Theory will follow later.&lt;br /&gt;&lt;br /&gt;==&lt;br /&gt;&lt;br /&gt;We have to copy this file(demo.java) to:   &lt;br /&gt;&lt;br /&gt; d:\android\tools\demo\src\mypack\mydemos' &lt;br /&gt;&lt;br /&gt;Go to d:\android\tools\demo&lt;br /&gt;&lt;br /&gt;Give path=&lt;br /&gt;&lt;br /&gt;c:\winNT\system32;c:\jdk1.5\bin;e:\ant1.6\bin&lt;br /&gt;&lt;br /&gt;( carefully note that this will not work with jdk1.4.2. It requires jdk1.5).&lt;br /&gt;&lt;br /&gt;Secondly, how about the reference to Ant? Ant is a famous build tool from Apache Software foundation. Android requires the latest version of Ant for Windows(ie) Ant1.6. Do I have to know how to write the Ant's build.xml file? .NO. It is automatically created by the command.&lt;br /&gt;&lt;br /&gt;So, I downloaded ant1.6 from the Apache website. It is a compact zip file. I have unzipped it and placed it as E:\ant1.6)&lt;br /&gt;&lt;br /&gt;Now give the command 'ant'&lt;br /&gt;&lt;br /&gt;d:\android\tools\demo&gt;ant&lt;br /&gt;&lt;br /&gt;We will get a series of messages. If we had done the previous steps correctly, we will get the message 'BUILD SUCCESSFUL".  Otherwise , we will get error messages, with line numbers where the errors occurred. We can correct them and build again.&lt;br /&gt;&lt;br /&gt;The build process  would have created a zip file named 'demo.apk' in demo\bin folder. All that remains now is to run the program in the emulator. As you remember, we have already started the emulator and it is running.&lt;br /&gt;&lt;br /&gt;Now copy d:\android\tools\demo\bin\demo.apk  to d:\android\tools. After copying, give the command as:&lt;br /&gt;&lt;br /&gt;...\tools&gt;adb   install    demo.apk&lt;br /&gt;&lt;br /&gt;After giving this command. go to the emulator window. You will find a checkpattern displayed for a while. Then an additional button appears in the screen with caption 'demo'. Our program has been installed. We can test it by clicking on this 'demo'button.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can execute the program 'demo' now. Two textboxes and two buttons will appear. Click on button1. 'welcome' will appear in text1. Click on button2.'how are you?' will appear in text2.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; The result is shown   below.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That completes our first  demo in  android.&lt;br /&gt;&lt;br /&gt;We will be following exactly same procedure for all our demos. We will hereafter , see xml file and java file only, for the various demos. After a few more demos, it will be enough if I give the imports, declaration, definition and event handler.&lt;br /&gt;&lt;br /&gt;  The Android SDK comes with a number of sample applications. Within the APIDemos folder, we have a folder named 'Views'. I read it as 'GUI'. It deals with layouts and controls and animations etc. There are a lot of demos. It may be confusing at first. Though, we may like to modify and simplify the code later, it is instructive to try each one of the sample programs by clicking on 'apidemos' button in the emulator screen and getting familiarity .&lt;br /&gt;&lt;br /&gt;(I will list and give a brief comment on these, later).&lt;br /&gt;&lt;br /&gt;*******************************************&lt;br /&gt;&lt;br /&gt;DEMO-2  ( SPINNER)&lt;br /&gt;&lt;br /&gt;   As usual, the standard widgets are label(textview), textbox(edittext), combo(spinner), check, radio, ticker etc. I will now give a  demo for spinner. I have provided a spinner, button and a text to display the selected item in  edittext.&lt;br /&gt;&lt;br /&gt;We can design our layout as before using DroidDraw and get the following main.xml.&lt;br /&gt;&lt;br /&gt;----------------------------------&lt;br /&gt;&lt;br /&gt;main.xml&lt;br /&gt;&lt;br /&gt;(obtained by using DroidDraw).&lt;br /&gt;&lt;br /&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;AbsoluteLayout               android:id="@+id/widget0" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/ apk/res/android"                                    &gt;                                            &lt;Spinner                   android:id="@+id/spinner1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="70px" android:layout_y="42px"                            &gt;                                            &lt;/Spinner&gt;                                         &lt;Button                    android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="confirm" android:layout_x="70px" android:layout_y="112px"                          &gt;                                           &lt;/BButton&gt;                                   &lt;EditText                       android:id="@+id/text1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="EditText" android:textSize="18sp" android:layout_x="70px" android:layout_y="182px"                           &gt;                                                     &lt;/EditText&gt;                        &lt;/AbsoluteLayout&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;The corresponding java source file is given below.&lt;br /&gt;&lt;br /&gt;// demo.java ( for spinner)&lt;br /&gt;&lt;br /&gt;package  mypack.mydemos;      &lt;br /&gt;&lt;br /&gt;import android.app.Activity;                   import android.os.Bundle;                      import android.widget.*;   &lt;br /&gt;&lt;br /&gt;import android.view.View;&lt;br /&gt;&lt;br /&gt;public class    demo extends Activity            {                                                     Spinner   spinner1;                                 Button    button1;                                EditText   text1; &lt;br /&gt;&lt;br /&gt;      @Override                                                protected void onCreate(Bundle icicle)  &lt;br /&gt;&lt;br /&gt; {                                                              super.onCreate(icicle);                            setTheme(android.R.style.Theme_Dark);         setContentView(R.layout.main);   &lt;br /&gt;&lt;br /&gt;spinner1 = (Spinner) &lt;br /&gt;&lt;br /&gt;         findViewById  (R.id.spinner1);  &lt;br /&gt;&lt;br /&gt;button1    = (Button) &lt;br /&gt;&lt;br /&gt;          findViewById (R.id.button1);                                               text1      = (EditText) &lt;br /&gt;&lt;br /&gt;         findViewById  (R.id.text1);       &lt;br /&gt;&lt;br /&gt;                                         ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,                  android.R.layout.simple_spinner_item, array);        &lt;br /&gt;&lt;br /&gt;adapter.setDropDownViewResource             (android.R.layout.simple_spinner_dropdown_ item);                   &lt;br /&gt;&lt;br /&gt;  spinner1.setAdapter(adapter);         button1.setOnClickListener(  new clicker());    }         &lt;br /&gt;&lt;br /&gt;                                           private static final String[] array = {        "sunday", "monday", "tuesday", "wednesday",         "thursday", "friday", "saturday" };  &lt;br /&gt;&lt;br /&gt;  // ---inner class  -------//  &lt;br /&gt;&lt;br /&gt;class   clicker implements          Button.OnClickListener&lt;br /&gt;&lt;br /&gt;{                                                           public   void  onClick(View   v)              {        &lt;br /&gt;&lt;br /&gt;String       s = (String) spinner1.getSelectedItem();          text1.setText(s);                                }                                         &lt;br /&gt;&lt;br /&gt;}   &lt;br /&gt;&lt;br /&gt;//----------------------------  &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;As before place demo.java in d:\android\tools\demo\src\mypack\mydemos.&lt;br /&gt;&lt;br /&gt;Place main.xml in d:\android\tools\demo\res\layout&lt;br /&gt;&lt;br /&gt;Build using ant. Deploy demo.apk to the emulator exactly as in previous demo. The original demo gets overwritten. But, our work folder , where we have our xml and java files is d:\android\mydemos\ex1.They  are intact. So, no problem..The current java and xml files are in d:\android\mydemos\ex2.&lt;br /&gt;&lt;br /&gt;When we click on the spinner, we get the items displayed as drop-down. We select an item and confirm. The selected item appears in text1. I am not going to explain the code. It is simple enough, if we remember our core java.&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;DEMO-3 ( TICKER)&lt;br /&gt;&lt;br /&gt;The third demo is a 'ticker' having a textbox for entering the ticker's text, a ticker(timer) , two labels(editview) one for status and the other for diplaying the sliding message.&lt;br /&gt;&lt;br /&gt;// main.xml&lt;br /&gt;&lt;br /&gt;(obtained by using DroidDraw)&lt;br /&gt;&lt;br /&gt;(d:\andoid\mydemos\ex3\main.xml)&lt;br /&gt;&lt;br /&gt;&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"                                   android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:orientation="vertical"                                        &gt;                                                                           &lt;EditText android:id="@+id/text1"        android:layout_width="fill_parent"        android:layout_height="wrap_content"                          /&gt;                                                                          &lt;Ticker android:id="@+id/ticker1"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_marginTop="20dip"                                /&gt;                                                                   &lt;TextView android:id="@+id/label1"            android:layout_width="wrap_content"            android:layout_height="fill_parent"                                  /&gt;                                                                     &lt;/Ticker&gt;                                                        &lt;TextView android:id="@+id/label2"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_marginTop="20dip"                               /&gt;                                                          &lt;/LinearLayout&gt;&lt;br /&gt;&lt;br /&gt;LineraLayout with vertical orientation is like flowlayout but in vertical direction.&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;//d:\android\mydemos\ex3\demo.java(ticker demo)&lt;br /&gt;&lt;br /&gt;// to be placed in tools\demo\src\mypack\mydemo&lt;br /&gt;&lt;br /&gt;package  mypack.mydemos;      &lt;br /&gt;&lt;br /&gt;import android.app.Activity;                      import android.os.Handler;                     import android.os.Bundle;                      import android.view.View;                      import android.view.View.OnClickListener;      import android.widget.*;                            import java.util.Map;&lt;br /&gt;&lt;br /&gt;public class demo extends Activity &lt;br /&gt;&lt;br /&gt;          implements Ticker.TickerListener                  {                                                     Ticker            ticker1;                                TextView          label1,label2;                              EditText          text1;    &lt;br /&gt;&lt;br /&gt;                                                @Override                                                 protected void onCreate(Bundle icicle)                  {                                                                              super.onCreate(icicle);                          setContentView(R.layout.main);                  ticker1 = (Ticker)  findViewById(R.id.ticker1);                             label1 =(TextView)findViewById(R.id.label1);                         label2 = (TextView)findViewById(R.id.label2);   text1 =  (EditText) findViewById(R.id.text1);        ticker1.setTickerListener(this);                  text1.setOnClickListener(new clicker());    }   &lt;br /&gt;&lt;br /&gt;class clicker implements   EditText.OnClickListener                  {                                                       public void onClick(View v)                         {              &lt;br /&gt;&lt;br /&gt;label1.setText(text1.getText());            ticker1.startTicker();            label2.setText("Ticking...");                        }                                                   }   &lt;br /&gt;&lt;br /&gt;                                           public void onTickerFinished(Ticker view){                                                  label2.setText("Done!");         }  &lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;==================&lt;br /&gt;&lt;br /&gt;DEMO-4 (CHECKBOX)&lt;br /&gt;&lt;br /&gt;//d:\android\mydemos\ex4\main.xml &lt;br /&gt;&lt;br /&gt;( obtained by using DroidDraw)&lt;br /&gt;&lt;br /&gt;(copy this to tools\demo\res\layout\)&lt;br /&gt;&lt;br /&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;AbsoluteLayout                       android:id="@+id/widget1" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/ apk/res/android"                                                                         &gt;                                                                                     &lt;CheckBox                               android:id="@+id/check1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="java"                       android:layout_x="50px"                    android:layout_y="22px"                                                    &gt;                                                                                       &lt;/CheckBox&gt;       &lt;br /&gt;&lt;br /&gt;&lt;CheckBox                            android:id="@+id/check2" android:layout_width="wrap_content" android:layout_height="wrap_content"      android:text="C#"                       android:layout_x="50px"               android:layout_y="72px" &gt;                          &lt;/CheckBox&gt;  &lt;br /&gt;&lt;br /&gt;                                                   &lt;Button                                  android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Confirm"                android:layout_x="60px" android:layout_y="122px" &gt;                           &lt;/Button&gt;  &lt;br /&gt;&lt;br /&gt;                                                       &lt;EditText                                 android:id="@+id/text1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="EditText"               android:textSize="18sp"                 android:layout_x="60px" android:layout_y="202px" &gt;                            &lt;/EditText&gt;                                        &lt;/AbsoluteLayout&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;// d:\android\mydemos\ex4\demo.java ( checkbox)&lt;br /&gt;&lt;br /&gt;(to be copied to tools\demo\mypack\mydemos)&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;package mypack.mydemos;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;import android.app.Activity;&lt;br /&gt;&lt;br /&gt;import android.os.Bundle;&lt;br /&gt;&lt;br /&gt;import android.view.View;&lt;br /&gt;&lt;br /&gt;import android.widget.*;&lt;br /&gt;&lt;br /&gt;public class demo extends Activity&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;Button    button1;&lt;br /&gt;&lt;br /&gt;CheckBox  check1,check2;&lt;br /&gt;&lt;br /&gt;EditText  text1;     &lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;&lt;br /&gt;    public void onCreate(Bundle icicle)&lt;br /&gt;&lt;br /&gt;    {                                                                 super.onCreate(icicle);&lt;br /&gt;&lt;br /&gt;       setContentView(R.layout.main);       text1=(EditText)this.findViewById(R.id.text1);   check1=(CheckBox) findViewById(R.id.check1);       check2=(CheckBox) findViewById(R.id.check2);&lt;br /&gt;&lt;br /&gt;button1 =(Button) findViewById(R.id.button1);&lt;br /&gt;&lt;br /&gt; button1.setOnClickListener(new clicker());     &lt;br /&gt;&lt;br /&gt;    }                                                      class  clicker implements   Button.OnClickListener&lt;br /&gt;&lt;br /&gt;        {                                                               public void onClick(View v)&lt;br /&gt;&lt;br /&gt;            {&lt;br /&gt;&lt;br /&gt;            String   r = "";&lt;br /&gt;&lt;br /&gt;            if(check1.isChecked())&lt;br /&gt;&lt;br /&gt;             {               &lt;br /&gt;&lt;br /&gt;              r = r+"java"+"\n";&lt;br /&gt;&lt;br /&gt;              }&lt;br /&gt;&lt;br /&gt;             if(check2.isChecked())&lt;br /&gt;&lt;br /&gt;              {&lt;br /&gt;&lt;br /&gt;               r = r+"c#";&lt;br /&gt;&lt;br /&gt;              }&lt;br /&gt;&lt;br /&gt;               text1.setText(r);&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;******************************************&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;This is just the usual Java code and needs very little explanation. The only difference is the way , the controls are defined ( through res\layout\xml file).&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;********************************************&lt;br /&gt;&lt;br /&gt;DEMO-5  ( RADIO BUTTONS)&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; The next standard control is the radiobutton, within a radiogroup.&lt;br /&gt;&lt;br /&gt;//d:\android\mydemos\ex5\main.xml                  &lt;br /&gt;&lt;br /&gt;(to be placed in tools\demo\res\layout)&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"&gt; &lt;br /&gt;&lt;br /&gt;&lt;RadioGroup android:id="@+id/group1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"&gt; &lt;br /&gt;&lt;br /&gt;&lt;RadioButton android:id="@+id/radio1" android:text="madras" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;br /&gt;&lt;br /&gt;&lt;RadioButton android:id="@+id/radio2" android:text="bombay" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;br /&gt;&lt;br /&gt;&lt;/RadioGroup&gt; &lt;br /&gt;&lt;br /&gt;&lt;Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" /&gt; &lt;br /&gt;&lt;br /&gt;&lt;TextView android:id="@+id/label1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="where" /&gt; &lt;br /&gt;&lt;br /&gt;&lt;EditText android:id="@+id/text1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" android:textSize="18sp" android:layout_x="70px" android:layout_y="182px" /&gt; &lt;br /&gt;&lt;br /&gt;&lt;/LinearLayout&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;// d:\android\mydemos\ex5\demo.java&lt;br /&gt;&lt;br /&gt; //( radiobuttons)                                &lt;br /&gt;&lt;br /&gt;//(to be placed in tools\demo\src\mypack\mydemo)&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;package   mypack.mydemos;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;import android.app.Activity;&lt;br /&gt;&lt;br /&gt;import android.os.Bundle;&lt;br /&gt;&lt;br /&gt;import android.view.View;&lt;br /&gt;&lt;br /&gt;import android.widget.*;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;public class demo extends Activity &lt;br /&gt;&lt;br /&gt;{ &lt;br /&gt;&lt;br /&gt;TextView    label1;&lt;br /&gt;&lt;br /&gt;RadioGroup  group1;&lt;br /&gt;&lt;br /&gt;RadioButton   radio1,radio2;&lt;br /&gt;&lt;br /&gt;Button       button1;&lt;br /&gt;&lt;br /&gt;EditText      text1;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;&lt;br /&gt;    protected void onCreate(Bundle icicle)&lt;br /&gt;&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;        super.onCreate(icicle);&lt;br /&gt;&lt;br /&gt;        setContentView(R.layout.main);&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;group1= (RadioGroup) &lt;br /&gt;&lt;br /&gt;         findViewById (R.id.group1);&lt;br /&gt;&lt;br /&gt;radio1 = (RadioButton)&lt;br /&gt;&lt;br /&gt;          findViewById (R.id.radio1);&lt;br /&gt;&lt;br /&gt;radio2 = (RadioButton) &lt;br /&gt;&lt;br /&gt;          findViewById (R.id.radio2);&lt;br /&gt;&lt;br /&gt; button1 = (Button) findViewById(R.id.button1);&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;text1=  (EditText) findViewById(R.id.text1);&lt;br /&gt;&lt;br /&gt;       text1.setText("radio");&lt;br /&gt;&lt;br /&gt; label1 = (TextView) findViewById(R.id.label1);&lt;br /&gt;&lt;br /&gt;        label1.setText("where?");&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; button1.setOnClickListener(new clicker());   &lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;  //  ...inner class ---follows -&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;class clicker implements Button.OnClickListener&lt;br /&gt;&lt;br /&gt; {&lt;br /&gt;&lt;br /&gt;  public void onClick(View   v)&lt;br /&gt;&lt;br /&gt;   {&lt;br /&gt;&lt;br /&gt;   if(v==button1)&lt;br /&gt;&lt;br /&gt;       { &lt;br /&gt;&lt;br /&gt; if(radio1.isChecked()) &lt;br /&gt;&lt;br /&gt;                   { text1.setText("madras");}&lt;br /&gt;&lt;br /&gt; if(radio2.isChecked()) &lt;br /&gt;&lt;br /&gt;                   { text1.setText("bombay");}&lt;br /&gt;&lt;br /&gt;       }   &lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; // ----inner class  ends here ---&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//********************************************&lt;br /&gt;&lt;br /&gt;You would have observed that I am naming all my java files as 'demo.java'. May be confusing at first but I am doing so with a purpose. First of all, the emulator screen gets cluttered with too many buttons if we go on adding my examples. What I have done is :&lt;br /&gt;&lt;br /&gt;I have created a folder as &lt;br /&gt;&lt;br /&gt;d:\android\mydemos.&lt;br /&gt;&lt;br /&gt;In mydemos folder, I have created subfolders such as (ex1,ex2 etc). But, within each folder, I have demo.java &amp; main.xml.&lt;br /&gt;&lt;br /&gt;This way, we can easily test each of our demos  by uniform procedure. &lt;br /&gt;&lt;br /&gt;   In my system, I had  the problem of insufficient memory. And, by the above step, I was able to test all my programs by the same name. &lt;br /&gt;&lt;br /&gt;====&lt;br /&gt;&lt;br /&gt;   Here is an important tip however, if you choose to name the source files and xml files differently and want to reduce the clutter.&lt;br /&gt;&lt;br /&gt;============================================-&lt;br /&gt;&lt;br /&gt;"how to uninstall an application from the emulator?"&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;- Make sure your emulator is running&lt;br /&gt;&lt;br /&gt;- Open a dos box in the android/tools folder&lt;br /&gt;&lt;br /&gt;.d:\android\tools&gt;adb shell&lt;br /&gt;&lt;br /&gt;(You will get the shell prompt).&lt;br /&gt;&lt;br /&gt; #cd /data/app&lt;br /&gt;&lt;br /&gt; #ls&lt;br /&gt;&lt;br /&gt; (It will list all the *.apk installed in your emulator)&lt;br /&gt;&lt;br /&gt;# rm  example.apk&lt;br /&gt;&lt;br /&gt;( if you want to remove 'example')&lt;br /&gt;&lt;br /&gt;#exit &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;(You will see the application getting removed from the emulator at the same moment) &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;DEMO-6  ( GALLERY )&lt;br /&gt;&lt;br /&gt;-----------------------------&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;   Interstingly, there is a ready-made control in the toolbox, named 'gallery'&lt;br /&gt;&lt;br /&gt;   Let us now learn to use this controls, though the  syntax  is a bit difficult.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;This time, we will need demo.java, main.xml and also another folder in tools\demo\res\drawable.&lt;br /&gt;&lt;br /&gt;This special folder is to be created by us. You can read 'img' instead of 'drawable'. So, we place all the image files to be displayed in the gallery, in this folder. &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Let us as usual create the xml file by using DroidDraw as follows.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;main.xml&lt;br /&gt;&lt;br /&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;Gallery xmlns:android="http://schemas.android.com/apk/res/android"    android:id="@+id/gallery"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:layout_alignParentBottom="true"    android:layout_alignParentLeft="true"    android:gravity="center_vertical"    android:spacing="5"/&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;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;//demo.java&lt;br /&gt;&lt;br /&gt;( in d:\androids\mydmes\)&lt;br /&gt;&lt;br /&gt;(to be placed in tools\demo\mypack\mydemos)&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;package mypack.mydemos;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;import android.app.Activity;&lt;br /&gt;&lt;br /&gt;import android.content.Context;&lt;br /&gt;&lt;br /&gt;import android.os.Bundle;&lt;br /&gt;&lt;br /&gt;import android.view.View;&lt;br /&gt;&lt;br /&gt;import android.view.ViewGroup;&lt;br /&gt;&lt;br /&gt;import android.widget.*;&lt;br /&gt;&lt;br /&gt;import android.widget.AdapterView.OnItemClickListener;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;public class example extends Activity&lt;br /&gt;&lt;br /&gt;{      &lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;&lt;br /&gt;    public void onCreate(Bundle icicle) {&lt;br /&gt;&lt;br /&gt;        super.onCreate(icicle);&lt;br /&gt;&lt;br /&gt;        setContentView(R.layout.main);&lt;br /&gt;&lt;br /&gt;Gallery     gallery   = (Gallery)     &lt;br /&gt;&lt;br /&gt;        findViewById(R.id.gallery);&lt;br /&gt;&lt;br /&gt;gallery.setAdapter(new ImageAdapter(this));&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;gallery.setOnItemClickListener(new OnItemClickListener()&lt;br /&gt;&lt;br /&gt;   {&lt;br /&gt;&lt;br /&gt;    public void onItemClick(AdapterView parent,&lt;br /&gt;&lt;br /&gt;                                  View v,&lt;br /&gt;&lt;br /&gt;                                  int position,&lt;br /&gt;&lt;br /&gt;                                  long id)&lt;br /&gt;&lt;br /&gt;          {&lt;br /&gt;&lt;br /&gt;Toast.makeText(example.this, "" + position, &lt;br /&gt;&lt;br /&gt;Toast.LENGTH_SHORT).show();&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;        });&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;public class ImageAdapter extends BaseAdapter&lt;br /&gt;&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;    public ImageAdapter(Context c)&lt;br /&gt;&lt;br /&gt;       {&lt;br /&gt;&lt;br /&gt;         mContext = c;&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;     public int getCount()&lt;br /&gt;&lt;br /&gt;       {&lt;br /&gt;&lt;br /&gt;        return mImageIds.length;&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;      public Object getItem(int position)&lt;br /&gt;&lt;br /&gt;       {&lt;br /&gt;&lt;br /&gt;       return position;&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;      public long     getItemId(int position)&lt;br /&gt;&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;       return position;&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;  public View getView(int position, View &lt;br /&gt;&lt;br /&gt;             convertView, ViewGroup parent)&lt;br /&gt;&lt;br /&gt;    {&lt;br /&gt;&lt;br /&gt;      ImageView i = new ImageView(mContext);&lt;br /&gt;&lt;br /&gt;      i.setImageResource(mImageIds[position]);&lt;br /&gt;&lt;br /&gt;      i.setScaleType(ImageView.ScaleType.FIT_XY);&lt;br /&gt;&lt;br /&gt;      i.setLayoutParams(new &lt;br /&gt;&lt;br /&gt; Gallery.LayoutParams(160,200));&lt;br /&gt;&lt;br /&gt;      return i;&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;public float getAlpha(boolean focused, int offset) &lt;br /&gt;&lt;br /&gt;   {&lt;br /&gt;&lt;br /&gt;      return Math.max(0, 1.0f - (0.2f * &lt;br /&gt;&lt;br /&gt;Math.abs(offset)));&lt;br /&gt;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt; public float getScale(boolean focused, int offset) &lt;br /&gt;&lt;br /&gt;     {&lt;br /&gt;&lt;br /&gt;     return Math.max(0, 1.0f - (0.2f * &lt;br /&gt;&lt;br /&gt;Math.abs(offset)));&lt;br /&gt;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;  private Context mContext;&lt;br /&gt;&lt;br /&gt;  private     Integer[]     mImageIds = {&lt;br /&gt;&lt;br /&gt;               R.drawable.cindy,&lt;br /&gt;&lt;br /&gt;                R.drawable.clinton,&lt;br /&gt;&lt;br /&gt;                R.drawable.ford,&lt;br /&gt;&lt;br /&gt;                R.drawable.cybil,&lt;br /&gt;&lt;br /&gt;                R.drawable.demi,&lt;br /&gt;&lt;br /&gt;                R.drawable.colin,&lt;br /&gt;&lt;br /&gt;                R.drawable.david,&lt;br /&gt;&lt;br /&gt;                R.drawable.drew&lt;br /&gt;&lt;br /&gt;       };&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//==========================================&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;That completes the first part of my introductory tutorial on Anfroid SDK.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;..&lt;br /&gt;&lt;br /&gt;**********************************************&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;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;  Sign in   Recent Site Activity   Terms   Report Abuse   Print page  |  Powered by Google Sites&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5269639880422862868-2180270473650513817?l=nihar04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nihar04.blogspot.com/feeds/2180270473650513817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nihar04.blogspot.com/2010/08/android-os.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/2180270473650513817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5269639880422862868/posts/default/2180270473650513817'/><link rel='alternate' type='text/html' href='http://nihar04.blogspot.com/2010/08/android-os.html' title='android os'/><author><name>nihar</name><uri>http://www.blogger.com/profile/17030171884220186021</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-5269639880422862868.post-8723436071344334782</id><published>2010-08-12T21:03:00.000-07:00</published><updated>2010-08-12T21:03:06.093-07:00</updated><title type='text'>tcs3</title><content type='html'>Test Paper :19 &lt;br /&gt;&lt;br /&gt;  Paper Type     : Whole Testpaper  &lt;br /&gt; Test Date        : 21  January  2010   &lt;br /&gt; Test Location  : UIT RGPV, Bhopal  &lt;br /&gt; Posted By        : Brashaket Pratap Singh &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;TCS PAPER ON 21st JANUARY AT BHOPAL&lt;br /&gt;&lt;br /&gt;Hello Guys This is Brashaket Pratap Singh Bais one of the student of the Technocrats Institute of Technology, Bhopal Pursuing MCA.&lt;br /&gt;TCS on January 21st , 2010 at RGPV BHOPAL (in the UIT Bhopal).&lt;br /&gt;It was an open campus. All the reputed Colleges of Bhopal appear in the online test.&lt;br /&gt;Nearly 360 students From my college attended for online test, out of which 138 were short listed for interview. Out of the 360 there r 81 students from the MCA, and only 7 students including me are able to clear the online test and short listed for the Interview. All the remaining students are from the B.E.&lt;br /&gt;&lt;br /&gt;Complete tcs selection procedure consists of :&lt;br /&gt;1) Online Test     2) Technical Interview     3) M.R. Round     4) H.R. Round&lt;br /&gt; &lt;br /&gt;(PAPER) TCS Online Test&lt;br /&gt;&lt;br /&gt;The test was divided in three sections as:&lt;br /&gt;1. Verbal reasoning (20 min - 32 Qs )&lt;br /&gt;2. Quantitative aptitude (40 min – 36 Qs) &lt;br /&gt;3. Critical reasoning (30 min - 3 passages - 12 Qs)&lt;br /&gt;&lt;br /&gt;No Sectional Cut off.&lt;br /&gt;No Negative Marks.&lt;br /&gt;No Psychometric Test was there for us.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Verbal reasoning: (20 min 32 Qs) &lt;br /&gt;&lt;br /&gt;Antonyms and Synonyms: (20) (I don’t remember which were for antonyms and which were for synonym)\&lt;br /&gt;1. Effrontery -- extreme rudeness and lack of ability to understand that your behavior is not acceptable to other people.&lt;br /&gt; &lt;br /&gt;2. ERRATIC(SYNONYM)&lt;br /&gt;a. Unromantic&lt;br /&gt;b.  Free&lt;br /&gt;c. Popular&lt;br /&gt;d. Steady&lt;br /&gt;e. Unknown(answer)&lt;br /&gt;&lt;br /&gt;3.what is the synonyms of RAPT&lt;br /&gt;Ans:- concealed&lt;br /&gt;&lt;br /&gt;4. SYNONYMS OF tranquil&lt;br /&gt;Ans:- serene&lt;br /&gt;&lt;br /&gt;5. Awry – skewed, crooked, wrong&lt;br /&gt;&lt;br /&gt;6. Repellent x attractive(antonym)&lt;br /&gt;&lt;br /&gt;7. Raucous – rough, wild, hoarse, guttering(synonym)&lt;br /&gt;&lt;br /&gt;8. Benign – kind, benevolent, compassionate&lt;br /&gt;&lt;br /&gt;9. Pristine x sullied&lt;br /&gt;&lt;br /&gt;10. Florid= Ornate, Showy(SYN)&lt;br /&gt;&lt;br /&gt;11. Servility= Surrender(SYN)&lt;br /&gt;&lt;br /&gt;12. Chide * praise(ANT)&lt;br /&gt;&lt;br /&gt;13. Stilted * natural(ANT)&lt;br /&gt; &lt;br /&gt;I don’t Know all the words, but for scoring good marks in this section Refer Barrons 750 word list. As Well as refer FreshersWorld.com mug up all the synonyms and antonyms of approx last 50-70 papers.&lt;br /&gt;Definitely you will Score good marks here, Attempt all the question as there is no negative marking.&lt;br /&gt;I Think my score is good in this section.&lt;br /&gt; &lt;br /&gt;There was paragraph making which i cud not do all the questions of that as it was very tough, so i guessed the answers and hoped atleast few hits the target the. RC had a passage from barons, i had practiced all the barrons RC and it helped . &lt;br /&gt;For better score refer Barron’s for this section.&lt;br /&gt; &lt;br /&gt;Quantitative aptitude: - &lt;br /&gt;FOR THE QUANT SECTION I WILL SUGGEST U TO SOLVE THE R.S.AGRAWAL AND A LOT BETTER TO SOLVE THE LAST 3-4 YEARS QUESTION PAPERS FROM THE FreshersWorld.com. It Will really Help You.&lt;br /&gt;&lt;br /&gt;Sorry I don’t remember the questions. But I am able to correctly solve the 33 questions and remaining r the targeted hits. &lt;br /&gt;I m Sending U some sample questions with their solutions, questions on my paper r like these,&lt;br /&gt; &lt;br /&gt;1) Complete the series 7, 9 , 13 , __ , 27, 37  &lt;br /&gt;Ans: 19&lt;br /&gt;&lt;br /&gt;2) What is the largest prime number that can be stored in an 8-bit memory?&lt;br /&gt;Ans: 127&lt;br /&gt;&lt;br /&gt;3) Number of faces, vertices and edges of a cube     &lt;br /&gt;Ans : 6,8,12(Sometimes they change the sequence as on my paper it comes as number of vertices ,faces and edges , so first make a very close look to the question and decide the sequence of values that matching the one of the options).&lt;br /&gt;&lt;br /&gt;4).In a triangle which one is not possible. Sides are (5 ,5 ,5.), (5 ,4 ,5 ), (4 ,4, 9 ), (3,4 ,5,)?&lt;br /&gt;Ans: (4,4,9). (HINT : for a triangle sum of smaller 2 sides should be greater than the other one which is larger)&lt;br /&gt;&lt;br /&gt;5) Match the following:&lt;br /&gt;1. Male - Boy                                 a. A type of&lt;br /&gt;2. Square - Polygon                        b. A part of&lt;br /&gt;3. Roof - Building                           c. Not a type of&lt;br /&gt;4. Mushroom – Vegetables             d. A superset of         &lt;br /&gt;Ans: 1- d, 2- a, 3- b, 4- c&lt;br /&gt;&lt;br /&gt;6) Given $ means Tripling and % means change of sign then find the value of $%$6-%$%6 ?&lt;br /&gt;Ans : -72&lt;br /&gt;&lt;br /&gt;8) In a two-dimensional array, X (9, 7), with each element occupying 4 bytes of memory, with the address of the first element X (1, 1) is 3000, find the address of X (8, 5). &lt;br /&gt;Ans : 3212&lt;br /&gt;(Hint : Every 1 deg longitude is equal to 4 minutes . If west to east add time else subtract time) &lt;br /&gt;&lt;br /&gt;9) Select the odd one out. a. Java b. Lisp c. Smalltalk d. Eiffel.&lt;br /&gt;Ans: LISP&lt;br /&gt;&lt;br /&gt;10) In which of the system, decimal number 194 is equal to 1234? &lt;br /&gt;Ans: 5&lt;br /&gt;&lt;br /&gt;11) A power unit is there by the bank of the river of 750 meters width. A cable is made from power unit to power a plant opposite to that of the river and 1500mts away from the power unit. The cost of the cable below water is Rs. 15/- per meter and cost of cable on the bank is Rs.12/- per meter. Find the total of laying the cable.&lt;br /&gt;Ans: 20250&lt;br /&gt;&lt;br /&gt;12) Which of the following are orthogonal pairs? a. 3i+2j b. i+j c. 2i-3j d. -7i+j &lt;br /&gt;Ans : (A) &amp; (C).&lt;br /&gt;&lt;br /&gt;13) If VXUPLVH is written as SURMISE, what is SHDVD?  &lt;br /&gt;Ans : PEASA&lt;br /&gt;&lt;br /&gt;14) If A, B and C are the mechanisms used separately to reduce the wastage of fuel by 30%, 20% and 10%. What will be the fuel economy if they were used combined.&lt;br /&gt;Ans : 20%&lt;br /&gt;&lt;br /&gt;15) A can copy 50 papers in 10 hours while both A &amp; B can copy 70 papers in 10 hours. Then for how many hours required for B to copy 26 papers?&lt;br /&gt;Ans : 13&lt;br /&gt;&lt;br /&gt;16) Find the singularity matrix from a given set o
