<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7236549929459219161</id><updated>2026-10-04T14:35:23.401-07:00</updated><category term="C/C++ Basic"/><category term="JAVA"/><category term="Variable"/><category term="Artificial Intelligence"/><category term="Data Structure"/><category term="Algorithm"/><category term="Function"/><category term="Operator"/><category term="Books"/><category term="Library Functions"/><title type='text'>Programming, Data Structures &amp;amp; Algorithms</title><subtitle type='html'>There&#39;s more than one Algorithms to solve any Problem.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>54</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-7834708088143732009</id><published>2013-01-29T09:51:00.002-08:00</published><updated>2013-01-29T09:52:48.424-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Artificial Intelligence"/><title type='text'>Relevant Course / Subjects to Artificial Intelligence</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;b&gt;Philosophy :&lt;/b&gt;&amp;nbsp;Logic, methods of reasoning, mind as physical system,
foundations of learning, language,&amp;nbsp;rationality.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;b&gt;Mathematics:&amp;nbsp;&lt;/b&gt;Formal representation and proof,
algorithms,&amp;nbsp;computation,
(un)decidability, (in)tractability &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;b&gt;Probability/Statistics:&amp;nbsp;&lt;/b&gt;Modeling uncertainty, learning
from data&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;b&gt;Economics:&amp;nbsp;&lt;/b&gt;Utility, decision theory, rational economic agents
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;b&gt;Neuroscience:&amp;nbsp;&lt;/b&gt;&amp;nbsp;Neurons as
information processing units.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;b&gt;Psychology/ &amp;nbsp;Cognitive Science:&lt;/b&gt;&amp;nbsp;&amp;nbsp;How
do people behave, perceive, process cognitive&amp;nbsp;information,&amp;nbsp; represent knowledge.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;b&gt;Computer engineering:&amp;nbsp;&lt;/b&gt;Building fast computers&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;br /&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;b&gt;Control theory:&lt;/b&gt;&amp;nbsp;Design systems that
maximize an objective&amp;nbsp;function
over time &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;b&gt;Linguistics:&amp;nbsp;&lt;/b&gt;Knowledge representation, grammars.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/7834708088143732009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2013/01/relevant-course-to-artificial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/7834708088143732009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/7834708088143732009'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2013/01/relevant-course-to-artificial.html' title='Relevant Course / Subjects to Artificial Intelligence'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-4340392413399759035</id><published>2013-01-29T09:32:00.001-08:00</published><updated>2013-01-29T09:32:27.126-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Artificial Intelligence"/><title type='text'>Intelligence and Artificial Intelligence, what is it? </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;What is artificial intelligence?&lt;/b&gt;&lt;/h2&gt;
Artificial intelligence is the intelligence of machines and robots and the branch of computer science that aims to create it. -&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Artificial_intelligence&quot; target=&quot;_blank&quot;&gt;Wikipedia&lt;/a&gt;.&lt;br /&gt;
It is the science and engineering of making intelligent machines, especially intelligent computer programs. It is related to the similar task of using computers to understand human intelligence, but AI does not have to confine itself to methods that are biologically observable.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcRU0gze7VHf5qzhOVGBFzkYRiwJWJLiqtmX9v8LA-PC0zxfyXg4hW0Y5W1CYTxTj50PrueanFAtxr5etaP18JgewGYii-mwSQcSmE9JbekLx08JXWBeD3rdeUgzyJZAQjQb8TgV6oJWs0/s1600/artificial_intelligence.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcRU0gze7VHf5qzhOVGBFzkYRiwJWJLiqtmX9v8LA-PC0zxfyXg4hW0Y5W1CYTxTj50PrueanFAtxr5etaP18JgewGYii-mwSQcSmE9JbekLx08JXWBeD3rdeUgzyJZAQjQb8TgV6oJWs0/s1600/artificial_intelligence.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;What is intelligence?&lt;/b&gt;&lt;/h2&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;“the capacity to learn and solve problems” &lt;/b&gt;&lt;/i&gt;(Websters dictionary)&lt;br /&gt;
&lt;b&gt;In particular,&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;the ability to solve novel problems&amp;nbsp;&lt;/li&gt;
&lt;li&gt;the ability to act rationally&amp;nbsp;&lt;/li&gt;
&lt;li&gt;the ability to act like humans refere to AI.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&amp;nbsp;Intelligence is the computational part of the ability to achieve goals in the world. Varying kinds and degrees of intelligence occur in people, many animals and some machines.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/4340392413399759035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2013/01/intelligence-and-artificial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/4340392413399759035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/4340392413399759035'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2013/01/intelligence-and-artificial.html' title='Intelligence and Artificial Intelligence, what is it? '/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcRU0gze7VHf5qzhOVGBFzkYRiwJWJLiqtmX9v8LA-PC0zxfyXg4hW0Y5W1CYTxTj50PrueanFAtxr5etaP18JgewGYii-mwSQcSmE9JbekLx08JXWBeD3rdeUgzyJZAQjQb8TgV6oJWs0/s72-c/artificial_intelligence.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-6154241431684906677</id><published>2012-05-17T12:51:00.001-07:00</published><updated>2012-05-17T12:51:16.585-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Algorithm"/><title type='text'>Knapsack Algorithm Shortcut Method</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
The knapsack problem or rucksack problem is a problem in combinatorial optimization: Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible. It derives its name from the problem faced by someone who is constrained by a fixed-size knapsack and must fill it with the most valuable items.&lt;br /&gt;
The main goal of&amp;nbsp;Knapsack&amp;nbsp; is:&lt;br /&gt;
&lt;div style=&quot;direction: ltr; margin-bottom: 0pt; margin-left: 0.38in; margin-top: 6.72pt; unicode-bidi: embed; vertical-align: baseline;&quot;&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;You
have a knapsack that has capacity (weight) W.&lt;/li&gt;
&lt;li&gt;You have several items I1,…,In.&lt;/li&gt;
&lt;li&gt;Each item Ij has a weight wj and a benefit bj.You want to place a certain number of copies of each item Ij in the knapsack so that: The knapsack weight capacity is not exceeded and The total benefit is maximal.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
There is a&amp;nbsp;Shortcut Method &amp;nbsp;for Knapsack Algorithm , see the video: &amp;nbsp;&lt;/div&gt;
&lt;object style=&quot;height: 390px; width: 640px;&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/ROW7Us0kRDI?version=3&amp;feature=player_detailpage&quot;&gt;
&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;
&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;&gt;
&lt;embed src=&quot;http://www.youtube.com/v/ROW7Us0kRDI?version=3&amp;feature=player_detailpage&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot; allowScriptAccess=&quot;always&quot; width=&quot;640&quot; height=&quot;360&quot;&gt;&lt;/object&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/6154241431684906677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2012/05/knapsack-algorithm-shortcut-method.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/6154241431684906677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/6154241431684906677'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2012/05/knapsack-algorithm-shortcut-method.html' title='Knapsack Algorithm Shortcut Method'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-4844449676677563587</id><published>2012-05-13T15:34:00.000-07:00</published><updated>2012-05-13T15:34:09.540-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><title type='text'>Java Program for finding Palindrome</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;Just follow the program to find&amp;nbsp;Palindrome &amp;nbsp;in java:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;import java.io.BufferedReader;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;import java.io.InputStreamReader;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;public class Palindrome {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; public static void main(String[] args) throws Exception {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;BufferedReader br = new BufferedReader(new InputStreamReader(System.in));&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; String s1 = new String();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; s1 =br.readLine();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; s1 = s1.toLowerCase();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; String s2 = new StringBuffer(s1).reverse().toString();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; if(s1.equals(s2)){ &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; System.out.println(&quot;Palindrome&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }else&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Not Palindrome&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/4844449676677563587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2012/05/java-program-for-finding-palindrome.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/4844449676677563587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/4844449676677563587'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2012/05/java-program-for-finding-palindrome.html' title='Java Program for finding Palindrome'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-1012967173428992621</id><published>2012-05-13T14:15:00.001-07:00</published><updated>2012-05-13T14:15:04.221-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><title type='text'>Read or input form user in Java using BufferedReader</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&amp;nbsp;BufferedReader use to read text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines.The buffer size may be specified, or the default size may be used. The default is large enough for most purposes.&lt;br /&gt;
In Java&amp;nbsp;&amp;nbsp;BufferedReader is a efficient method to read an input. Here given a short example to read a string from user and print it:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
package palindrome;&lt;br /&gt;
&lt;br /&gt;
import java.io.BufferedReader;&lt;br /&gt;
import java.io.InputStreamReader;&lt;br /&gt;
&lt;br /&gt;
public class&amp;nbsp;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, &#39;Bitstream Charter&#39;, Times, serif; font-size: 13px; line-height: 19px; text-align: -webkit-auto;&quot;&gt;inputExample&lt;/span&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void main(String[] args) throws Exception {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;BufferedReader br = new BufferedReader(new InputStreamReader(System.in));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; String s = new String();&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; s =br.readLine();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; System.out.println(s);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/1012967173428992621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2012/05/read-or-input-form-user-in-java-using.html#comment-form' title='24 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/1012967173428992621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/1012967173428992621'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2012/05/read-or-input-form-user-in-java-using.html' title='Read or input form user in Java using BufferedReader'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>24</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-2911966699371627056</id><published>2012-05-13T14:09:00.001-07:00</published><updated>2012-05-13T14:11:05.922-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><title type='text'>Difference between Scanner vs. BufferedReader</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
BufferedReader Read text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines.&amp;nbsp;The buffer size may be specified, or the default size may be used. The default is large enough for most purposes.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Where Scanner is a simple text scanner which can parse primitive types and strings using regular expressions.&amp;nbsp;A Scanner breaks its input into tokens using a delimiter pattern, which by default matches whitespace. The resulting tokens may then be converted into values of different types using the various next methods.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Scanner is used for parsing tokens from the contents of the stream while BufferedReader just reads the stream and does not do any special parsing.&amp;nbsp;In currently latest JDK6 release/build, the Scanner has a littler buffer (1KB char buffer) as opposed to the BufferedReader (8KB byte buffer), but it&#39;s more than enough.As to the choice, use the Scanner if you want to parse the file, use the BufferedReader if you want to read the file line by line. Also see the introductory text of their aforelinked API documentations.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
A BufferedReader is a simple class meant to efficiently read from the underling stream. Generally, each read request made of a Reader like a FileReadercauses a corresponding read request to be made to underlying stream. Each invocation of read() or readLine() could cause bytes to be readfrom the file, converted into characters, and then returned, which can be very inefficient. Efficiency is improved appreciably if a Reader is warped in a BufferedReader.&amp;nbsp;BufferedReader is synchronized, so read operations on a BufferedReadercan safely be done from multiple threads.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
A scanner on the other hand has a lot more cheese built into it; it can do all that a BufferedReader can do and at the same level of efficiency as well. However, in addition a Scanner can parsethe underlying stream for primitive types and strings using regular expressions. It can also tokenize the underlying stream with the delimiter of your choice. It can also do forward scanning of the underlying stream disregardingthe delimiter! &amp;nbsp;A scanner however is not thread safe, it has to be externally synchronized.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The choice of using a BufferedReader or a Scanner depends on the codeyou are writing, if you are writing a simple log reader Buffered readeris adequate. However if you are writing an XML parser Scanner isthe more natural choice.&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/2911966699371627056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2012/05/difference-between-scanner-vs.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/2911966699371627056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/2911966699371627056'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2012/05/difference-between-scanner-vs.html' title='Difference between Scanner vs. BufferedReader'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-6222397174736156399</id><published>2012-05-13T12:27:00.001-07:00</published><updated>2012-05-13T12:27:11.806-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C/C++ Basic"/><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><title type='text'>Difference Between Function and Method</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Each language has its own lexicon of terms with special meaning. In C Programming Language, the word Function means a program routine. In Java, the term Function does not have any special meaning. Whereas Method means one of the routines that forms the implementation of a class.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;First let we know what is Function?&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
A function is a piece of reuseable code that is called by name. In C or C++ we used to say function to a&amp;nbsp;reusable&amp;nbsp;code.&amp;nbsp;It can be passed data to operate on (arguments / parameters) and can optionally return a result. Function is a portion of code within a larger program, which performs a specific task and is relatively independent of the remaining code.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;So What is Method??&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
A method &amp;nbsp;is a piece of code that is called by name that is associated with an object. A method is almost identical to a function but it&#39;s purpose is generally to operate on the data contained within the component (class). Method is a function that is a member of a class.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
If you know&amp;nbsp;little&amp;nbsp;bit about Function and Method, you may noticed that &quot;Functions stand alone and methods are members of a class.&quot;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Now You can Say: Method != Function and Function != Method [ :P]&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
We can find another&amp;nbsp;difference&amp;nbsp;and that is: In C programmer used to say Function. In the same way java programmer used to say Method.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/6222397174736156399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2012/05/difference-between-function-and-method.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/6222397174736156399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/6222397174736156399'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2012/05/difference-between-function-and-method.html' title='Difference Between Function and Method'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-8324026306001423605</id><published>2012-03-02T09:54:00.001-08:00</published><updated>2012-03-02T09:54:05.213-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Artificial Intelligence"/><title type='text'>Implementation of Artificial Intelligent</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;Artificial Intelligent successfully been used and using in:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpyIgZ-ZRnBHy48YqTuhyC_ve1GxFiay26AlQKateBQxCfiZfcIInXAcdT-W5DXNzzWOIRUb0PqgTlD4QeBKt5QlhkOPIIVdByZ-2bZ7LLWwSbITPC92-is11nvwka_2a-k9jOhFjJOxFr/s1600/artificial-intelligence.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;282&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpyIgZ-ZRnBHy48YqTuhyC_ve1GxFiay26AlQKateBQxCfiZfcIInXAcdT-W5DXNzzWOIRUb0PqgTlD4QeBKt5QlhkOPIIVdByZ-2bZ7LLWwSbITPC92-is11nvwka_2a-k9jOhFjJOxFr/s400/artificial-intelligence.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Finance&lt;/li&gt;
&lt;li&gt;Robotics&lt;/li&gt;
&lt;li&gt;Games&lt;/li&gt;
&lt;li&gt;Medicines&lt;/li&gt;
&lt;li&gt;The Web and many more..&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/8324026306001423605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2012/03/implementation-of-artificial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/8324026306001423605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/8324026306001423605'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2012/03/implementation-of-artificial.html' title='Implementation of Artificial Intelligent'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpyIgZ-ZRnBHy48YqTuhyC_ve1GxFiay26AlQKateBQxCfiZfcIInXAcdT-W5DXNzzWOIRUb0PqgTlD4QeBKt5QlhkOPIIVdByZ-2bZ7LLWwSbITPC92-is11nvwka_2a-k9jOhFjJOxFr/s72-c/artificial-intelligence.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-8660538998314693786</id><published>2012-03-02T09:43:00.002-08:00</published><updated>2012-03-02T09:46:41.692-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Artificial Intelligence"/><title type='text'>What exactly  Artificial Intelligence or AI is?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Artificial intelligence or AI &amp;nbsp;is the intelligence of machines, any kind of machines that is&amp;nbsp;programmable. And it is called AI&amp;nbsp;program. Now another topics come here, that is &quot;What is AI or Artificial&amp;nbsp;Intelligence&amp;nbsp;program is?&quot; Yes, AI program is called&amp;nbsp;Intelligent&amp;nbsp;Agent.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzI-yPfgJaDRN8Anv-D415SkY0YFlVAeEnUOEtdBfa3gs95Y5A1EU9U1WMtiqmz3zySTMU1OfjI9haqhfEJoh23Nrrn6ZmblYH8OgYtc_0PIj_WikjSTMdwRw7g9ZUPPIrOHV-HoaHRbHj/s1600/Artificial+intelligence.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;216&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzI-yPfgJaDRN8Anv-D415SkY0YFlVAeEnUOEtdBfa3gs95Y5A1EU9U1WMtiqmz3zySTMU1OfjI9haqhfEJoh23Nrrn6ZmblYH8OgYtc_0PIj_WikjSTMdwRw7g9ZUPPIrOHV-HoaHRbHj/s320/Artificial+intelligence.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp;Do you know what is Intelligent Agent?&lt;br /&gt;
An intelligent agent is a system that perceives its environment and takes actions that maximize its chances of success. I will discuss more about&amp;nbsp;intelligent agent&amp;nbsp;in my next post. Stay with me. Thank You.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/8660538998314693786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2012/03/what-exactly-artificial-intelligence-or.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/8660538998314693786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/8660538998314693786'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2012/03/what-exactly-artificial-intelligence-or.html' title='What exactly  Artificial Intelligence or AI is?'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzI-yPfgJaDRN8Anv-D415SkY0YFlVAeEnUOEtdBfa3gs95Y5A1EU9U1WMtiqmz3zySTMU1OfjI9haqhfEJoh23Nrrn6ZmblYH8OgYtc_0PIj_WikjSTMdwRw7g9ZUPPIrOHV-HoaHRbHj/s72-c/Artificial+intelligence.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-867028271690980510</id><published>2012-02-21T11:37:00.003-08:00</published><updated>2012-02-21T11:44:25.142-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Algorithm"/><category scheme="http://www.blogger.com/atom/ns#" term="C/C++ Basic"/><title type='text'>C++ Code of Bubble Sort</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Bubble sort, often incorrectly referred to as sinking sort, is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order.&lt;/span&gt;&lt;/pre&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqdq8PmbSHBL_az5KNahNlBf19jGyHiY7dnLKdZsRIwGb4qSK52wJnpl-qxMnHKhJQub0q3OQhuWt59S-9g4NcNxIY0IbH1CKO3R67R5sVa_veGfhn7UC07l8LbXxKCFuXLI9l8InugnNW/s1600/Bubble-sort-.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqdq8PmbSHBL_az5KNahNlBf19jGyHiY7dnLKdZsRIwGb4qSK52wJnpl-qxMnHKhJQub0q3OQhuWt59S-9g4NcNxIY0IbH1CKO3R67R5sVa_veGfhn7UC07l8LbXxKCFuXLI9l8InugnNW/s1600/Bubble-sort-.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;h2&gt;


&lt;span style=&quot;color: #274e13;&quot;&gt;Here is the C++ implantation of Bubble sort&lt;/span&gt;&lt;/h2&gt;
&lt;pre&gt;#include &amp;lt;iostream&amp;gt;

using namespace std;

int main()
{
    int i,j, n;
    cout&amp;lt;&amp;lt; &quot;How much number you will sort?&quot; &amp;lt;&amp;lt; endl;
    cin&amp;gt;&amp;gt;n;
    int a[n];
    for(int x=1; x&amp;lt;=n;x++)
    {
        cout&amp;lt;&amp;lt; &quot;Enter &quot;&amp;lt;&amp;lt; &quot; Number &quot;  &amp;lt;&amp;lt; x &amp;lt;&amp;lt;&quot;: &quot;  &amp;lt;&amp;lt; endl;
        cin&amp;gt;&amp;gt;a[x];

    }
for(int i=1; i&amp;lt;=n;i++)
    for(int j=i+1; j&amp;lt;=n;j++)
        {
        if (a[i]&amp;gt;a[j]){
            int temp;
            temp = a[i];
            a[i]=a[j];
            a[j]=temp;
        }

}

cout&amp;lt;&amp;lt; &quot;Sorted numbers are:&quot; &amp;lt;&amp;lt; endl;
for(int x=1; x&amp;lt;=n;x++)
    {
        cout&amp;lt;&amp;lt; a[x] &amp;lt;&amp;lt; &quot;, &quot;;

    }

    return 0;
}&lt;/pre&gt;
&lt;pre&gt;Thanks, &lt;a href=&quot;http://jakir.me/&quot;&gt;Jakir Hossain&lt;/a&gt;&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/867028271690980510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2012/02/c-code-of-bubble-sort.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/867028271690980510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/867028271690980510'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2012/02/c-code-of-bubble-sort.html' title='C++ Code of Bubble Sort'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqdq8PmbSHBL_az5KNahNlBf19jGyHiY7dnLKdZsRIwGb4qSK52wJnpl-qxMnHKhJQub0q3OQhuWt59S-9g4NcNxIY0IbH1CKO3R67R5sVa_veGfhn7UC07l8LbXxKCFuXLI9l8InugnNW/s72-c/Bubble-sort-.gif" height="72" width="72"/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-2227619766202471260</id><published>2011-09-19T09:14:00.000-07:00</published><updated>2011-09-19T09:14:10.449-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C/C++ Basic"/><title type='text'>Integer Numbers in Programming Language</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 20px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;An &lt;b&gt;integer variable &lt;/b&gt;may be defined to be of type &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;short&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;, or &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;long&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;. The only difference
is that an &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;int &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;uses more or at least the same
number of bytes as a &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;short&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;, and a &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;long &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;uses more or at least the same number of bytes as an &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;. For example, on the author’s PC, a &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;short &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;uses 2 bytes, an &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;int &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;also 2 bytes, and a &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;long &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;4 bytes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;short
age = 20;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;int
salary = 65000;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;long
price = 4500000;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;By default, an integer variable is assumed to be signed (i.e., have a
signed representation so that it can assume positive as well as negative
values). However, an integer can be defined to be unsigned by using the keyword
&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;unsigned &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;in its definition. The keyword &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;signed &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;is also allowed but is redundant.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;unsigned
short age = 20;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;unsigned
int salary = 65000;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;unsigned
long price = 4500000;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;A &lt;b&gt;literal integer &lt;/b&gt;(e.g., &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;1984&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;) is always assumed to be of type &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;, unless it has an &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;L &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;or &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;l &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;suffix, in which case it is treated as a &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;long&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;. Also, a literal integer can be specified to be unsigned using the suffix &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;U &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;or &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;u&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;. For example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;1984L
1984l 1984U 1984u 1984LU 1984ul&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;Literal integers can be expressed in decimal, octal, and hexadecimal
notations. The decimal notation is the one we have been using so far. An
integer is taken to be octal if it is preceded by a zero (&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;), and hexadecimal if it is preceded by a &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;0x &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;or &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;0X&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;. For example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;92 //
decimal&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;0134 //
equivalent octal&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;0x5C //
equivalent hexadecimal&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;Octal numbers use the base 8, and can therefore only use the digits &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;0-7&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;. Hexadecimal numbers use the base 16, and therefore use the letter &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;A-F &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;(or &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;a-f&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;) to represent, respectively, &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;10-15&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;. Octal and hexadecimal numbers are calculated as follows:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;0134 &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;= 1 × 8&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 10.5pt; mso-bidi-language: BN;&quot;&gt;2 &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;+ 3 × 8&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 10.5pt; mso-bidi-language: BN;&quot;&gt;1 &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;+ 4 × 8&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 10.5pt; mso-bidi-language: BN;&quot;&gt;0 &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;= 64 + 24 + 4 = 92&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;0x5C &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;= 5 × 16&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 10.5pt; mso-bidi-language: BN;&quot;&gt;1 &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;+ 12 × 16&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 10.5pt; mso-bidi-language: BN;&quot;&gt;0 &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;= 80 + 12 = 92&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/2227619766202471260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/integer-numbers-in-programming-language.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/2227619766202471260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/2227619766202471260'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/integer-numbers-in-programming-language.html' title='Integer Numbers in Programming Language'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-1592333755715101611</id><published>2011-09-19T08:04:00.000-07:00</published><updated>2011-09-19T08:04:25.443-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C/C++ Basic"/><title type='text'>Memory, Memory Address in Programming Language</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 20px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;A computer provides a Random Access Memory (RAM) for storing executable program
code as well as the data the program manipulates. This memory can be thought of
as a contiguous sequence of &lt;b&gt;bits&lt;/b&gt;, each of which is capable of storing a &lt;b&gt;binary
digit &lt;/b&gt;(0 or 1). Typically, the memory is also divided into groups of 8 consecutive
bits (called &lt;b&gt;bytes&lt;/b&gt;). The bytes are sequentially addressed. Therefore each
byte can be uniquely identified by its &lt;b&gt;address.&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXKpkuyL0ROjWujXfXPbcEiDhHjNdeTzFVJw8h2GNhEVo81UUC4UFyA_8ejf4uVyFlxvNCYqozacDmAsE-MZW5UeCn1MjQ9fnC4EbFSMDDBw1bIKKvcI87Jra_Wkqyzh2oY2WUz1jTjeJ2/s1600/Bits+and+bytes+in+memory.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXKpkuyL0ROjWujXfXPbcEiDhHjNdeTzFVJw8h2GNhEVo81UUC4UFyA_8ejf4uVyFlxvNCYqozacDmAsE-MZW5UeCn1MjQ9fnC4EbFSMDDBw1bIKKvcI87Jra_Wkqyzh2oY2WUz1jTjeJ2/s1600/Bits+and+bytes+in+memory.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;Figure: Bits and bytes in memory.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 18.0pt; mso-bidi-language: BN;&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 18.0pt; mso-bidi-language: BN;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;The C++ compiler generates executable code which maps data entities to memory
locations. For example, the variable definition &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;int
salary = 65000;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;causes the compiler to allocate a few bytes to represent &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;salary&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;. The exact number of bytes allocated and the method used for the binary
representation of the integer depends on the specific C++ implementation, but
let us say two bytes encoded as a 2’s complement integer. The compiler uses the
&lt;i&gt;address &lt;/i&gt;of the first byte at which &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;salary &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;is allocated to refer to it. The above assignment causes the value 65000 to
be stored as a 2’s complement integer in the two bytes allocated.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjti7br0cuKjm98TWXZwG4hWpJXhei7QVH_SRJXQ1aHro6Q3azqrXgnUW3quMYz0RQXdBXpOchOzAy1oqkJJsASyTi0k9QDXqdiMy0GS9OKKKZ8UpmegVLD7rN8H-aM_lM7RLmbbOYZXTfY/s1600/Representation+of+an+integer+in+memory.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjti7br0cuKjm98TWXZwG4hWpJXhei7QVH_SRJXQ1aHro6Q3azqrXgnUW3quMYz0RQXdBXpOchOzAy1oqkJJsASyTi0k9QDXqdiMy0GS9OKKKZ8UpmegVLD7rN8H-aM_lM7RLmbbOYZXTfY/s1600/Representation+of+an+integer+in+memory.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12.0pt; mso-bidi-language: BN;&quot;&gt;Figure: &lt;span&gt;&amp;nbsp;&lt;/span&gt;Representation of an integer
in memory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;While the exact binary representation of a data item is rarely of interest
to a programmer, the general organization of memory and use of addresses for
referring to data items (as we will see later) is very important.&lt;/span&gt;&lt;span style=&quot;font-size: 13.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/1592333755715101611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/memory-memory-address-in-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/1592333755715101611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/1592333755715101611'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/memory-memory-address-in-programming.html' title='Memory, Memory Address in Programming Language'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXKpkuyL0ROjWujXfXPbcEiDhHjNdeTzFVJw8h2GNhEVo81UUC4UFyA_8ejf4uVyFlxvNCYqozacDmAsE-MZW5UeCn1MjQ9fnC4EbFSMDDBw1bIKKvcI87Jra_Wkqyzh2oY2WUz1jTjeJ2/s72-c/Bits+and+bytes+in+memory.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-6157016903696033745</id><published>2011-09-19T07:56:00.000-07:00</published><updated>2011-09-19T07:56:25.179-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C/C++ Basic"/><title type='text'>Comments in Programming Language</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 20px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;A comment is a piece of descriptive text which explains some aspect of a
program. Program comments are totally ignored by the compiler and are only
intended for human readers. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 17.0pt; mso-bidi-language: BN;&quot;&gt;C++ provides two types of comment delimiters:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; font-size: 12.0pt; mso-bidi-font-family: Symbol; mso-bidi-language: BN;&quot;&gt;· &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;Anything after &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-bidi-language: BN;&quot;&gt;// &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; mso-bidi-language: BN;&quot;&gt;(until the end of the line on which it appears) is considered a comment.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; font-size: 12.0pt; line-height: 115%; mso-bidi-font-family: Symbol; mso-bidi-language: BN;&quot;&gt;· &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; line-height: 115%; mso-bidi-language: BN;&quot;&gt;Anything enclosed by the pair &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; line-height: 115%; mso-bidi-language: BN;&quot;&gt;/* &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; line-height: 115%; mso-bidi-language: BN;&quot;&gt;and &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; line-height: 115%; mso-bidi-language: BN;&quot;&gt;*/ &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; line-height: 115%; mso-bidi-language: BN;&quot;&gt;is considered a comment.&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 13.0pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; line-height: 115%; mso-bidi-language: BN;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 14.0pt; line-height: 115%; mso-bidi-language: BN;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;Comments should be used to enhance (not to hinder) the readability of a program.
&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 17.0pt; mso-bidi-language: BN;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 17.0pt; mso-bidi-language: BN;&quot;&gt;The following two points, in particular, should be noted:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; font-size: 13.0pt; mso-bidi-font-family: Symbol; mso-bidi-language: BN;&quot;&gt;· &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;A comment should be easier to read and understand than
the code which it tries to explain. A confusing or unnecessarily-complex
comment is worse han&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;no comment at all.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; font-size: 13.0pt; mso-bidi-font-family: Symbol; mso-bidi-language: BN;&quot;&gt;· &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;Over-use of comments can lead to even less readability. A
program which contains so much comment that you can hardly see the code can by
no means be considered readable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; font-size: 13.0pt; mso-bidi-font-family: Symbol; mso-bidi-language: BN;&quot;&gt;· &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;Use of descriptive names for variables and other entities
in a program, and proper indentation of the code can reduce the need for using
comments. The best guideline for how to use comments is to simply apply common
sense.&lt;/span&gt;&lt;span style=&quot;font-size: 14.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/6157016903696033745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/comments-in-programming-language.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/6157016903696033745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/6157016903696033745'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/comments-in-programming-language.html' title='Comments in Programming Language'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-8607098769870159508</id><published>2011-09-19T07:50:00.000-07:00</published><updated>2011-09-19T07:50:32.085-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C/C++ Basic"/><category scheme="http://www.blogger.com/atom/ns#" term="Variable"/><title type='text'>Variables In Programming Language</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;A variable is a symbolic name for a memory location in which data can be
stored and subsequently recalled. Variables are used for holding data values so
that they can be utilized in various computations in a program. All &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;&lt;b&gt;variables have two important attributes:&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; font-size: 13.0pt; mso-bidi-font-family: Symbol; mso-bidi-language: BN;&quot;&gt;· &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;A &lt;b&gt;type &lt;/b&gt;which is established when the variable is
defined (e.g., integer, real, character). Once defined, the type of a C++
variable cannot be changed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; font-size: 13.0pt; mso-bidi-font-family: Symbol; mso-bidi-language: BN;&quot;&gt;· &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;A &lt;b&gt;value &lt;/b&gt;which can be changed by assigning a new
value to the variable. The kind of values a variable can assume depends on its
type. For example, an integer variable can only take integer values (e.g., 2,
100, -12).&lt;/span&gt;&lt;span style=&quot;font-size: 14.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/8607098769870159508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/variables-in-programming-language.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/8607098769870159508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/8607098769870159508'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/variables-in-programming-language.html' title='Variables In Programming Language'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-7759395413481975910</id><published>2011-09-19T07:47:00.000-07:00</published><updated>2011-09-19T07:47:27.079-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C/C++ Basic"/><title type='text'>Compilation Process of a C++ Program</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 21px; line-height: 24px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;Compiling a C++ program involves a number of steps (most of which are&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;transparent to the user):&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; font-size: 13.0pt; mso-bidi-font-family: Symbol; mso-bidi-language: BN;&quot;&gt;· &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;First, the C++ &lt;b&gt;preprocessor &lt;/b&gt;goes over the program
text and carries out theinstructions specified by the preprocessor directives
(e.g., &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 14.5pt; mso-bidi-language: BN;&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;). The result is a modified
program text which no longer contains any directives.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; font-size: 13.0pt; mso-bidi-font-family: Symbol; mso-bidi-language: BN;&quot;&gt;· &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;Then, the C++ &lt;b&gt;compiler &lt;/b&gt;translates the program
code. The compiler may be a true C++ compiler which generates native (assembly
or machine) code, or just a translator which translates the code into C. In the
latter case, the resulting C code is then passed through a C compiler to
produce native object code. In either case, the outcome may be incomplete due
to the program referring to library routines which are not defined as a part of
the program. For example, Listing 1.1 refers to the &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 14.5pt; mso-bidi-language: BN;&quot;&gt;&amp;lt;&amp;lt;
&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;operator which is actually defined in a separate IO library.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; font-size: 13.0pt; mso-bidi-font-family: Symbol; mso-bidi-language: BN;&quot;&gt;· &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;Finally, the &lt;b&gt;linker &lt;/b&gt;completes the object code by
linking it with the object code of any library modules that the program may
have referred to. The final result is an executable file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCflPqceM5vT3xq7SkoliTV5ckXwI8PezdSiguwIyf9AIgB05iX6UNe807Em2B6rtd5OZ7avrwO7SUywSKCYgtDZF4SIp_f4n5kl9pTaGxOJuP2CgOGiKaiy46pPu0Xj0U0KU-ALQarl95/s1600/c%252B%252B+compilation+process.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCflPqceM5vT3xq7SkoliTV5ckXwI8PezdSiguwIyf9AIgB05iX6UNe807Em2B6rtd5OZ7avrwO7SUywSKCYgtDZF4SIp_f4n5kl9pTaGxOJuP2CgOGiKaiy46pPu0Xj0U0KU-ALQarl95/s1600/c%252B%252B+compilation+process.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;In the following &lt;span&gt;&amp;nbsp;&lt;/span&gt;Figure, &lt;span&gt;&amp;nbsp;&lt;/span&gt;illustrates the above steps for both a C++
translator and a C++ native compiler. In practice all these steps are usually
invoked by a single command (e.g. &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 14.5pt; mso-bidi-language: BN;&quot;&gt;CC&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 15.0pt; mso-bidi-language: BN;&quot;&gt;) and the user will not even see the intermediate files generated.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/7759395413481975910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/compilation-process-of-c-program.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/7759395413481975910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/7759395413481975910'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/compilation-process-of-c-program.html' title='Compilation Process of a C++ Program'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCflPqceM5vT3xq7SkoliTV5ckXwI8PezdSiguwIyf9AIgB05iX6UNe807Em2B6rtd5OZ7avrwO7SUywSKCYgtDZF4SIp_f4n5kl9pTaGxOJuP2CgOGiKaiy46pPu0Xj0U0KU-ALQarl95/s72-c/c%252B%252B+compilation+process.jpg" height="72" width="72"/><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-8728279234183570605</id><published>2011-09-19T06:39:00.000-07:00</published><updated>2011-09-19T06:40:41.053-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C/C++ Basic"/><title type='text'>A simple C++ Program and Explanation of it</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;A simple C++ Program and&amp;nbsp;Explanation&amp;nbsp;of it:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;#include &amp;lt;iostream.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;int main (void)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;cout &amp;lt;&amp;lt; &quot;Hello World\n&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; #include &amp;lt;iostream.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-add-space: auto; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; text-align: justify; text-autospace: none; text-indent: -.25in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;1.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;This line uses the &lt;b&gt;preprocessor directive &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;#include
&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;to include the contents of the header file &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;iostream.h
&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;in the program. &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;Iostream.h &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;is a standard C++ header file and contains definitions for input and
output.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;int main (void)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-add-space: auto; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; text-align: justify; text-autospace: none; text-indent: -.25in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;2.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;This line defines a &lt;b&gt;function &lt;/b&gt;called &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;. A function may have zero or more &lt;b&gt;parameters&lt;/b&gt;; these always appear
after the function name, between a pair of brackets. The word &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;void &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;appearing between the brackets indicates that &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;main &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;has no parameters. A function may also have a &lt;b&gt;return type&lt;/b&gt;; this
always appears before the function name. The return type for &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;main &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;is &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;int &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;(i.e., an integer number). All
C++ programs must have exactly one &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;main &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;function. Program execution always begins from &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-add-space: auto; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; text-align: justify; text-autospace: none; text-indent: -.25in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;3.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;This brace marks the beginning of the body of &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;cout &amp;lt;&amp;lt; &quot;Hello World\n&quot;;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-add-space: auto; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; text-align: justify; text-autospace: none; text-indent: -.25in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;4.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;This line is a &lt;b&gt;statement&lt;/b&gt;. A statement is a computation step which
may produce a value. The end of a statement is always marked with a semicolon (&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;). This statement causes the &lt;b&gt;string &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&quot;Hello
World\n&quot; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;to be sent to the &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;cout &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;output stream&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;. A string is any sequence of characters enclosed in double-quotes.
The last character in this string (&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;) is a newline character which is similar to a carriage return on a type
writer. A stream is an object which performs input or output. &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;Cout &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;is the standard output stream in C++ (standard output usually means your
computer monitor screen). The symbol &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&amp;lt;&amp;lt; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;is an &lt;b&gt;output operator &lt;/b&gt;which takes an output stream as its left
operand and an &lt;b&gt;expression &lt;/b&gt;as its right operand, and causes the value of
the latter to be&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-add-space: auto; mso-layout-grid-align: none; mso-list: l0 level1 lfo1; text-align: justify; text-autospace: none; text-indent: -.25in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;5.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;sent to the former. In this case, the effect is that the string &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&quot;Hello
World\n&quot; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;is sent to &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;cout&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;, causing it to be printed on the computer monitor screen.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;mso-list: l0 level1 lfo1; text-align: justify; text-indent: -.25in;&quot;&gt;
6.&lt;span style=&quot;font: normal normal normal 7pt/normal &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; line-height: 115%;&quot;&gt;This brace marks the end of the body of &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; line-height: 115%;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; line-height: 115%;&quot;&gt;.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/8728279234183570605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/simple-c-program-and-explanation-of-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/8728279234183570605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/8728279234183570605'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/simple-c-program-and-explanation-of-it.html' title='A simple C++ Program and Explanation of it'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-6917781318311822918</id><published>2011-09-19T03:01:00.000-07:00</published><updated>2011-09-19T03:01:10.076-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><title type='text'>Polymorphism, Encapsulation, and Inheritance Work Together</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: 16.0pt; line-height: 115%;&quot;&gt;Polymorphism, Encapsulation, and Inheritance Work Together:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: 16.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
When properly applied,
polymorphism, encapsulation, and inheritance combine to produce a programming
environment that supports the development of far more robust and scaleable
programs than does the process-oriented model. A well-designed hierarchy of
classes is the basis for reusing the code in which you have invested time and
effort developing and testing. Encapsulation allows you to migrate your
implementations over time without breaking the code that depends on the public
interface of your classes. Polymorphism allows you to create clean, sensible,
readable, and resilient code. Of the two real-world examples, the automobile
more completely illustrates the power of object-oriented design. Dogs are fun
to think about from an inheritance standpoint, but cars are more like programs.
All drivers rely on inheritance to drive different types (subclasses) of
vehicles. Whether the vehicle is a school bus, a Mercedes sedan, a Porsche, or
the family minivan, drivers can all more or less find and operate the steering
wheel, the brakes, and the accelerator. After a bit of gear grinding, most
people can even manage the difference between a stick shift and an automatic,
because they fundamentally understand their common superclass, the
transmission.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;img src=&quot;http://www.codeproject.com/KB/cpp/das/obj1.gif&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
People interface with
encapsulated features on cars all the time. The brake and gas pedals hide an
incredible array of complexity with an interface so simple you can operate them
with your feet! The implementation of the engine, the style of brakes, and the
size of the tires have no effect on how you interface with the class definition&lt;span&gt;&amp;nbsp; &lt;/span&gt;of the pedals. The final attribute,
polymorphism, is clearly reflected in the ability of car manufacturers to offer
a wide array of options on basically the same vehicle. For example, you can get
an antilock braking system or traditional brakes, power or rack-and-pinion
steering, 4-, 6-, or 8-cylinder engines. Either way, you will still press the
break pedal to stop, turn&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
the steering wheel to change
direction, and press the accelerator when you want to move. The same interface
can be used to control a number of different implementations. As you can see,
it is through the application of encapsulation, inheritance, and polymorphism
that the individual parts are transformed into the object known as a car. The
same is also true of computer programs. By the application of object-oriented principles,
the various parts of a complex program can be brought together to form&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
a cohesive, robust, maintainable
whole.&lt;span&gt;&amp;nbsp; &lt;/span&gt;As mentioned at the start of this
section, every Java program is object-oriented. Or, put more precisely, every
Java program involves encapsulation, inheritance, and&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
polymorphism. Although the short
example programs shown in the rest of this chapter and in the next few chapters
may not seem to exhibit all of these features, they are nevertheless present.
As you will see, many of the features supplied by Java are part of its built-in
class libraries, which do make extensive use of encapsulation, inheritance, and
polymorphism.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/6917781318311822918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/polymorphism-encapsulation-and.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/6917781318311822918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/6917781318311822918'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/polymorphism-encapsulation-and.html' title='Polymorphism, Encapsulation, and Inheritance Work Together'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-7561765680723412527</id><published>2011-09-19T02:55:00.000-07:00</published><updated>2011-09-19T02:55:55.766-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><title type='text'>Polymorphism In JAV A Programming Languagea</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: #1d1d1e; font-family: FranklinGothic-Demi; font-size: 12.5pt; mso-bidi-font-family: FranklinGothic-Demi; mso-bidi-language: BN-BD;&quot;&gt;Polymorphism In JAV A Programming Language:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
Polymorphism
(from the Greek, meaning “many forms”) is a feature that allows one interface
to be used for a general class of actions. The specific action is determined by
the exact nature of the situation. Consider a stack (which is a last-in,
first-out list). You might have a program that requires three types of stacks.
One stack is used for integer values, one for floating-point values, and one
for characters. The algorithm that implements each stack is the same, even
though the data being stored differs. In a non– object-oriented language, you
would be required to create three different sets of stack routines, with each
set using different names. However, because of polymorphism, in Java you can
specify a general set of stack routines that all share the same names. More
generally, the concept of polymorphism is often expressed by the phrase “one interface,
multiple methods.” This means that it is possible to design a generic interface
to a group of related activities. This helps reduce complexity by allowing the
same interface to be used to specify a general class of action. It is the
compiler’s job to select the specific action (that is, method) as it applies to
each situation. You, the programmer, do not need to make this selection
manually. You need only remember and utilize the general interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWS3XFtOYvDyFNiB_3RKW6PUTou5Jlkf1H4RSxVG5D-GP7XIlWCeG8GVh63kcbO8szWux_yklcZVg9q1YLi5UdDCZLozE3zmYwewrqQQTYvcft7OOB-OYofWnj_cs_p1-D3fdANxhHi4Sn/s1600/Polymorphism+In+JAV+A+Programming+Languagea.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWS3XFtOYvDyFNiB_3RKW6PUTou5Jlkf1H4RSxVG5D-GP7XIlWCeG8GVh63kcbO8szWux_yklcZVg9q1YLi5UdDCZLozE3zmYwewrqQQTYvcft7OOB-OYofWnj_cs_p1-D3fdANxhHi4Sn/s1600/Polymorphism+In+JAV+A+Programming+Languagea.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
Extending
the dog analogy, a dog’s sense of smell is polymorphic. If the dog smells a
cat, it will bark and run after it. If the dog smells its food, it will
salivate and run to its bowl. The same sense of smell is at work in both
situations. The difference is what is being smelled, that is, the type of data
being operated upon by the dog’s nose! This same general concept can be
implemented in Java as it applies to methods within a Java program.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/7561765680723412527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/polymorphism-in-jav-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/7561765680723412527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/7561765680723412527'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/polymorphism-in-jav-programming.html' title='Polymorphism In JAV A Programming Languagea'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWS3XFtOYvDyFNiB_3RKW6PUTou5Jlkf1H4RSxVG5D-GP7XIlWCeG8GVh63kcbO8szWux_yklcZVg9q1YLi5UdDCZLozE3zmYwewrqQQTYvcft7OOB-OYofWnj_cs_p1-D3fdANxhHi4Sn/s72-c/Polymorphism+In+JAV+A+Programming+Languagea.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-7810248754078977610</id><published>2011-09-19T02:49:00.000-07:00</published><updated>2011-09-19T02:49:35.067-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><title type='text'>Inheritance in JAVA Programming Language</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: 16.0pt; line-height: 115%;&quot;&gt;Inheritance in JAVA Programming Language:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: 16.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Inheritance is the process by
which one object acquires the properties of another object. This is important
because it supports the concept of hierarchical classification. As mentioned
earlier, most knowledge is made manageable by hierarchical (that is, top-down) classifications.
For example, a Golden Retriever is part of the classification dog, which in
turn is part of the mammal class, which is under the larger class animal. Without
the use of hierarchies, each object would need to define all of its
characteristics explicitly. However, by use of inheritance, an object need only
define those qualities that make it unique within its class. It can inherit its
general attributes from its parent. Thus, it is the inheritance mechanism that
makes it possible for one object to be a specific instance of a more general
case. Let’s take a closer look at this process.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5ru2fBkE6I15LvL9OCwU48i5vNYtBMl1Jnsvsetwy1Ub-Wc1zpxzSDm-9WRietNLNfu-1t8RmJmCaaVTH-wDOzB6TX2BB6HLT5vsTFYR5ns-zCTYghETVY7ITV3bvzwzR63ZFmkv_CsQ_/s1600/Inheritance+in+JAVA+Programming+Language.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;222&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5ru2fBkE6I15LvL9OCwU48i5vNYtBMl1Jnsvsetwy1Ub-Wc1zpxzSDm-9WRietNLNfu-1t8RmJmCaaVTH-wDOzB6TX2BB6HLT5vsTFYR5ns-zCTYghETVY7ITV3bvzwzR63ZFmkv_CsQ_/s320/Inheritance+in+JAVA+Programming+Language.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Most people naturally view the
world as made up of objects that are related to each other in a hierarchical
way, such as animals, mammals, and dogs. If you wanted to describe animals in
an abstract way, you would say they have some attributes, such as size, intelligence,
and type of skeletal system. Animals also have certain behavioral aspects; they
eat, breathe, and sleep. This description of attributes and behavior is the
class definition for animals. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
If you wanted to describe a more
specific class of animals, such as mammals, they would have more specific
attributes, such as type of teeth, and mammary glands. This is known as a
subclass of animals, where animals are referred to as mammals’ superclass. Since
mammals are simply more precisely specified animals, they inherit all of the attributes
from animals. A deeply inherited subclass inherits all of the attributes from each
of its ancestors in the class hierarchy.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Inheritance interacts with
encapsulation as well. If a given class encapsulates some attributes, then any
subclass will have the same attributes plus any that it adds as part of its
specialization (see Figure 2-2). This is a key concept which lets
object-oriented programs grow in complexity linearly rather than geometrically.
A new subclass inherits all of the attributes of all of its ancestors. It does
not have unpredictable interactions with the majority of the rest of the code
in the system.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/7810248754078977610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/inheritance-in-java-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/7810248754078977610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/7810248754078977610'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/inheritance-in-java-programming.html' title='Inheritance in JAVA Programming Language'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5ru2fBkE6I15LvL9OCwU48i5vNYtBMl1Jnsvsetwy1Ub-Wc1zpxzSDm-9WRietNLNfu-1t8RmJmCaaVTH-wDOzB6TX2BB6HLT5vsTFYR5ns-zCTYghETVY7ITV3bvzwzR63ZFmkv_CsQ_/s72-c/Inheritance+in+JAVA+Programming+Language.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-3264823733002365028</id><published>2011-09-19T02:42:00.000-07:00</published><updated>2011-09-19T02:42:48.659-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><title type='text'>Encapsulation in JAVA Programming Language</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: 15pt; line-height: 115%;&quot;&gt;Encapsulation:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: 15pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Encapsulation is the mechanism
that binds together code and the data it manipulates, and keeps both safe from
outside interference and misuse. One way to think about encapsulation is as a
protective wrapper that prevents the code and data from being arbitrarily
accessed by other code defined outside the wrapper. Access to the code and data
inside the wrapper is tightly controlled through a well-defined interface. To
relate this to the real world, consider the automatic transmission on an
automobile.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
It encapsulates hundreds of bits
of information about your engine, such as how much you are accelerating, the
pitch of the surface you are on, and the position of the shift lever. You, as
the user, have only one method of affecting this complex encapsulation: by
moving the gear-shift lever. You can’t affect the transmission by using the
turn signal or windshield wipers, for example. Thus, the gear-shift lever is a
well-defined (indeed, unique) interface to the transmission. Further, what
occurs inside the transmission does not affect objects outside the
transmission. For example, shifting gears does not turn&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
on the headlights! Because an
automatic transmission is encapsulated, dozens of car manufacturers can
implement one in any way they please. However, from the driver’s point of view,
they all work the same. This same idea can be applied to programming. The power
of encapsulated code is that everyone knows how to access it and thus can use
it regardless of the implementation details—and without fear of unexpected side
effects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
In Java the basis of
encapsulation is the class. Although the class will be examined in great detail
later in this book, the following brief discussion will be helpful now. A class
defines the structure and behavior (data and code) that will be shared by a set
of objects. Each object of a given class contains the structure and behavior
defined by the class, as if it were stamped out by a mold in the shape of the
class. For this reason, objects are sometimes referred to as instances of a
class. Thus, a class is a logical construct; an&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
object has physical reality.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_oJx4cxetWLybITmNW4C2VVN6v46oKAe_KkDXLfJPVHTErQGfeQMMdCW1CR5RzZzbqjmkIHamhgQc4pqNSkc4dV_vpfYHTHaBKLoGeIVhmGgvEdrX0V_XN2psS1NW4cP5IkdBHTC89tSM/s1600/Encapsulation.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_oJx4cxetWLybITmNW4C2VVN6v46oKAe_KkDXLfJPVHTErQGfeQMMdCW1CR5RzZzbqjmkIHamhgQc4pqNSkc4dV_vpfYHTHaBKLoGeIVhmGgvEdrX0V_XN2psS1NW4cP5IkdBHTC89tSM/s320/Encapsulation.gif&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
When you create a class, you will
specify the code and data that constitute that class. Collectively, these
elements are called members of the class. Specifically, the data defined by the
class are referred to as member variables or instance variables. The code that
operates on that data is referred to as member methods or just methods. (If you
are familiar with C/C++, it may help to know that what a Java programmer calls
a method, a C/C++ programmer calls a function.) In properly written Java
programs, the methods define how the member variables can be used. This means
that the behavior and interface of a class are defined by the methods that
operate on its instance data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
Since the purpose of a class is
to encapsulate complexity, there are mechanisms for hiding the complexity of
the implementation inside the class. Each method or variable in a class may be
marked private or public. The public interface of a class represents everything
that external users of the class need to know, or may know. The private methods
and data can only be accessed by code that is a member of the class. Therefore,
any other code that is not a member of the class cannot access a private method
or variable. Since the private members of a class may only be accessed by other
parts of your program through the class’ public methods, you can ensure that no
improper actions take place. Of course, this means that the public interface
should be carefully designed not to expose too much of the inner workings of a
class .&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/3264823733002365028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/encapsulation-in-java-programming.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/3264823733002365028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/3264823733002365028'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/encapsulation-in-java-programming.html' title='Encapsulation in JAVA Programming Language'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_oJx4cxetWLybITmNW4C2VVN6v46oKAe_KkDXLfJPVHTErQGfeQMMdCW1CR5RzZzbqjmkIHamhgQc4pqNSkc4dV_vpfYHTHaBKLoGeIVhmGgvEdrX0V_XN2psS1NW4cP5IkdBHTC89tSM/s72-c/Encapsulation.gif" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-198270910236488117</id><published>2011-09-19T02:38:00.000-07:00</published><updated>2011-09-19T02:43:45.426-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><title type='text'>Abstraction in JAVA Programming Language</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: #1d1d1e; font-family: FranklinGothic-Demi; font-size: 16.5pt;&quot;&gt;Abstraction in JAVA Programming Language:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: #1d1d1e; font-family: Palatino-Roman;&quot;&gt;An essential element of object-oriented
programming is &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #1d1d1e; font-family: Palatino-Italic;&quot;&gt;abstraction. &lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #1d1d1e; font-family: Palatino-Roman;&quot;&gt;Humans manage complexity through
abstraction. For example, people do not think of a car as a set of tens of
thousands of individual parts. They think of it as a well-defined object with
its own unique behavior. This abstraction allows people to use a car to drive
to the grocery&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: #1d1d1e; font-family: Palatino-Roman;&quot;&gt;store without being overwhelmed by the
complexity of the parts that form the car. They can ignore the details of how
the engine, transmission, and braking systems work. Instead they are free to
utilize the object as a whole.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: #1d1d1e; font-family: Palatino-Roman;&quot;&gt;A powerful way to manage abstraction is
through the use of hierarchical classifications. This allows you to layer the
semantics of complex systems, breaking them into more manageable pieces. From
the outside, the car is a single object. Once inside, you see that the car
consists of several subsystems: steering, brakes, sound system, seat belts, heating,
cellular phone, and so on. In turn, each of these subsystems is made up of more
specialized units. For instance, the sound system consists of a radio, a CD
player, and/or a tape player. The point is that you manage the complexity of
the car (or any other complex system) through the use of hierarchical
abstractions. Hierarchical abstractions of complex systems can also be applied
to computer programs. The data from a traditional process-oriented program can
be transformed by abstraction into its component objects. A sequence of process
steps can become a collection of messages between these objects. Thus, each of
these objects describes its own unique behavior. You can treat these objects as
concrete entities that respond to messages telling them to &lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #1d1d1e; font-family: Palatino-Italic;&quot;&gt;do something. &lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: #1d1d1e; font-family: Palatino-Roman;&quot;&gt;This is the essence of object-oriented
programming. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguwUqIU8H3b3DU-kM1wmKvocej8DCAfxaBcW56EVk8Eo8UTQk4aW2rh69_a1sRwZ-_lSxiMh4hyphenhyphenXaL_JOA6xtUF2JYWG4P-7tpSWnuXrwn89WPQHMvDtbtHWMvFT_9IKe8j0UmyfOWz-pO/s1600/abstraction.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguwUqIU8H3b3DU-kM1wmKvocej8DCAfxaBcW56EVk8Eo8UTQk4aW2rh69_a1sRwZ-_lSxiMh4hyphenhyphenXaL_JOA6xtUF2JYWG4P-7tpSWnuXrwn89WPQHMvDtbtHWMvFT_9IKe8j0UmyfOWz-pO/s1600/abstraction.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-align: justify; text-autospace: none;&quot;&gt;
&lt;span style=&quot;color: #1d1d1e; font-family: Palatino-Roman;&quot;&gt;Object-oriented concepts form the heart
of Java just as they form the basis for human understanding. It is important
that you understand how these concepts translate into programs. As you will
see, object-oriented programming is a powerful and natural paradigm for
creating programs that survive the inevitable changes accompanying the life cycle
of any major software project, including conception, growth, and aging. For example,
once you have well-defined objects and clean, reliable interfaces to those
objects, you can gracefully decommission or replace parts of an older system
without fear.&lt;/span&gt;&lt;span style=&quot;font-size: 13pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/198270910236488117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/abstraction-in-java-programming.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/198270910236488117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/198270910236488117'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/abstraction-in-java-programming.html' title='Abstraction in JAVA Programming Language'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguwUqIU8H3b3DU-kM1wmKvocej8DCAfxaBcW56EVk8Eo8UTQk4aW2rh69_a1sRwZ-_lSxiMh4hyphenhyphenXaL_JOA6xtUF2JYWG4P-7tpSWnuXrwn89WPQHMvDtbtHWMvFT_9IKe8j0UmyfOWz-pO/s72-c/abstraction.gif" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-45643527697886051</id><published>2011-09-19T02:35:00.000-07:00</published><updated>2011-09-19T02:35:26.079-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JAVA"/><title type='text'>Object-Oriented Programming and JAVA Programming Language</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #1d1d1e; font-family: FranklinGothic-Demi;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1d1d1e; font-family: FranklinGothic-Demi; font-size: 16.0pt; mso-bidi-font-family: FranklinGothic-Demi; mso-bidi-language: BN-BD;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #1d1d1e; font-family: FranklinGothic-Demi; font-size: 21px;&quot;&gt;Object-Oriented Programming and:&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #1d1d1e; font-family: FranklinGothic-Demi; font-size: 21px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1d1d1e; font-family: FranklinGothic-Demi; font-size: 12.0pt; mso-bidi-font-family: FranklinGothic-Demi; mso-bidi-language: BN-BD;&quot;&gt;Object-oriented programming (OOP) is a
programming paradigm using &quot;objects&quot; – data structures consisting of
data fields and methods together with their interactions – to design
applications and computer programs. Programming techniques may include features
such as data abstraction, encapsulation, messaging, modularity, olymorphism,
and inheritance. Many modern programming languages now support OOP, at least as
an option.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1d1d1e; font-family: FranklinGothic-Demi; font-size: 12.0pt; mso-bidi-font-family: FranklinGothic-Demi; mso-bidi-language: BN-BD;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibOt3RPua9phqFOITY_qfRsBjUzlUid6tFLeFi0MklavqC2AQSYTfjBPGN6pk4SeISDz6sFtp1ySK4e1MTsPRCX1c7Xt26heWPhxPfr_jTXeXnOlHA46MqDpryOSRD-MQfOHkWR3fVCfPl/s1600/OOP+and+JAVA.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibOt3RPua9phqFOITY_qfRsBjUzlUid6tFLeFi0MklavqC2AQSYTfjBPGN6pk4SeISDz6sFtp1ySK4e1MTsPRCX1c7Xt26heWPhxPfr_jTXeXnOlHA46MqDpryOSRD-MQfOHkWR3fVCfPl/s1600/OOP+and+JAVA.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1d1d1e; font-family: FranklinGothic-Demi; font-size: 12.0pt; mso-bidi-font-family: FranklinGothic-Demi; mso-bidi-language: BN-BD;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #1d1d1e; font-family: FranklinGothic-Demi; font-size: 21px;&quot;&gt;JAVA Programming Language:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #1d1d1e; font-family: Palatino-Roman; font-size: 12.0pt; mso-bidi-font-family: Palatino-Roman; mso-bidi-language: BN-BD;&quot;&gt;Object-oriented programming is at the
core of Java. In fact, all Java programs are object-oriented, this isn’t an
option the way that it is in C++, for example. OOP is so integral to Java that
you must understand its basic principles before you can write even simple Java
programs. Therefore, this chapter begins with a discussion of the theoretical
aspects of OOP.&lt;/span&gt;&lt;span style=&quot;font-size: 12.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/45643527697886051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/object-oriented-programming-and-java.html#comment-form' title='166 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/45643527697886051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/45643527697886051'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/object-oriented-programming-and-java.html' title='Object-Oriented Programming and JAVA Programming Language'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibOt3RPua9phqFOITY_qfRsBjUzlUid6tFLeFi0MklavqC2AQSYTfjBPGN6pk4SeISDz6sFtp1ySK4e1MTsPRCX1c7Xt26heWPhxPfr_jTXeXnOlHA46MqDpryOSRD-MQfOHkWR3fVCfPl/s72-c/OOP+and+JAVA.gif" height="72" width="72"/><thr:total>166</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-5350653361035858373</id><published>2011-09-18T12:39:00.000-07:00</published><updated>2011-09-18T12:39:26.185-07:00</updated><title type='text'>Adding two integer array element wise.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Here given an program that adds two integer array element wise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
int* sum(int*, int, int*, int);&lt;br /&gt;
void print(int*, int);&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int a[] = {11,22,33,44,55};&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int b[]={66,77,88};&lt;br /&gt;
&amp;nbsp; &amp;nbsp; print(a,5);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; print(b,3);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int* c= sum(a,5,b,3);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; print(c,5);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int* sum(int* a, int m, int*b, int n)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int* aa, *bb;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int mm, nn;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if(m&amp;lt;n) aa = a, bb=b, mm=m, nn=n;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; else aa=b, bb=a, mm=n, nn=m;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int* c = new int[nn];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; for(int i=0; i&amp;lt; mm; i++)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; c[i]= aa[i] + bb[i];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; for (int i=mm;i&amp;lt;nn; i++)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; c[i]=bb[i];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return c;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
void print(int* a, int n)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt;&quot;{&quot; &amp;lt;&amp;lt; a[0];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; for (int i=1;i&amp;lt;n;i++)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt; &quot;,&quot; &amp;lt;&amp;lt; a[i];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt; &quot;} \n&quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/5350653361035858373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/adding-two-integer-array-element-wise.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/5350653361035858373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/5350653361035858373'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/adding-two-integer-array-element-wise.html' title='Adding two integer array element wise.'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-4079175583386291831</id><published>2011-09-18T12:10:00.000-07:00</published><updated>2011-09-18T12:13:59.002-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C/C++ Basic"/><title type='text'>Appends one array to another and print them in C++</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In the following program, show how to append or add one array to another.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
int* append(int*, int, int*, int);&lt;br /&gt;
void print(int*, int);&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int a[] = {11,22,33,44,55};&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int b[]={66,77,88,99};&lt;br /&gt;
&amp;nbsp; &amp;nbsp; print(a,5);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; print(b,5);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int* c= append(a,5,b,5);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; print(c,9);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int* append(int* a, int m, int*b, int n)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; int* c= new int[m+n];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; for (int i=0; i&amp;lt;m;i++)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; c[i]=a[i];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; for(int i=m;i&amp;lt;m+n;i++)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; c[i]=b[i-m];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return c;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
void print(int* a, int n)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt;&quot;{&quot; &amp;lt;&amp;lt; a[0];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; for (int i=1;i&amp;lt;n;i++)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt; &quot;,&quot; &amp;lt;&amp;lt; a[i];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; cout &amp;lt;&amp;lt; &quot;} \n&quot;;&lt;br /&gt;
}&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/4079175583386291831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/appends-one-array-to-another-and-print.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/4079175583386291831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/4079175583386291831'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/appends-one-array-to-another-and-print.html' title='Appends one array to another and print them in C++'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7236549929459219161.post-3042511164529805456</id><published>2011-09-18T11:54:00.000-07:00</published><updated>2011-09-18T11:55:00.041-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C/C++ Basic"/><category scheme="http://www.blogger.com/atom/ns#" term="Variable"/><title type='text'>Finding maximum value of an array in C++</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;In the following program you can find maximum value of an array:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 14px; line-height: 21px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;using namespace std;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;int min(int*, int);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;int main()&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; int array[]={66,44,88,11,77,33,99,55,22};&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; cout&amp;lt;&amp;lt; &quot;min(array,9)=&quot; &amp;lt;&amp;lt; min(array,9);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;int min(int* array, int n)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; int m=array[0];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; for(int i=1;i&amp;lt;n;i++)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; if (array[i]&amp;gt;m) m=array[i];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; return m;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jakirseu.blogspot.com/feeds/3042511164529805456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jakirseu.blogspot.com/2011/09/finding-maximum-value-of-array-in-c.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/3042511164529805456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7236549929459219161/posts/default/3042511164529805456'/><link rel='alternate' type='text/html' href='http://jakirseu.blogspot.com/2011/09/finding-maximum-value-of-array-in-c.html' title='Finding maximum value of an array in C++'/><author><name>Jakir Hossain</name><uri>http://www.blogger.com/profile/08236180115116481409</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>