<?xml version="1.0" encoding="UTF-8" standalone="no"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-174271235475244033</atom:id><lastBuildDate>Thu, 05 Sep 2024 09:09:20 +0000</lastBuildDate><category>C Graphics.h</category><category>source code</category><category>2D game</category><category>2d animation</category><category>Basic Computer</category><category>Data</category><category>Digital Design</category><category>Flip-flops</category><category>GUI</category><category>Graphics.h</category><category>Mouse input</category><category>RTL</category><category>Registers</category><category>Scientific Calculator</category><category>Turbo C</category><category>animation</category><category>calculator</category><category>java</category><category>netbeans</category><title>Computer Programing Source Codes  and Hardware</title><description>Turbo C, C++, C#, java, HTML, PHP, Joomla, MYSQL, CSS, 3DS MAX, Adobe Flash, Computer Architecture, Pipe-lining, MIPS, Assembly language</description><link>http://shikhor-himadrir.blogspot.com/</link><managingEditor>noreply@blogger.com (Shikhor Himadrir)</managingEditor><generator>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><language>en-us</language><itunes:explicit>no</itunes:explicit><itunes:keywords>Turbo,C,C,C,java,HTML,PHP,Joomla,MYSQL,CSS,3DS,MAX,Adobe,Flash,Computer,Architecture,Pipe,lining,MIPS,Assembly,language</itunes:keywords><itunes:summary>This is helpful for all technology user specially for  Turbo C, C++, C#, java, HTML, PHP, Joomla, MYSQL, CSS, 3DS MAX, Adobe Flash, Computer Architecture, Pipe-lining, MIPS, Assembly language</itunes:summary><itunes:subtitle>Codes and Hardware</itunes:subtitle><itunes:category text="Technology"><itunes:category text="Gadgets"/></itunes:category><itunes:category text="Music"/><itunes:category text="Education"><itunes:category text="Educational Technology"/></itunes:category><itunes:category text="Science &amp; Medicine"><itunes:category text="Medicine"/></itunes:category><itunes:category text="Games &amp; Hobbies"><itunes:category text="Automotive"/></itunes:category><itunes:author>Shikhor Himadrir</itunes:author><itunes:owner><itunes:email>noreply@blogger.com</itunes:email><itunes:name>Shikhor Himadrir</itunes:name></itunes:owner><item><guid isPermaLink="false">tag:blogger.com,1999:blog-174271235475244033.post-4775740652664806595</guid><pubDate>Thu, 13 May 2010 11:24:00 +0000</pubDate><atom:updated>2010-05-27T01:52:54.879-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Flip-flops</category><category domain="http://www.blogger.com/atom/ns#">Registers</category><category domain="http://www.blogger.com/atom/ns#">RTL</category><title>Register &amp;amp; Register Transfer in Digital Systems</title><description>&lt;div id="crosscol-wrapper" style="text-align: center;"&gt; &lt;div class="crosscol section" id="crosscol"&gt;&lt;div class="widget HTML" id="HTML1"&gt; &lt;div class="widget-content"&gt; &lt;embed src="http://www.clocklink.com/clocks/8006-gray.swf?TimeZone=Bangladesh_Dhaka&amp;amp;" wmode="transparent" type="application/x-shockwave-flash" width="150" height="150"&gt;&lt;/embed&gt;&lt;span class="item-control blog-admin"&gt; &lt;/span&gt;&lt;/div&gt;&lt;span class="widget-item-control"&gt; &lt;/span&gt;  &lt;/div&gt;&lt;/div&gt; &lt;/div&gt;    &lt;!-- google_ad_section_start(name=default) --&gt;&lt;a name="871166855690590065"&gt;&lt;/a&gt;&lt;div class="post-header"&gt;  &lt;/div&gt;             &lt;script type="text/javascript"&gt;&lt;!--      google_ad_client = "pub-0202439349020555"; google_ad_host = "pub-1556223355139109";     /* 336x280, created 10/05/10 */     google_ad_slot = "0497967779";     google_ad_width = 336;     google_ad_height = 280;    //--&gt;     &lt;/script&gt;     &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;     &lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/expansion_embed.js"&gt;&lt;/script&gt;&lt;script src="http://googleads.g.doubleclick.net/pagead/test_domain.js"&gt;&lt;/script&gt;&lt;script&gt;google_protectAndRun("ads_core.google_render_ad", google_handleError, google_render_ad&lt;/script&gt;&lt;ins style="display: inline-table; border: medium none; height: 280px; margin: 0pt; padding: 0pt; position: relative; visibility: visible; width: 336px;"&gt;&lt;/ins&gt;       &lt;p&gt;&lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;Flip Flops&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div align="justify"&gt;&lt;span style="font-family:verdana;"&gt;In every digital  system where all storage elements are employed during clock pulse is  called sequential circuit . Modern computers also have sequential  circuit design inside the CPU. This type of sequential circuit uses a  special component called flip flop. Each flip flop can hold one storage  data element in terms of bit. So we can say that 1 flip flop can hold 1  bit of data. Flip flops are use in sequential circuits because they can  make change of their stored data when a clock pulse is applied .Flip  flops are also well known as binary cell as it can store data in binary  signal 1 or 0 format. There are various types of flip flops. But  generally all types of flip flops have 2 outputs , one is normal and one  is complement and all flip flops have clock pulse line . The difference  among various types of flip flops is in the number of inputs they  possess and in the manner in which the inputs affect the binary state.  SR-type, JK-type, T-type, D-type are the most common flip flops.  Internally all flip flops are made of combinational circuit design using  digital components like logic gates. So because of combinational  structures every flip-flops have their own different truth tables and  equations. for example both SR-type flip flops and JK-type flip flops  have same numbers of inputs, but they are completely different in truth  tables and equations&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify; font-family: verdana;" align="justify"&gt;&lt;br /&gt;&lt;/div&gt;&lt;p align="justify"&gt;&lt;br /&gt;&lt;img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2K7tl9j4czRX-hCyeFV8Fw3LJM7UWYBeU_zJo3aK8xKjgf4FGYCWY-99zDSfNGjvYJ5yyQAUMUodn2j-EG1gRJ4pG4V6rykz8FFyV2MIXY6hJSrkG6wq3Pnc6jkJ8Gw97l3YFlGm1TFY/s320/fig4a.gif" width="320" height="114" /&gt;&lt;img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtZc2zxJ3G36Jyi8jpVBfsdvEbLfU4Um1F3pMhDwBD2IhscyVA0rh3QFAIKMMTPRL1dYvww6GEXpV-yKv7jOFBlSZpeG9t8mltN0JaDAmqc24y7GlOsiibTOqNh5eb6W1VOtgIjX6rnLM/s320/fig6a.gif" width="316" height="146" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;figure : SR-type and JK-type Flip  flop&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggiHVVKyagsoFCPTTzAMY09iy_dyzCJcZsoNgvTNpQo5XyPsZRk0_mMTet1Lrm73lROo7A5UD9o2oFKoQBriWR8mUv-Hm1O0F3RcxBo43TerajX9r5AlmGrbEyupwIpuzku110Zxg4bUY/s320/fig7a.gif" width="311" height="146" /&gt;&lt;img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTAyEd9Ldbo50NHY9rP_wnK9rFJmwVVI_7jFdbAOuCTPARFiOB_bcP7oRJmPzgptfWh1e03yFzgUDu7pCm2XOFj7C_GT6-QZwgeAYmgxue4ocysItPt2Y2-98wjIpR6NO1jIRKC8cYwd0/s320/fig5a.gif" width="320" height="113" /&gt;&lt;br /&gt;&lt;br /&gt;figure : T-type and D-type Flip flop&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);font-size:180%;" &gt;&lt;/span&gt;&lt;p align="justify"&gt;&lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;Register&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;Complex digital systems which deals with lots of tasks like  logic operation, arithmetic operation contains many hardware whose are  interconnected among them. These hardware modules are internally made of  some digital components like register, decoder, logic control etc. So  registers plays an important role in digital systems. Registers store  all of the binary bits on which any specific task can be done. These  tasks are called micro operations. For example if computer wants to  perform addition of two numbers than inside CPU the ALU unit will  transfer add-micro operation signal to registers to perform addition  between two numbers. After a task performed on register's containing  bits , the bit values may or may not change. depending on the task  condition. A register is a group of of flip flops with each flip flop  capable of storing 1 bit of information . So an n-bit register contains n  numbers of flip flops. Because of simplicity D-type flip flops are most  commonly used flip flop.&lt;/div&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzXwhyY_K9IOmKsaqpzjSBOGgdN6MYQT7SSG_omQ636x4HDEGymaba9m_wHAIjn203iyphaUW-33SYYXmGP78qTwgIjGEOk0VsT5wz7WVT4nbmK9ENizW4JJcFF4xX0Wi98MkStzg0XOc/s320/1.1.7.10.jpg" width="320" height="262" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;figure : 4-bit  register using d-type flip flop&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);font-size:180%;" &gt;&lt;/span&gt;&lt;p&gt;&lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;Register Transfer Language &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family:verdana;"&gt;Digital  systems which use registers have a control and a list of micro  operations. This control selects some of the micro operations from the  list and transfers them in a sequence to one or more registers to  perform on its stored binary bit values. For example ALU is the control  for CPU unit. So these types of digital systems hardware design can be  define if we keep 3 important things in our mind:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family:verdana;"&gt;1. The  set of registers it contains and their functions.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;2 The sequence of micro operations  performed on the bit values inside the registers.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;3. The control that initiates the sequence  of micro operations.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;The  sequence of micro operations can be transfer to registers in lengthy  descriptive words but as it is lengthy the processing will slow down its  speed. Instead of this if we use any symbolic notations to indicate the  same of micro operations, and then the processes will be simpler to  handle with faster speed. The notation which expresses the sequence of  micro operations in a simple manner is called Register Transfer  Language. Some basic symbols are given below:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlfLU1a4rn3PlcCMKOgDtyJhkjRl0Md8vX9KwyYSHsjkYoOTRgWnAQj8caoW80hIM9zVgD4XNr_L0X8c75emHdAKAMDiITO23FGGxSKuTUISfYVT2OU2wS-cD0I9SvoDEc9uDAsxm1DSo/s320/RTL.gif" width="320" height="216" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;figure : basic symbols in Register  Transfer Language - RT L&lt;/p&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);font-size:180%;" &gt;&lt;/span&gt;&lt;p&gt;&lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;Register Transfer Concept&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;Using R T L-Language&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="text-align: justify;"&gt;&lt;span style="font-family:verdana;"&gt;In this type of digital  systems first the control choose some micro operations in a sequence and  then transfer them to one or more registers to perform some tasks on  registers containing bit values. The entire works can be done just by  expressing the works in RT L-Register Transfer Language notation.For  example suppose a control is denoted by symbol 'P' and two register R1,  R2. if we wants to perform a transfer of bit values from register R2 to  R1,then we can write the entire expression in RT L is given in below  figure :&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRwPscMKVNZldwjRJHG8K6xmQJrpYksmHShUR5KYpnQ0M7MpHnIBDAFNPwiNWxX4du2nYRUk8m432XqGzHUvTewEsvnFlCf89IRhvW-JJ4DdIIXwtJh5QivR6J2S8MGvY_leATvqLQW28/s320/p.gif" width="320" height="197" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="text-align: justify; font-family: verdana;"&gt;It means that , when the control get value 1 and  the clock pulse rise then it will load the register R1 so that the  transfer can be from R2 to R1.So one can easily see that , the control  is acting like a door of register R1. The given figure will explain all  things which are happening inside the system:&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQdOcTOnTf15e5SBwUedIJFDJMnZnN-BCDCrX4iO9_g0pNr-OPRfvA-KcRR8ND3mo9s4HYPW9YqbMUr4K9fbCiGI010NqpRLWPSNBgEhViOOeG81hXGNqf_bLhBT3BPfy1JHGsgJ48ze0/s320/load.gif" width="320" height="250" /&gt;&lt;img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicK_cKrypmlH20cyXer2zhuUU0GOH8F3_9VqCnORYVLRqlf_PRVJOfIDngueYPkTam2uTGGMa9Gd2ooGiJBTAsZI8HUi1YmJtQ-hXS5uUYSLTM7vudZpaD5K5an4l6ZVimHTeNG_0EI1U/s320/4013_07.gif" width="320" height="197" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;span style="font-family:verdana;"&gt;In RT L-language system more then one  micro operations are separated by commas.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNfxyOeDUf733tpDtZrY8UTp2qPswzKOa_IxJ4658hcium4SaUydqhgQowABJqEEKBRAjsdnRCtpQlTyrX8r7h4Ma26eSdlwKLZdZXRNezuteAeM5tjojNQn8hjMRKrJFW_FwErHPGxxs/s320/p1.gif" width="320" height="208" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="text-align: justify; font-family: verdana;"&gt;In RT L-language system the group of bits content  of register can be express by specifying the bits index range [means  the flip flop index] or by the giving sign L or H [means Lower or Higher  bits ] inside a parentheses ( ).&lt;/p&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;p&gt;&lt;br /&gt;&lt;img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVuC4-00GYJHbeywCwlugasXawtS7v9vRBuSXL5-RekAsp_WY5QyMzlFxdnsWHgsD3_GspW2rThE4HhjIMTAnUVb_P7PLc4cI2egtuwrK85zFnd5hAOa3TI6lRL_pWSsf4JieWjz5hc5k/s320/p2.gif" width="320" height="208" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;p style="font-family: verdana;" align="justify"&gt;figure : transferring a group of bits&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;p align="justify"&gt;&lt;br /&gt;&lt;img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhImZsb_bsNbHvTXrRxFBP-RSonzIlkkVDxY0ytlHq4zE8MUnDBpW6EUKRTCl7kmw3fopLrgQ-srpc5MQLG-3PFmGSVFx3EXBTcZUWEPM8dwdpj7Xd8fGZqtW9S5gOM6-BnwfTxPAUagf4/s320/mr.gif" width="320" height="177" /&gt;&lt;/p&gt;&lt;/span&gt;</description><link>http://shikhor-himadrir.blogspot.com/2010/05/register-register-transfer-in-digital.html</link><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2K7tl9j4czRX-hCyeFV8Fw3LJM7UWYBeU_zJo3aK8xKjgf4FGYCWY-99zDSfNGjvYJ5yyQAUMUodn2j-EG1gRJ4pG4V6rykz8FFyV2MIXY6hJSrkG6wq3Pnc6jkJ8Gw97l3YFlGm1TFY/s72-c/fig4a.gif" width="72"/><thr:total>1</thr:total><author>noreply@blogger.com (Shikhor Himadrir)</author><enclosure length="17852" type="application/x-shockwave-flash" url="http://www.clocklink.com/clocks/8006-gray.swf?TimeZone=Bangladesh_Dhaka&amp;amp;"/><itunes:explicit>no</itunes:explicit><itunes:subtitle>google_protectAndRun("ads_core.google_render_ad", google_handleError, google_render_ad Flip Flops In every digital system where all storage elements are employed during clock pulse is called sequential circuit . Modern computers also have sequential circuit design inside the CPU. This type of sequential circuit uses a special component called flip flop. Each flip flop can hold one storage data element in terms of bit. So we can say that 1 flip flop can hold 1 bit of data. Flip flops are use in sequential circuits because they can make change of their stored data when a clock pulse is applied .Flip flops are also well known as binary cell as it can store data in binary signal 1 or 0 format. There are various types of flip flops. But generally all types of flip flops have 2 outputs , one is normal and one is complement and all flip flops have clock pulse line . The difference among various types of flip flops is in the number of inputs they possess and in the manner in which the inputs affect the binary state. SR-type, JK-type, T-type, D-type are the most common flip flops. Internally all flip flops are made of combinational circuit design using digital components like logic gates. So because of combinational structures every flip-flops have their own different truth tables and equations. for example both SR-type flip flops and JK-type flip flops have same numbers of inputs, but they are completely different in truth tables and equations figure : SR-type and JK-type Flip flop figure : T-type and D-type Flip flop Register Complex digital systems which deals with lots of tasks like logic operation, arithmetic operation contains many hardware whose are interconnected among them. These hardware modules are internally made of some digital components like register, decoder, logic control etc. So registers plays an important role in digital systems. Registers store all of the binary bits on which any specific task can be done. These tasks are called micro operations. For example if computer wants to perform addition of two numbers than inside CPU the ALU unit will transfer add-micro operation signal to registers to perform addition between two numbers. After a task performed on register's containing bits , the bit values may or may not change. depending on the task condition. A register is a group of of flip flops with each flip flop capable of storing 1 bit of information . So an n-bit register contains n numbers of flip flops. Because of simplicity D-type flip flops are most commonly used flip flop. figure : 4-bit register using d-type flip flop Register Transfer Language Digital systems which use registers have a control and a list of micro operations. This control selects some of the micro operations from the list and transfers them in a sequence to one or more registers to perform on its stored binary bit values. For example ALU is the control for CPU unit. So these types of digital systems hardware design can be define if we keep 3 important things in our mind: 1. The set of registers it contains and their functions. 2 The sequence of micro operations performed on the bit values inside the registers. 3. The control that initiates the sequence of micro operations. The sequence of micro operations can be transfer to registers in lengthy descriptive words but as it is lengthy the processing will slow down its speed. Instead of this if we use any symbolic notations to indicate the same of micro operations, and then the processes will be simpler to handle with faster speed. The notation which expresses the sequence of micro operations in a simple manner is called Register Transfer Language. Some basic symbols are given below: figure : basic symbols in Register Transfer Language - RT L Register Transfer Concept Using R T L-Language In this type of digital systems first the control choose some micro operations in a sequence and then transfer them to one or more registers to perform some tasks on registers containing bit values. The entire works can be done just by expressing the works in RT L-Register Transfer Language notation.For example suppose a control is denoted by symbol 'P' and two register R1, R2. if we wants to perform a transfer of bit values from register R2 to R1,then we can write the entire expression in RT L is given in below figure : It means that , when the control get value 1 and the clock pulse rise then it will load the register R1 so that the transfer can be from R2 to R1.So one can easily see that , the control is acting like a door of register R1. The given figure will explain all things which are happening inside the system: In RT L-language system more then one micro operations are separated by commas. In RT L-language system the group of bits content of register can be express by specifying the bits index range [means the flip flop index] or by the giving sign L or H [means Lower or Higher bits ] inside a parentheses ( ). figure : transferring a group of bits</itunes:subtitle><itunes:author>Shikhor Himadrir</itunes:author><itunes:summary>google_protectAndRun("ads_core.google_render_ad", google_handleError, google_render_ad Flip Flops In every digital system where all storage elements are employed during clock pulse is called sequential circuit . Modern computers also have sequential circuit design inside the CPU. This type of sequential circuit uses a special component called flip flop. Each flip flop can hold one storage data element in terms of bit. So we can say that 1 flip flop can hold 1 bit of data. Flip flops are use in sequential circuits because they can make change of their stored data when a clock pulse is applied .Flip flops are also well known as binary cell as it can store data in binary signal 1 or 0 format. There are various types of flip flops. But generally all types of flip flops have 2 outputs , one is normal and one is complement and all flip flops have clock pulse line . The difference among various types of flip flops is in the number of inputs they possess and in the manner in which the inputs affect the binary state. SR-type, JK-type, T-type, D-type are the most common flip flops. Internally all flip flops are made of combinational circuit design using digital components like logic gates. So because of combinational structures every flip-flops have their own different truth tables and equations. for example both SR-type flip flops and JK-type flip flops have same numbers of inputs, but they are completely different in truth tables and equations figure : SR-type and JK-type Flip flop figure : T-type and D-type Flip flop Register Complex digital systems which deals with lots of tasks like logic operation, arithmetic operation contains many hardware whose are interconnected among them. These hardware modules are internally made of some digital components like register, decoder, logic control etc. So registers plays an important role in digital systems. Registers store all of the binary bits on which any specific task can be done. These tasks are called micro operations. For example if computer wants to perform addition of two numbers than inside CPU the ALU unit will transfer add-micro operation signal to registers to perform addition between two numbers. After a task performed on register's containing bits , the bit values may or may not change. depending on the task condition. A register is a group of of flip flops with each flip flop capable of storing 1 bit of information . So an n-bit register contains n numbers of flip flops. Because of simplicity D-type flip flops are most commonly used flip flop. figure : 4-bit register using d-type flip flop Register Transfer Language Digital systems which use registers have a control and a list of micro operations. This control selects some of the micro operations from the list and transfers them in a sequence to one or more registers to perform on its stored binary bit values. For example ALU is the control for CPU unit. So these types of digital systems hardware design can be define if we keep 3 important things in our mind: 1. The set of registers it contains and their functions. 2 The sequence of micro operations performed on the bit values inside the registers. 3. The control that initiates the sequence of micro operations. The sequence of micro operations can be transfer to registers in lengthy descriptive words but as it is lengthy the processing will slow down its speed. Instead of this if we use any symbolic notations to indicate the same of micro operations, and then the processes will be simpler to handle with faster speed. The notation which expresses the sequence of micro operations in a simple manner is called Register Transfer Language. Some basic symbols are given below: figure : basic symbols in Register Transfer Language - RT L Register Transfer Concept Using R T L-Language In this type of digital systems first the control choose some micro operations in a sequence and then transfer them to one or more registers to perform some tasks on registers containing bit values. The entire works can be done just by expressing the works in RT L-Register Transfer Language notation.For example suppose a control is denoted by symbol 'P' and two register R1, R2. if we wants to perform a transfer of bit values from register R2 to R1,then we can write the entire expression in RT L is given in below figure : It means that , when the control get value 1 and the clock pulse rise then it will load the register R1 so that the transfer can be from R2 to R1.So one can easily see that , the control is acting like a door of register R1. The given figure will explain all things which are happening inside the system: In RT L-language system more then one micro operations are separated by commas. In RT L-language system the group of bits content of register can be express by specifying the bits index range [means the flip flop index] or by the giving sign L or H [means Lower or Higher bits ] inside a parentheses ( ). figure : transferring a group of bits</itunes:summary><itunes:keywords>Turbo,C,C,C,java,HTML,PHP,Joomla,MYSQL,CSS,3DS,MAX,Adobe,Flash,Computer,Architecture,Pipe,lining,MIPS,Assembly,language</itunes:keywords></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-174271235475244033.post-7952350062733555915</guid><pubDate>Sat, 08 May 2010 04:51:00 +0000</pubDate><atom:updated>2010-05-16T12:07:33.239-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">calculator</category><category domain="http://www.blogger.com/atom/ns#">GUI</category><category domain="http://www.blogger.com/atom/ns#">java</category><category domain="http://www.blogger.com/atom/ns#">netbeans</category><category domain="http://www.blogger.com/atom/ns#">source code</category><title>The Calculator Implementation In java</title><description>&lt;font style="color: rgb(51, 51, 255);" size="5"&gt;Introduction&lt;/font&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;font face="verdana"&gt;In this blog i am going implement the simple calculator in java.I will try to explain all the things that are very important and anyone who is familiar with java GUI programing can easily understa&lt;/font&gt;&lt;font face="verdana"&gt;nd the source code.&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;font face="verdana"&gt;Before you start, please be sure that you have the latest Netbeans version and java run time environment software.You can download tease two software from the link given bellow :-&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://netbeans.org/downloads/"&gt;http://netbeans.org/downloads/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;&lt;br /&gt;http://java.sun.com/javase/downloads/index.jsp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;font style="color: rgb(51, 51, 255);" size="5"&gt;The Calculator Screen&lt;/font&gt;&lt;br /&gt;&lt;font face="verdana"&gt;If we run the java source code, we will see a calculator like this :-&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRBSAS7Nc-WweBNjKldMfuYX3ZtRz56da1AH9-WHsL6HLM3hAOBsJpOW6iWEsgtZxKrAEyVS1srHa0L0erPRbtcw8QezBS9b92PojX-_qyhoJMsGvyYH6pFblCcROrAdx1Ek1QR9zW7pI/s1600/j3.JPG"&gt;&lt;img style="cursor: pointer; width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRBSAS7Nc-WweBNjKldMfuYX3ZtRz56da1AH9-WHsL6HLM3hAOBsJpOW6iWEsgtZxKrAEyVS1srHa0L0erPRbtcw8QezBS9b92PojX-_qyhoJMsGvyYH6pFblCcROrAdx1Ek1QR9zW7pI/s320/j3.JPG" alt="" id="BLOGGER_PHOTO_ID_5469169647545873938" border="0"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;font style="color: rgb(204, 0, 0); font-family: verdana;"&gt;To exit &lt;/font&gt;&lt;font style="color: rgb(204, 0, 0); font-family: verdana;"&gt;the calculator&lt;/font&gt;&lt;font style="color: rgb(204, 0, 0); font-family: verdana;"&gt; correctly , we must click the File option given in the picture bellow&lt;/font&gt;&lt;font face="verdana"&gt; :-&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZNKEoWt_Qm7ohWYmNaWVpoIdCY8xXYg1Uqg48ptobc5PVPvNs96tN6WL4Fkj5zSzuL9xE61lydi52suCrwAsHAyGpJ0vS8euMrxn4YgfhHyc4gDCp71Y530B8xRu6V_iwozIMbjwgxWA/s1600/j5.JPG"&gt;&lt;img style="cursor: pointer; width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZNKEoWt_Qm7ohWYmNaWVpoIdCY8xXYg1Uqg48ptobc5PVPvNs96tN6WL4Fkj5zSzuL9xE61lydi52suCrwAsHAyGpJ0vS8euMrxn4YgfhHyc4gDCp71Y530B8xRu6V_iwozIMbjwgxWA/s320/j5.JPG" alt="" id="BLOGGER_PHOTO_ID_5469170297368114306" border="0"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;font size="5"&gt;&lt;font style="color: rgb(51, 51, 255);"&gt;Here Is the Complete Source Code :&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;/*&lt;br /&gt;* To change this template, choose Tools | Templates&lt;br /&gt;* and open the template in the editor.&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;package calculator;&lt;br /&gt;import java.awt.BorderLayout;&lt;br /&gt;import java.awt.Color;&lt;br /&gt;import java.awt.Container;&lt;br /&gt;import java.awt.FlowLayout;&lt;br /&gt;import java.awt.Font;&lt;br /&gt;import java.awt.GridLayout;&lt;br /&gt;import java.awt.Window;&lt;br /&gt;import java.awt.event.ActionEvent;&lt;br /&gt;import java.awt.event.ActionListener;&lt;br /&gt;import java.awt.event.KeyEvent;&lt;br /&gt;import java.awt.event.WindowAdapter;&lt;br /&gt;import java.awt.event.WindowEvent;&lt;br /&gt;&lt;br /&gt;import javax.swing.JButton;&lt;br /&gt;import javax.swing.JDialog;&lt;br /&gt;import javax.swing.JFrame;&lt;br /&gt;import javax.swing.JLabel;&lt;br /&gt;import javax.swing.JMenu;&lt;br /&gt;import javax.swing.JMenuBar;&lt;br /&gt;import javax.swing.JMenuItem;&lt;br /&gt;import javax.swing.JPanel;&lt;br /&gt;import javax.swing.JTextArea;&lt;br /&gt;import javax.swing.KeyStroke;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;*&lt;br /&gt;* @author himadree&lt;br /&gt;*/&lt;br /&gt;public class Main extends JFrame implements ActionListener {&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * @param args the command line arguments&lt;br /&gt;  */&lt;br /&gt;     final int MAX_INPUT_LENGTH = 20;&lt;br /&gt; final int INPUT_MODE = 0;&lt;br /&gt; final int RESULT_MODE = 1;&lt;br /&gt; final int ERROR_MODE = 2;&lt;br /&gt; int displayMode;&lt;br /&gt;&lt;br /&gt; boolean clearOnNextDigit, percent;&lt;br /&gt; double lastNumber;&lt;br /&gt; String lastOperator;&lt;br /&gt;&lt;br /&gt; private JMenu jmenuFile, jmenuHelp;&lt;br /&gt; private JMenuItem jmenuitemExit, jmenuitemAbout;&lt;br /&gt;&lt;br /&gt; private JLabel jlbOutput;&lt;br /&gt; private JButton jbnButtons[];&lt;br /&gt; private JPanel jplMaster, jplBackSpace, jplControl;&lt;br /&gt;&lt;br /&gt; /*&lt;br /&gt;  * Font(String name, int style, int size)&lt;br /&gt;   Creates a new Font from the specified name, style and point size.&lt;br /&gt;  */&lt;br /&gt;&lt;br /&gt; Font f12 = new Font("Times New Roman", 0, 12);&lt;br /&gt; Font f121 = new Font("Times New Roman", 1, 12);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     // Constructor&lt;br /&gt; public Main()&lt;br /&gt; {&lt;br /&gt;     /* Set Up the JMenuBar.&lt;br /&gt;      * Have Provided All JMenu's with Mnemonics&lt;br /&gt;      * Have Provided some JMenuItem components with Keyboard Accelerators&lt;br /&gt;      */&lt;br /&gt; &lt;br /&gt;     jmenuFile = new JMenu("File");&lt;br /&gt;     jmenuFile.setFont(f121);&lt;br /&gt;     jmenuFile.setMnemonic(KeyEvent.VK_F);&lt;br /&gt; &lt;br /&gt;     jmenuitemExit = new JMenuItem("Exit");&lt;br /&gt;     jmenuitemExit.setFont(f12);&lt;br /&gt;     jmenuitemExit.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_X,&lt;br /&gt;                             ActionEvent.CTRL_MASK));&lt;br /&gt;     jmenuFile.add(jmenuitemExit);&lt;br /&gt;&lt;br /&gt;     jmenuHelp = new JMenu("Help");&lt;br /&gt;     jmenuHelp.setFont(f121);&lt;br /&gt;     jmenuHelp.setMnemonic(KeyEvent.VK_H);&lt;br /&gt;&lt;br /&gt;     jmenuitemAbout = new JMenuItem("About Calculator");&lt;br /&gt;     jmenuitemAbout.setFont(f12);&lt;br /&gt;     jmenuHelp.add(jmenuitemAbout);&lt;br /&gt; &lt;br /&gt;     JMenuBar mb = new JMenuBar();&lt;br /&gt;     mb.add(jmenuFile);&lt;br /&gt;     mb.add(jmenuHelp);&lt;br /&gt;     setJMenuBar(mb);&lt;br /&gt; &lt;br /&gt;     //Set frame layout manager&lt;br /&gt;&lt;br /&gt;     setBackground(Color.gray);&lt;br /&gt;&lt;br /&gt;     jplMaster = new JPanel();&lt;br /&gt;&lt;br /&gt;     jlbOutput = new JLabel("0");&lt;br /&gt;     jlbOutput.setHorizontalTextPosition(JLabel.RIGHT);&lt;br /&gt;     jlbOutput.setBackground(Color.WHITE);&lt;br /&gt;     jlbOutput.setOpaque(true);&lt;br /&gt; &lt;br /&gt;     // Add components to frame&lt;br /&gt;     getContentPane().add(jlbOutput, BorderLayout.NORTH);&lt;br /&gt;&lt;br /&gt;     jbnButtons = new JButton[23];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     JPanel jplButtons = new JPanel();        // container for Jbuttons&lt;br /&gt;&lt;br /&gt;     // Create numeric Jbuttons&lt;br /&gt;     for (int i=0; i&lt;=9; i++)         {             // set each Jbutton label to the value of index             jbnButtons[i] = new JButton(String.valueOf(i));         }          // Create operator Jbuttons         jbnButtons[10] = new JButton("+/-");         jbnButtons[11] = new JButton(".");         jbnButtons[12] = new JButton("=");         jbnButtons[13] = new JButton("/");         jbnButtons[14] = new JButton("*");         jbnButtons[15] = new JButton("-");         jbnButtons[16] = new JButton("+");         jbnButtons[17] = new JButton("sqrt");         jbnButtons[18] = new JButton("1/x");         jbnButtons[19] = new JButton("%");                 jplBackSpace = new JPanel();         jplBackSpace.setLayout(new GridLayout(1, 1, 2, 2));                 Color c = new Color(70,50,30 );         jbnButtons[20] = new JButton("Backspace");                 jbnButtons[20].setBackground(c);                         jplBackSpace.add(jbnButtons[20]);          jplControl = new JPanel();         jplControl.setLayout(new GridLayout(1, 2, 2 ,2));          jbnButtons[21] = new JButton(" CE ");                 jbnButtons[21].setBackground(c);                         jbnButtons[22] = new JButton("C");                 jbnButtons[22].setBackground(c);          jplControl.add(jbnButtons[21]);         jplControl.add(jbnButtons[22]);  //        Setting all Numbered JButton's to Blue. The rest to Red         for (int i=0; i&lt;jbnbuttons.length; if="" i=""&gt;&lt;20) i="7;" i="4;" i="1;" and ="         jplButtons.add(jbnButtons[0]);" i="0;" add="" windowlistener="" closing="" frame="" and="" ending="" program="" new="" windowevent="" contructor="" perform="" action="" public="" void="" actionevent="" double="" result="0;" jdialog="" dlgabout="new" about="" java="" swing="" calculator="" else="" search="" the="" button="" pressed="" until="" end="" of="" array="" or="" key="" found="" for="" int="" i="0;"&gt;&lt;jbnbuttons.length; decimal="" point="" sqrt="" 1="" x="" cannot="" divide="" by="" try="" result="Math.sqrt(getNumberInDisplay());" exception="" invalid="" input="" for="" case="" backspace="" displaymode="ERROR_MODE;" if=""&gt;&lt; inputstring =" getDisplayString();" inputstring =" inputString.substring(1);"&gt; 0)&lt;br /&gt;                         &amp;amp;&amp;amp; inputString.length() &lt; displaymode =" INPUT_MODE;" clearonnextdigit =" false;" displaymode =" INPUT_MODE;" inputstring =" getDisplayString();" displaymode ="="" input =" getDisplayString();"&gt; 0 &amp;amp;&amp;amp; !input.equals("0"))&lt;br /&gt;         {&lt;br /&gt;             if (input.indexOf("-") == 0)&lt;br /&gt;                 setDisplayString(input.substring(1));&lt;br /&gt;&lt;br /&gt;             else&lt;br /&gt;                 setDisplayString("-" + input);&lt;br /&gt;         }&lt;br /&gt;     &lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     else if (displayMode == RESULT_MODE)&lt;br /&gt;     {&lt;br /&gt;         double numberInDisplay = getNumberInDisplay();&lt;br /&gt; &lt;br /&gt;         if (numberInDisplay != 0)&lt;br /&gt;             displayResult(-numberInDisplay);&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; void clearAll()    {&lt;br /&gt;     setDisplayString("0");&lt;br /&gt;     lastOperator = "0";&lt;br /&gt;     lastNumber = 0;&lt;br /&gt;     displayMode = INPUT_MODE;&lt;br /&gt;     clearOnNextDigit = true;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; void clearExisting(){&lt;br /&gt;     setDisplayString("0");&lt;br /&gt;     clearOnNextDigit = true;&lt;br /&gt;     displayMode = INPUT_MODE;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; double getNumberInDisplay()    {&lt;br /&gt;     String input = jlbOutput.getText();&lt;br /&gt;     return Double.parseDouble(input);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; void processOperator(String op) {&lt;br /&gt;     if (displayMode != ERROR_MODE)&lt;br /&gt;     {&lt;br /&gt;         double numberInDisplay = getNumberInDisplay();&lt;br /&gt;&lt;br /&gt;         if (!lastOperator.equals("0"))&lt;br /&gt;         {&lt;br /&gt;             try&lt;br /&gt;             {&lt;br /&gt;                 double result = processLastOperator();&lt;br /&gt;                 displayResult(result);&lt;br /&gt;                 lastNumber = result;&lt;br /&gt;             }&lt;br /&gt;&lt;br /&gt;             catch (DivideByZeroException e)&lt;br /&gt;             {&lt;br /&gt;             }&lt;br /&gt;         }&lt;br /&gt; &lt;br /&gt;         else&lt;br /&gt;         {&lt;br /&gt;             lastNumber = numberInDisplay;&lt;br /&gt;         }&lt;br /&gt;     &lt;br /&gt;         clearOnNextDigit = true;&lt;br /&gt;         lastOperator = op;&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; void processEquals(){&lt;br /&gt;     double result = 0;&lt;br /&gt;&lt;br /&gt;     if (displayMode != ERROR_MODE){&lt;br /&gt;         try        &lt;br /&gt;         {&lt;br /&gt;             result = processLastOperator();&lt;br /&gt;             displayResult(result);&lt;br /&gt;         }&lt;br /&gt;     &lt;br /&gt;         catch (DivideByZeroException e)    {&lt;br /&gt;             displayError("Cannot divide by zero!");&lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;         lastOperator = "0";&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; double processLastOperator() throws DivideByZeroException {&lt;br /&gt;     double result = 0;&lt;br /&gt;     double numberInDisplay = getNumberInDisplay();&lt;br /&gt;&lt;br /&gt;     if (lastOperator.equals("/"))&lt;br /&gt;     {&lt;br /&gt;         if (numberInDisplay == 0)&lt;br /&gt;             throw (new DivideByZeroException());&lt;br /&gt;&lt;br /&gt;         result = lastNumber / numberInDisplay;&lt;br /&gt;     }&lt;br /&gt;     &lt;br /&gt;     if (lastOperator.equals("*"))&lt;br /&gt;         result = lastNumber * numberInDisplay;&lt;br /&gt;&lt;br /&gt;     if (lastOperator.equals("-"))&lt;br /&gt;         result = lastNumber - numberInDisplay;&lt;br /&gt;&lt;br /&gt;     if (lastOperator.equals("+"))&lt;br /&gt;         result = lastNumber + numberInDisplay;&lt;br /&gt;&lt;br /&gt;     return result;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; void displayResult(double result){&lt;br /&gt;     setDisplayString(Double.toString(result));&lt;br /&gt;     lastNumber = result;&lt;br /&gt;     displayMode = RESULT_MODE;&lt;br /&gt;     clearOnNextDigit = true;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; void displayError(String errorMessage){&lt;br /&gt;     setDisplayString(errorMessage);&lt;br /&gt;     lastNumber = 0;&lt;br /&gt;     displayMode = ERROR_MODE;&lt;br /&gt;     clearOnNextDigit = true;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; &lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;     // TODO code application logic here&lt;br /&gt;     Main calci = new Main();&lt;br /&gt;     Container contentPane = calci.getContentPane();&lt;br /&gt;     calci.setTitle("Java Calculator ");&lt;br /&gt;     calci.setSize(250, 220);&lt;br /&gt;     calci.pack();&lt;br /&gt;     calci.setLocation(200, 300);&lt;br /&gt;     calci.setVisible(true);&lt;br /&gt;     calci.setResizable(false);&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class DivideByZeroException extends Exception{&lt;br /&gt; public DivideByZeroException()&lt;br /&gt; {&lt;br /&gt;     super();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public DivideByZeroException(String s)&lt;br /&gt; {&lt;br /&gt;     super(s);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class CustomABOUTDialog extends JDialog implements ActionListener {&lt;br /&gt; JButton jbnOk;&lt;br /&gt;&lt;br /&gt; CustomABOUTDialog(JFrame parent, String title, boolean modal){&lt;br /&gt;     super(parent, title, modal);&lt;br /&gt;     setBackground(Color.black);&lt;br /&gt; &lt;br /&gt;     JPanel p1 = new JPanel(new FlowLayout(FlowLayout.CENTER));&lt;br /&gt;&lt;br /&gt;     StringBuffer text = new StringBuffer();&lt;br /&gt;     text.append("Calculator \n\n");&lt;br /&gt;     text.append("Developer:    Himadree\n");&lt;br /&gt;     text.append("Version:    1.0");&lt;br /&gt; &lt;br /&gt;     JTextArea jtAreaAbout = new JTextArea(5, 21);&lt;br /&gt;     jtAreaAbout.setText(text.toString());&lt;br /&gt;     jtAreaAbout.setFont(new Font("Times New Roman", 1, 13));&lt;br /&gt;     jtAreaAbout.setEditable(false);&lt;br /&gt;&lt;br /&gt;     p1.add(jtAreaAbout);&lt;br /&gt;     p1.setBackground(Color.red);&lt;br /&gt;     getContentPane().add(p1, BorderLayout.CENTER);&lt;br /&gt;&lt;br /&gt;     JPanel p2 = new JPanel(new FlowLayout(FlowLayout.CENTER));&lt;br /&gt;     jbnOk = new JButton(" OK ");&lt;br /&gt;     jbnOk.addActionListener(this);&lt;br /&gt;&lt;br /&gt;     p2.add(jbnOk);&lt;br /&gt;     getContentPane().add(p2, BorderLayout.SOUTH);&lt;br /&gt;&lt;br /&gt;     setLocation(408, 270);&lt;br /&gt;     setResizable(false);&lt;br /&gt;&lt;br /&gt;     addWindowListener(new WindowAdapter() {&lt;br /&gt;             public void windowClosing(WindowEvent e)&lt;br /&gt;             {&lt;br /&gt;                 Window aboutDialog = e.getWindow();&lt;br /&gt;                 aboutDialog.dispose();&lt;br /&gt;             }&lt;br /&gt;         }&lt;br /&gt;     );&lt;br /&gt;&lt;br /&gt;     pack();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void actionPerformed(ActionEvent e)&lt;br /&gt; {&lt;br /&gt;     if(e.getSource() == jbnOk)    {&lt;br /&gt;         this.dispose();&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/jbnbuttons.length;&gt;&lt;/jbnbuttons.length;&gt;&lt;/div&gt;&lt;/div&gt;&lt;font style="color: rgb(255, 0, 0);"&gt;Note : For more information, you can also visit my other blogs. And don't forget to give your valuable comments.&lt;/font&gt;&lt;br /&gt;&lt;/div&gt;&lt;font face="verdana"&gt;&lt;/font&gt;&lt;br /&gt;</description><link>http://shikhor-himadrir.blogspot.com/2010/05/calculator-implementation-in-java.html</link><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRBSAS7Nc-WweBNjKldMfuYX3ZtRz56da1AH9-WHsL6HLM3hAOBsJpOW6iWEsgtZxKrAEyVS1srHa0L0erPRbtcw8QezBS9b92PojX-_qyhoJMsGvyYH6pFblCcROrAdx1Ek1QR9zW7pI/s72-c/j3.JPG" width="72"/><thr:total>1</thr:total><author>noreply@blogger.com (Shikhor Himadrir)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-174271235475244033.post-6440469994910639967</guid><pubDate>Sun, 02 May 2010 04:12:00 +0000</pubDate><atom:updated>2010-05-27T02:33:12.719-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">2D game</category><category domain="http://www.blogger.com/atom/ns#">animation</category><category domain="http://www.blogger.com/atom/ns#">C Graphics.h</category><category domain="http://www.blogger.com/atom/ns#">source code</category><title>The Snake Game In C</title><description>&lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;Introduction&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family:verdana;"&gt;This is a small turbo c program of snake game using&lt;br /&gt; some graphics.h functions. Anyone who is familiar with C graphics&lt;br /&gt; programming can do it very easily&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;Code Explanation &lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify; font-family: verdana;"&gt;In the beginning of code explanation the first important part is&lt;br /&gt; initializing the graphics mode in turbo C to do drawing a calculator and&lt;br /&gt; that is must be done before using every graphics related functions. This&lt;br /&gt; graphics initialization is done by a pre-define function called initgraph()&lt;br /&gt; with a tiny code part given below :&lt;br /&gt;&lt;br /&gt; int gdriver = DETECT, gmode, errorcode;&lt;br /&gt;initgraph(&amp;amp;gdriver, &amp;amp;gmode, "C:\\TC\\BGI");&lt;br /&gt;&lt;br /&gt; If your TC folder is in D drive than just type "D:\\TC\\BGI" instead of&lt;br /&gt; "C:\\TC\\BGI"&lt;br /&gt;&lt;br /&gt;inside the initgraph( ) function.So if you want to use graphics functions in&lt;br /&gt; your turbo c program, than you have to always write these two statement in&lt;br /&gt; the main( ) function.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; If you initialize the graphics mode than, all graphics.h function can be use&lt;br /&gt; in the program.But if you need to come back to the normal textmode (the&lt;br /&gt; black screen ) than you have to shut down the graphics mode by using the&lt;br /&gt; graphics.h function closegraph( ).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In that program we have use three user-define functions given below :&lt;br /&gt;&lt;div style="text-align: justify;"&gt;      void check();&lt;br /&gt;void end();&lt;br /&gt;void win();&lt;br /&gt;&lt;br /&gt;   The first screen shot will be like this :-&lt;br /&gt;&lt;a onblur="try  {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1EYNjQh7rzFx9dkZ7hngg9YCnM3xK9EUY0yymUce30ojJX5HLItN2zVUPwbihnAxQOEu8xkkmr9QyuktLXETokQP5OpDBC8Pkr2OwnecE6owr7_-zz8TY8SvxQ-KfXAqP3QqsuuNY1PE/s1600/p%252F1272738413938.jpg"&gt;&lt;br /&gt;   &lt;img style="cursor: pointer; width: 320px; height: 254px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1EYNjQh7rzFx9dkZ7hngg9YCnM3xK9EUY0yymUce30ojJX5HLItN2zVUPwbihnAxQOEu8xkkmr9QyuktLXETokQP5OpDBC8Pkr2OwnecE6owr7_-zz8TY8SvxQ-KfXAqP3QqsuuNY1PE/s320/p%252F1272738413938.jpg" alt="" id="BLOGGER_PHOTO_ID_5466523920285646258" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   The gaming screen will be look like this :-&lt;br /&gt;&lt;br /&gt;   &lt;a onblur="try  {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizMEzl5gacuqOZEqBGyfv_yg8GkOtJclsvbzyrBdNTvci5leKpf0riiScoW6MQElyfKqVE4vjH16wOlouoYc0UtjzynV3VfsOoE_DKP4ZCOfbEtY6boCThurFKl4ePJPOV4MAW1tZQb7o/s1600/p%252F1272738584472.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 254px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizMEzl5gacuqOZEqBGyfv_yg8GkOtJclsvbzyrBdNTvci5leKpf0riiScoW6MQElyfKqVE4vjH16wOlouoYc0UtjzynV3VfsOoE_DKP4ZCOfbEtY6boCThurFKl4ePJPOV4MAW1tZQb7o/s320/p%252F1272738584472.jpg" alt="" id="BLOGGER_PHOTO_ID_5466524552537445922" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;Here is the source code&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;        #include "graphics.h"&lt;br /&gt;#include 'stdlib.h"&lt;br /&gt;#include "dos.h"&lt;br /&gt;#include "conio.h"&lt;br /&gt;#include "stdio.h"&lt;br /&gt;#include "time.h"&lt;br /&gt;    &lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;          int m[500],n[500],con=20,TEMP;&lt;br /&gt;clock_t start,stop;&lt;br /&gt;&lt;br /&gt;void main(void)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;       int gd=DETECT,gm,ch,maxx,maxy,x=13,y=14,p,q,spd=100;&lt;br /&gt;&lt;br /&gt;       int a=0,i=0,j,t,temp;&lt;br /&gt;&lt;br /&gt;       initgraph(&amp;amp;gd,&amp;amp;gm,"C:\\TC\\BGI");&lt;br /&gt;&lt;br /&gt;setcolor(6);&lt;br /&gt;&lt;br /&gt;       settextstyle(1,0,6);&lt;br /&gt;&lt;br /&gt;       outtextxy(20,2," SNAKE 2 BY Himadree ");&lt;br /&gt;&lt;br /&gt;       settextstyle(6,0,2);&lt;br /&gt;&lt;br /&gt;outtextxy(20,80," Use Arrow Keys To Direct The Snake ");&lt;br /&gt;&lt;br /&gt;       outtextxy(20,140," Avoid The Head Of Snake Not To Hit Any Part Of&lt;br /&gt;       Snake");&lt;br /&gt;&lt;br /&gt;       outtextxy(20,160," Pick The Beats Untill You Win The Game ");&lt;br /&gt;&lt;br /&gt;       outtextxy(20,200," Press 'Esc' Anytime To Exit ");&lt;br /&gt;&lt;br /&gt;       outtextxy(20,220," Press Any Key To Continue ");&lt;br /&gt;&lt;br /&gt;       outtextxy(20,240," DONT FORGET TO GIVE U R VALUABLE OPINION ");&lt;br /&gt;&lt;br /&gt;ch=getch();&lt;br /&gt;&lt;br /&gt;       if(ch==27) exit(0);&lt;br /&gt;&lt;br /&gt;       cleardevice();&lt;br /&gt;&lt;br /&gt;       maxx=getmaxx();&lt;br /&gt;&lt;br /&gt;       maxy=getmaxy();&lt;br /&gt;&lt;br /&gt;       randomize();&lt;br /&gt;p=random(maxx);&lt;br /&gt;temp=p%13;&lt;br /&gt;p=p-temp;&lt;br /&gt;q=random(maxy);&lt;br /&gt;temp=q%14;&lt;br /&gt;q=q-temp;&lt;br /&gt;start=clock();&lt;br /&gt;&lt;br /&gt;        while(1)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;          setcolor(WHITE);&lt;br /&gt; setfillstyle(SOLID_FILL,con+5);&lt;br /&gt; circle(p,q,5);&lt;br /&gt; floodfill(p,q,WHITE);&lt;br /&gt; if( kbhit() )&lt;br /&gt; {&lt;br /&gt;&lt;br /&gt;            ch=getch(); if(ch==0) ch=getch();&lt;br /&gt;&lt;br /&gt;            if(ch==72&amp;amp;&amp;amp; a!=2) a=1;&lt;br /&gt;&lt;br /&gt;            if(ch==80&amp;amp;&amp;amp; a!=1) a=2;&lt;br /&gt;&lt;br /&gt;            if(ch==75&amp;amp;&amp;amp; a!=4) a=3;&lt;br /&gt;&lt;br /&gt;            if(ch==77&amp;amp;&amp;amp; a!=3) a=4;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt; else&lt;br /&gt; {&lt;br /&gt;&lt;br /&gt;            if(ch==27){&lt;br /&gt;&lt;br /&gt;               break;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;          if(i&amp;lt;20){&lt;br /&gt;&lt;br /&gt;             m[i]=x;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;             n[i]=y;&lt;br /&gt;&lt;br /&gt;             i++;&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;          if(i&amp;gt;=20)&lt;br /&gt; {&lt;br /&gt;&lt;br /&gt;             for(j=con;j&amp;gt;=0;j--){&lt;br /&gt;&lt;br /&gt;             m[1+j]=m[j];&lt;br /&gt;&lt;br /&gt;             n[1+j]=n[j];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;          m[0]=x;&lt;br /&gt; n[0]=y;&lt;br /&gt; setcolor(WHITE);&lt;br /&gt; setfillstyle(SOLID_FILL,con);&lt;br /&gt; circle(m[0],n[0],8);&lt;br /&gt; floodfill(m[0],n[0],WHITE);&lt;br /&gt; setcolor(WHITE);&lt;br /&gt; for(j=1;j&amp;lt;con;j++){&lt;br /&gt;&lt;br /&gt;             setfillstyle(SOLID_FILL,con+j%3);&lt;br /&gt;    circle(m[j],n[j],5);&lt;br /&gt;    floodfill(m[j],n[j],WHITE);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;           delay(spd);&lt;br /&gt;  setcolor(BLACK);&lt;br /&gt;  setfillstyle(SOLID_FILL,BLACK);&lt;br /&gt;  circle(m[0],n[0],8);&lt;br /&gt;  floodfill(m[0],n[0],BLACK);&lt;br /&gt;  setcolor(BLACK);&lt;br /&gt;  setfillstyle(SOLID_FILL,BLACK);&lt;br /&gt;  circle(m[j],n[j],5);&lt;br /&gt;  floodfill(m[j],n[j],BLACK);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;          stop=clock();&lt;br /&gt;&lt;br /&gt; t=(stop-start)/CLK_TCK;&lt;br /&gt;&lt;br /&gt;          check();&lt;br /&gt;&lt;br /&gt;          if(x==p &amp;amp;&amp;amp; y==q)&lt;br /&gt; {&lt;br /&gt;&lt;br /&gt;              con=con+5;&lt;br /&gt;&lt;br /&gt;              if(spd&amp;gt;=5)&lt;br /&gt;       spd=spd-5;&lt;br /&gt;      else spd=5;&lt;br /&gt;&lt;br /&gt;           if(con&amp;gt;490)&lt;br /&gt;&lt;br /&gt;           win();&lt;br /&gt;  p=random(maxx); temp=p%13;  p=p-temp;&lt;br /&gt;  q=random(maxy); temp=q%14;   q=q-temp;&lt;br /&gt;  }&lt;br /&gt;  if(a==1){&lt;br /&gt;     y =  y-14;&lt;br /&gt;&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;           if(y&amp;lt;0)&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;    temp=maxy%14;y=maxy-temp;&lt;br /&gt;&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;           if(a==2)&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;              y =  y+14;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;           if(y&amp;gt;maxy)&lt;br /&gt;&lt;br /&gt;           {&lt;br /&gt;&lt;br /&gt;             y=0;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;           if(a==3){&lt;br /&gt;&lt;br /&gt;              x =  x-13;&lt;br /&gt;&lt;br /&gt;           }&lt;br /&gt;  if(x&amp;lt;0) {&lt;br /&gt;&lt;br /&gt;              temp=maxx%13;x=maxx-temp;&lt;br /&gt;&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;           if(a==4){&lt;br /&gt;     x =  x+13; if(x&amp;gt;maxx) x=0;&lt;br /&gt;&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;           if(a==0)&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;     y = y+14 ;&lt;br /&gt;&lt;br /&gt;              x=x+13;&lt;br /&gt;&lt;br /&gt;           }&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       void check(){&lt;br /&gt;&lt;br /&gt;          int a;&lt;br /&gt; for(a=1;a&amp;lt;con;a++)&lt;br /&gt;&lt;br /&gt;         if(m[0]==m[a] &amp;amp;&amp;amp; n[0]==n[a])&lt;br /&gt;{&lt;br /&gt;  end();&lt;br /&gt;&lt;br /&gt;         }&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;           continue;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;void end()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt; int j,i;&lt;br /&gt;&lt;br /&gt;          setcolor(WHITE);&lt;br /&gt;&lt;br /&gt;          for(i=0;i&amp;lt;5;i++){&lt;br /&gt;&lt;br /&gt;          delay(500);&lt;br /&gt; cleardevice();&lt;br /&gt;&lt;br /&gt;          delay(500);&lt;br /&gt;&lt;br /&gt;             for(j=0;j&amp;lt;=con;j++){&lt;br /&gt;&lt;br /&gt;                 setfillstyle(SOLID_FILL,RED);&lt;br /&gt;        circle(m[j],n[j],5);&lt;br /&gt;        floodfill(m[j],n[j],WHITE);&lt;br /&gt;&lt;br /&gt;             }&lt;br /&gt; }&lt;br /&gt; settextstyle(3,0,4);&lt;br /&gt; outtextxy(150,150,"    GAME OVER ");&lt;br /&gt;&lt;br /&gt;          getch();&lt;br /&gt; getch();&lt;br /&gt;&lt;br /&gt;          exit(0);&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;       void win()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;int j,i;&lt;br /&gt;&lt;br /&gt;        setcolor(WHITE);&lt;br /&gt;&lt;br /&gt;          for(i=0;i&amp;lt;5;i++){&lt;br /&gt;&lt;br /&gt;              for(j=0;j&amp;lt;=con;j++){&lt;br /&gt;&lt;br /&gt;              setfillstyle(SOLID_FILL,con);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;              circle(m[j],n[j],5);&lt;br /&gt;&lt;br /&gt;              floodfill(m[j],n[j],WHITE);&lt;br /&gt;&lt;br /&gt;              }&lt;br /&gt;&lt;br /&gt;           delay(500);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;           cleardevice();&lt;br /&gt;&lt;br /&gt;           delay(500);&lt;br /&gt;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;         settextstyle(3,0,4);&lt;br /&gt;&lt;br /&gt;         outtextxy(210,320," YOU WIN ");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;         getch();&lt;br /&gt;&lt;br /&gt;         exit(0);&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-family: verdana;"&gt;Note : For  more information, you  can also visit my other blogs. And don't forget  to give your valuable  comments.&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;    &lt;/div&gt;  &lt;/div&gt;&lt;/div&gt;</description><link>http://shikhor-himadrir.blogspot.com/2010/05/snake-game-in-c.html</link><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1EYNjQh7rzFx9dkZ7hngg9YCnM3xK9EUY0yymUce30ojJX5HLItN2zVUPwbihnAxQOEu8xkkmr9QyuktLXETokQP5OpDBC8Pkr2OwnecE6owr7_-zz8TY8SvxQ-KfXAqP3QqsuuNY1PE/s72-c/p%252F1272738413938.jpg" width="72"/><thr:total>1</thr:total><author>noreply@blogger.com (Shikhor Himadrir)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-174271235475244033.post-6091886100815612021</guid><pubDate>Sat, 01 May 2010 16:22:00 +0000</pubDate><atom:updated>2010-05-27T02:43:53.405-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">2d animation</category><category domain="http://www.blogger.com/atom/ns#">C Graphics.h</category><title>Rabindranath Tagore Animation In Turbo C</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkOfsR4eh69atwahU9ARGoSg-YoY1WXUotFOGwmCBghze4_jrSz737HRclJeYv6-nrzm98wnFF-mcjUbVaINu5TvG2YM0zTXlEMkO0i2HBmGYwvfhyphenhyphenAcd4azjvBRGQ1eaXyDzr76tzTn3M/s1600/Tagore3.jpg"&gt;&lt;img style="cursor: pointer; width: 238px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkOfsR4eh69atwahU9ARGoSg-YoY1WXUotFOGwmCBghze4_jrSz737HRclJeYv6-nrzm98wnFF-mcjUbVaINu5TvG2YM0zTXlEMkO0i2HBmGYwvfhyphenhyphenAcd4azjvBRGQ1eaXyDzr76tzTn3M/s320/Tagore3.jpg" alt="" id="BLOGGER_PHOTO_ID_5466340724612994610" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Introduction&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;This is small animation of a poet Rabindranath Tagore in C.This animation is just build with using some graphics.h program and other time delay function.One who know C graphics program , will  simply understand the animation source code.&lt;br /&gt;&lt;br /&gt;In the beginning of code explanation the first important part is  initializing the graphics mode in turbo C to do drawing this animation    and that is must be done before  using every graphics related  functions.This graphics initialization is done by a pre-define function  called initgraph() with a tiny code part given below :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int  gdriver = DETECT, gmode, errorcode;&lt;br /&gt;initgraph(&amp;amp;gdriver,  &amp;amp;gmode, "C:\\TC\\BGI");&lt;br /&gt;&lt;br /&gt;If your TC folder is in D drive than  just type   "D:\\TC\\BGI" instead of "C:\\TC\\BGI"&lt;br /&gt;inside the  initgraph( ) function.So if you want to use graphics functions in your  turbo c program, than you have to always write these two statement in  the main( ) function.&lt;br /&gt;&lt;br /&gt;I just download some art pictures of Rabindranath Tagore and than made his animating photo with turbo c language.After running the program, the animation might look like the photo given bellow :-&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvhnEf4BAVJufpc7uQ3vZt-aeblTdgcVNYiQbgJbfK_cyAkfm2d4UjEYn0xomXs6UyUmNQlyxTZAv2eyyKMCO3jQ2PuOEBXaHsp9-IGjfocESBZRG0eIBwl5hwj7BayvvYeRv4vpRQq_kr/s1600/p%252F1272730990263.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 254px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvhnEf4BAVJufpc7uQ3vZt-aeblTdgcVNYiQbgJbfK_cyAkfm2d4UjEYn0xomXs6UyUmNQlyxTZAv2eyyKMCO3jQ2PuOEBXaHsp9-IGjfocESBZRG0eIBwl5hwj7BayvvYeRv4vpRQq_kr/s320/p%252F1272730990263.jpg" alt="" id="BLOGGER_PHOTO_ID_5466340233798184402" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;Here is source code&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;#include "graphics.h"&lt;br /&gt;#include "stdio.h"&lt;br /&gt;#include "conio.h"&lt;br /&gt;#include "dos.h"&lt;br /&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt; /* request auto detection */&lt;br /&gt; int gd = DETECT, gm;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; /* initialize graphics and localvariables */&lt;br /&gt; initgraph(&amp;amp;gd, &amp;amp;gm, "C:\\TC\\BGI");&lt;br /&gt; arc(234, 125, 120, 190, 50);&lt;br /&gt; line(185,135, 185,155);&lt;br /&gt; arc(190, 162,120,280, 8);&lt;br /&gt; arc(193, 175 , 300, 90, 6);&lt;br /&gt; arc(198, 200, 100, 150, 20);&lt;br /&gt;&lt;br /&gt; arc( 205,210, 140, 180, 30 );&lt;br /&gt; line(176, 210, 176, 228);&lt;br /&gt; arc(185, 229,180,310, 8);&lt;br /&gt; line( 185, 238 ,200, 230);&lt;br /&gt; arc(205, 230, 340, 180, 3);&lt;br /&gt; line(205,232, 200, 258);&lt;br /&gt; arc(212, 260, 160, 315, 12);&lt;br /&gt; line(220, 270, 180, 310);&lt;br /&gt; arc(210, 310, 180, 230, 30);&lt;br /&gt; arc(205, 330, 30, 180,15);&lt;br /&gt; arc(160, 330,290,5, 60);&lt;br /&gt; arc(105, 360, 290, 340 ,80);&lt;br /&gt; arc(145, 440, 165, 350,15);&lt;br /&gt; arc(165, 420, 260, 360, 25);&lt;br /&gt; line(190, 420, 230, 400);&lt;br /&gt; arc(210, 218, 270, 360, 10);&lt;br /&gt; arc(200, 280, 30, 80,65);&lt;br /&gt; line(250, 280, 260, 250);&lt;br /&gt; arc(268, 300,100, 270, 25);&lt;br /&gt; arc(280, 335,140, 270, 15);&lt;br /&gt; arc(260, 380,220, 300, 35);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; arc(192, 142,180, 340, 6);&lt;br /&gt; arc(218, 160, 40, 150,25);&lt;br /&gt; arc(218, 164, 50, 150,25);&lt;br /&gt; arc(200, 140,180, 250, 15);&lt;br /&gt; line(208, 156, 230,148);&lt;br /&gt; line(212, 172, 230, 148);&lt;br /&gt; circle(212, 162, 6);&lt;br /&gt; setfillstyle(SOLID_FILL, WHITE);&lt;br /&gt; floodfill(213, 163, WHITE);&lt;br /&gt; arc(280,152, 180, 230,70);&lt;br /&gt;&lt;br /&gt; arc(275,158, 340,130, 100);&lt;br /&gt; arc(305, 220, 330,30,70);&lt;br /&gt; arc(305, 220, 330,30,80);&lt;br /&gt; arc(305, 220, 330,30,82);&lt;br /&gt; arc(305, 220, 330,30,75);&lt;br /&gt; arc(305, 156,0, 150, 70);&lt;br /&gt; arc(200, 160,0, 100, 60);&lt;br /&gt;&lt;br /&gt; /* For hair */&lt;br /&gt;&lt;br /&gt; arc(260, 140,0, 155, 90);&lt;br /&gt; arc(260, 140,0, 154, 88);&lt;br /&gt; arc(260, 140,0, 153, 86);&lt;br /&gt; arc(260, 140,0, 152, 84);&lt;br /&gt; arc(260, 140,0, 151, 82);&lt;br /&gt;&lt;br /&gt; arc(260, 140,0, 149, 80);&lt;br /&gt; arc(260, 140,0, 148, 78);&lt;br /&gt; arc(260, 140,0, 147, 76);&lt;br /&gt; arc(260, 140,0, 146, 74);&lt;br /&gt; arc(260, 140,0, 145, 72);&lt;br /&gt; arc(260, 140,0, 144, 70);&lt;br /&gt; arc(260, 140,0, 143, 68);&lt;br /&gt; arc(260, 140,0, 142, 66);&lt;br /&gt; arc(260, 140,0, 141, 64);&lt;br /&gt; arc(260, 140,0, 140, 62);&lt;br /&gt; arc(260, 140,0, 139, 60);&lt;br /&gt; arc(260, 140,0, 138, 58);&lt;br /&gt; arc(260, 140,0, 137, 56);&lt;br /&gt; arc(260, 140,0, 136, 54);&lt;br /&gt; arc(260, 140,0, 135, 52);&lt;br /&gt; arc(260, 140,0, 134, 50);&lt;br /&gt; arc(260, 140,0, 133, 48);&lt;br /&gt; arc(260, 140,0, 132, 46);&lt;br /&gt; arc(260, 140,0, 131, 44);&lt;br /&gt; arc(260, 140,0, 130, 42);&lt;br /&gt; arc(260, 140,0, 129, 40);&lt;br /&gt; arc(260, 140,0, 128, 38);&lt;br /&gt; arc(260, 140,0, 127, 36);&lt;br /&gt; arc(260, 140,0, 126, 34);&lt;br /&gt; arc(260, 140,0, 125, 32);&lt;br /&gt; arc(260, 140,0, 124, 30);&lt;br /&gt; arc(260, 140,0, 123, 28);&lt;br /&gt; arc(260, 140,0, 122, 26);&lt;br /&gt; arc(260, 140,0, 121, 24);&lt;br /&gt; arc(260, 140,0, 120, 22);&lt;br /&gt; arc(260, 140,0, 119, 20);&lt;br /&gt; arc(260, 140,0, 118, 18);&lt;br /&gt; arc(260, 140,0, 117, 16);&lt;br /&gt; arc(260, 140,0, 116, 14);&lt;br /&gt; arc(260, 140,0, 115, 12);&lt;br /&gt; arc(260, 140,0, 114, 10);&lt;br /&gt; arc(260, 140,0, 113, 8);&lt;br /&gt; arc(260, 140,0, 112, 6);&lt;br /&gt; arc(260, 140,0, 111, 4);&lt;br /&gt; arc(260, 140,0, 110, 2);&lt;br /&gt;&lt;br /&gt;  /* another hair style */&lt;br /&gt; arc(282, 150, 330, 70, 88);&lt;br /&gt; arc(282, 150, 330, 70, 86);&lt;br /&gt; arc(282, 150, 330, 70, 84);&lt;br /&gt; arc(282, 150, 330, 70, 82);&lt;br /&gt; arc(282, 150, 330, 70, 80);&lt;br /&gt; arc(282, 150, 330, 70, 78);&lt;br /&gt; arc(282, 150, 330, 70, 76);&lt;br /&gt; arc(282, 150, 330, 70, 74);&lt;br /&gt; arc(282, 150, 330, 70, 72);&lt;br /&gt; arc(282, 150, 330, 70, 70);&lt;br /&gt; arc(282, 150, 330, 70, 68);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; arc(310, 150,330, 90,  65);&lt;br /&gt;&lt;br /&gt; /*----ANIMATION-----*/&lt;br /&gt;&lt;br /&gt;while (!kbhit()){&lt;br /&gt;  setbkcolor(BLACK);&lt;br /&gt;  setcolor(WHITE);&lt;br /&gt;&lt;br /&gt;  delay(1000);&lt;br /&gt;  line(410,100, 440, 100);&lt;br /&gt;  line(440,100,390, 140);&lt;br /&gt;  line(390, 140, 430, 150);&lt;br /&gt;  line(440,100, 430, 150);&lt;br /&gt;  circle(410, 160, 2);&lt;br /&gt;  delay(1000);&lt;br /&gt;&lt;br /&gt;  putchar('\r');&lt;br /&gt;&lt;br /&gt;  line(460, 100, 490, 100);&lt;br /&gt;  line(490,100,440, 140);&lt;br /&gt;  line(440, 140, 480, 150);&lt;br /&gt;  line(490,100, 480, 150);&lt;br /&gt;  line(500,100, 490, 150);&lt;br /&gt;  arc(480,100,350,180, 20);&lt;br /&gt;  delay(1000);&lt;br /&gt;&lt;br /&gt;  putchar('\r');&lt;br /&gt;&lt;br /&gt;  line(510, 100, 550, 100);&lt;br /&gt;  line(530,100, 520, 150);&lt;br /&gt;  circle(505, 125, 3);&lt;br /&gt;  arc(525, 145, 90, 125, 30);&lt;br /&gt;  line(545, 130, 520, 150);&lt;br /&gt;  line(545, 130,560,150);&lt;br /&gt;  arc(565, 210, 92, 180,60);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  delay(1000);&lt;br /&gt;  setbkcolor(BLACK);&lt;br /&gt;  setcolor(BLACK);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  line(410,100, 440, 100);&lt;br /&gt;  line(440,100,390, 140);&lt;br /&gt;  line(390, 140, 430, 150);&lt;br /&gt;  line(440,100, 430, 150);&lt;br /&gt;  circle(410, 160, 2);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  line(460, 100, 490, 100);&lt;br /&gt;  line(490,100,440, 140);&lt;br /&gt;  line(440, 140, 480, 150);&lt;br /&gt;  line(490,100, 480, 150);&lt;br /&gt;  line(500,100, 490, 150);&lt;br /&gt;  arc(480,100,350,180, 20);&lt;br /&gt;&lt;br /&gt;  line(510, 100, 550, 100);&lt;br /&gt;  line(530,100, 520, 150);&lt;br /&gt;  circle(505, 125, 3);&lt;br /&gt;  arc(525, 145, 90, 125, 30);&lt;br /&gt;  line(545, 130, 520, 150);&lt;br /&gt;  line(545, 130,560,150);&lt;br /&gt;  arc(565, 210, 92, 180,60);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; getch();&lt;br /&gt; closegraph();&lt;br /&gt; return 0;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;}&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:verdana;" &gt;Note : For   more information, you  can also visit my other blogs. And don't forget   to give your valuable  comments.&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://shikhor-himadrir.blogspot.com/2010/05/rabindranath-tagore-animation-in-turbo.html</link><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkOfsR4eh69atwahU9ARGoSg-YoY1WXUotFOGwmCBghze4_jrSz737HRclJeYv6-nrzm98wnFF-mcjUbVaINu5TvG2YM0zTXlEMkO0i2HBmGYwvfhyphenhyphenAcd4azjvBRGQ1eaXyDzr76tzTn3M/s72-c/Tagore3.jpg" width="72"/><thr:total>1</thr:total><author>noreply@blogger.com (Shikhor Himadrir)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-174271235475244033.post-6173051066461502262</guid><pubDate>Fri, 30 Apr 2010 14:51:00 +0000</pubDate><atom:updated>2010-05-27T02:22:37.904-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Graphics.h</category><category domain="http://www.blogger.com/atom/ns#">Mouse input</category><category domain="http://www.blogger.com/atom/ns#">Scientific Calculator</category><category domain="http://www.blogger.com/atom/ns#">Turbo C</category><title>Scientific Calculator In C</title><description>&lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;&lt;span style="font-family:verdana;"&gt;Introduction&lt;/span&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;" align="justify"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span style="font-family:verdana;"&gt;In this i have explained about the implementation of a scientific calculator using programing language Turbo C.This program comes with various turbo c graphics function.So i will try to explain.In this i have explained about the implementation of a scientific calculator using programing language Turbo C.This program comes with various turbo c graphics function.So i will try to explain all the  tricky parts of code inside it.Those who are not familiar with the common functions and other simple contents of turbo C  are requested to learn them from any other source, otherwise it  may  be  problematic for you.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;&lt;span style="font-family:verdana;"&gt;Special Thanks To :&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div style="text-align: justify;" align="justify"&gt;&lt;span style="font-family:verdana;"&gt;Mr.Muhammad Saqib&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-family:verdana;"&gt;The list of predefined functions in the c&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-family:verdana;"&gt;ode&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;stdio h=""&gt;&lt;span style="color: rgb(51, 102, 255);font-family:verdana;" &gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/stdio&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: justify;" align="justify"&gt;#include stdio.h&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;functions :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;printf( )&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;#include conio.h&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;functions :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;clrscr( ) , getch( ) , kbhit( )&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;#include process.h&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;functions :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;exit( )&lt;div style="text-align: justify;" align="justify"&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;#include dos.h&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;functions :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;delay( ), int86( )&lt;/div&gt;&lt;div style="text-align: justify;" align="justify"&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;#include stdlib.h&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;functions :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;atoi( ) , malloc( ) , free( )&lt;/div&gt;&lt;div style="text-align: justify;" align="justify"&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;#include graphics.h&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;functions:&lt;/div&gt;&lt;div style="text-align: justify;" align="justify"&gt;setcolor( ), settextjustify( ), settextstyle( ), setusercharsize( ),setfillstyle( ), moveto( ), outtext(),outtextxy( ), line( ), getmaxx( ), getmaxy( ), gotoxy(), bar( ), rectangle( ),&lt;span style="font-family:verdana;"&gt;cleardevice( ), closegraph( )  initgraph( )&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;" align="justify"&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;" align="justify"&gt;#include math.h&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;functions :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;sqrt() , sin( ), cos( ), tan( ),  asin( ),  acos( ),  atan( ), log10( ), pow( )&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;#include string.h&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;functions :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;strlen() ;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;stdio style="color: rgb(51, 102, 255);" h=""&gt;&lt;conio h=""&gt;&lt;process h=""&gt;&lt;dos h=""&gt;&lt;stdlib h=""&gt;&lt;iostream h=""&gt;&lt;graphics h=""&gt;&lt;math h=""&gt;&lt;string h=""&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-family:verdana;"&gt;The list of user-define function used in code&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/string&gt;&lt;/math&gt;&lt;/graphics&gt;&lt;/iostream&gt;&lt;/stdlib&gt;&lt;/dos&gt;&lt;/process&gt;&lt;/conio&gt;&lt;/stdio&gt;&lt;div style="text-align: justify;" align="justify"&gt;&lt;div style="text-align: justify;"&gt;void typeit (int x,int y,int spacing,char string[]) ;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void front()&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void frontpage(void)&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;char input();&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;double add(double,double,char);&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;double angle_conv(double);&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void basecng(double,double);&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void button_3d(int x1,int y1,int x2,int y2,int check,char* text,int color)&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void screen(int x1, int y1, int x2, int y2);&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void init_mouse();&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void mouse();&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void hide_mouse();&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void show_mouse();&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void remove_mouse();&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;void structure();&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-family:verdana;"&gt;Source Code explanation&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div style="text-align: justify;" align="justify"&gt;on that code i have have used some global variables, strings, constant which given below :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;float *mem;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;int X=0, Y=0;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;int row=17,col=5;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;char dummy;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;char flag='d',flagp='0';&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;char bflag='u',bflagp='u';&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;int mflag=0;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;char ch,ch1,ch2;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;int sflag=0;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;int midx,midy;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;# define UNCLICKED 0&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;# define CLICKED 1&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;# define PI 3.14159&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;In the beginning of code explanation the first important part is initializing the graphics mode in turbo C to do drawing a calculator  and that is must be done before  using every graphics related functions.This graphics initialization is done by a pre-define function called initgraph() with a tiny code part given below :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;int gdriver = DETECT, gmode, errorcode;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;initgraph(&amp;amp;gdriver, &amp;amp;gmode, "C:\\TC\\BGI");&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;If your TC folder is in D drive than just type   "D:\\TC\\BGI" instead of "C:\\TC\\BGI"&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;inside the initgraph( ) function.So if you want to use graphics functions in your turbo c program, than you have to always write these two statement in the main( ) function.&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;If you initialize the graphics mode than, all  graphics.h  function can be use in the program.But if you need to come back to the normal textmode (the black screen ) than you have to shut down the graphics mode by using the graphics.h function closegraph( ).&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;The First Opening Screen  Animation :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;When you run this program you will see a small animation just like given below&lt;/span&gt;&lt;div style="text-align: justify;" align="justify"&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmm1DBH3ytlHZmRp8ms95M2th90EyzT_snL0W-W8ktD7PSqatdu67KzDEdbbkQm_my1m9XphDojWGwQlukanlccRiV4lknapm-N3yKkwg-O3l-CExZFNF1LUhxzbAry735wO4yyJxFM8aK/s1600/p%252F1272651297442.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 254px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmm1DBH3ytlHZmRp8ms95M2th90EyzT_snL0W-W8ktD7PSqatdu67KzDEdbbkQm_my1m9XphDojWGwQlukanlccRiV4lknapm-N3yKkwg-O3l-CExZFNF1LUhxzbAry735wO4yyJxFM8aK/s320/p%252F1272651297442.jpg" alt="" id="BLOGGER_PHOTO_ID_5465995892628862194" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;This part of the program is done by 2 user define function :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;1. void typeit (int x,int y,int spacing,char string[]) :: this function types the programmer's name   with green color and with other special effects by using delay( )  and other graphics.h functions&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;2. void front( ) :: This function draws the opening animation given in above picture.&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;The Second Screen&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;After  getting this Opening Screen  Animation , if you press  any key than  you will see the second screen just like given  below&lt;/span&gt;&lt;div style="text-align: justify;" align="justify"&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwpYmf0jPXiClrg9H-hFcFXbqTAzJh07Lo3A6_9uJ-oay75svmI3sXvN-trhpw85L6c4u61kj-a4qMIzKk16bNVHGAfqSTM2YQZeNydf9bV6LBJ_A-qctposKmcEGrmyrHILSyAy5v9ELD/s1600/p%252F1272709190856.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 254px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwpYmf0jPXiClrg9H-hFcFXbqTAzJh07Lo3A6_9uJ-oay75svmI3sXvN-trhpw85L6c4u61kj-a4qMIzKk16bNVHGAfqSTM2YQZeNydf9bV6LBJ_A-qctposKmcEGrmyrHILSyAy5v9ELD/s320/p%252F1272709190856.jpg" alt="" id="BLOGGER_PHOTO_ID_5466244698298798466" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;This second screen drawing is done by the function&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void frontpage(void)&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;The Mouse Related Functions :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;I have add mouse operation in this program , so to do this we need to initialize the mouse driver for activating the muse cursor and this is done by the function&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void init_mouse() :: initialize the mouse driver.&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void mouse() :: for each calculator button's action taken by the mouse.&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;Because in the graphics screen always we move the mouse cursor.So that the position of the mouse symbol changes by each an every movement.That means if we erase/hide the mouse symbol at the past position and draw/show the mouse symbol at the new position will make the mouse movement in normal. This hiding and showing of mouse is done by 2 mouse function :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;1. void hide_mouse()&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;2. void show_mouse()&lt;/span&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjTrqp9pmuifXwTTNwS-vVNW-YAEpExJvfzbfP4TerqUdIsYLLpx92Qe8Obx7mmMzy3gx1sGIloFfcrxtzXPh02zcUv2crGQQtkS-bKdwMVi5SyXiWjJYJImxLKdnV_FvnOIlA8cGVirnK/s1600/p%252F1272692545706.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 254px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjTrqp9pmuifXwTTNwS-vVNW-YAEpExJvfzbfP4TerqUdIsYLLpx92Qe8Obx7mmMzy3gx1sGIloFfcrxtzXPh02zcUv2crGQQtkS-bKdwMVi5SyXiWjJYJImxLKdnV_FvnOIlA8cGVirnK/s320/p%252F1272692545706.jpg" alt="" id="BLOGGER_PHOTO_ID_5466231508867783202" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;When we change the current mouse cursor position to the new one , the old position information (i.e: X-cordinate, Y-cordinate etc) has been removed by the new one and to do that operation we use the function void remove_mouse().&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;Remember one thing , that device like mouse are external things in graphics or dos mode.That means we are forcing the program to add external operations too .So we are actually  interrupting the main to do the mouse operations and to do so we have called the function&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;int86(0x33,&amp;amp;ioRegs,&amp;amp;ioRegs);&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;NOTE: for further more information about mouse operations and the algorithms , please visit to my blog&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;The Display Screen Function&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;The display screen of the calculator is look like that :&lt;/span&gt;&lt;div style="text-align: justify;" align="justify"&gt;&lt;div align="justify"&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLAJMU-AJ8JA8ZJTyjh0DYqCdb7PJqiq_qo6lafpG4Rd5YHzMuQZYfEk-SVc5xsrnHWqvIuLpoFhE5BRxlHZK4PhsGj1AIcmZqSIM4w4RBwKhWTHwjUgjWPESTrcyoYgCkr57wCOAeFgI8/s1600/p%252F1272690329638.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 254px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLAJMU-AJ8JA8ZJTyjh0DYqCdb7PJqiq_qo6lafpG4Rd5YHzMuQZYfEk-SVc5xsrnHWqvIuLpoFhE5BRxlHZK4PhsGj1AIcmZqSIM4w4RBwKhWTHwjUgjWPESTrcyoYgCkr57wCOAeFgI8/s320/p%252F1272690329638.jpg" alt="" id="BLOGGER_PHOTO_ID_5466233270515928482" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;This is is done by the function :-&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void screen(int x1, int y1, int x2, int y2);&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;The 3D Buttons And Body Of Calculator:&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXPc39duWEtAgGuUGCKj29eKjepto322nr8kUY6B_yAep0TjyMkX54-SnXnva6vNXOhRZ6bg29MmIKt_2VLub10UgJAR6-asFmLdfpRYjbvr8kMT0SqDoVYfB-wjt3kdK6RwsSIcP9veA3/s1600/p%252F1272691745657.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 254px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXPc39duWEtAgGuUGCKj29eKjepto322nr8kUY6B_yAep0TjyMkX54-SnXnva6vNXOhRZ6bg29MmIKt_2VLub10UgJAR6-asFmLdfpRYjbvr8kMT0SqDoVYfB-wjt3kdK6RwsSIcP9veA3/s320/p%252F1272691745657.jpg" alt="" id="BLOGGER_PHOTO_ID_5466235659678989762" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;All 3D buttons and the calculator body are create by the function :-&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void button_3d(int x1,int y1,int x2,int y2,int check,char* text,int color)&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;The Complete Graphics Structure :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIn7JUYcyV6J0YtrJ74VEKoCQiqvTeiTzZkhWfh2Xsmt-qDrtJ4cKHm3lb1c6IlLKMjjSK4M6kcoQ4Z7ShkicYcBbaru-4pJq8NJ3hLyNK17LpaYltxPWJb0e5KW7CAJZv2FHS4vz1R9wD/s1600/p%252F1272709342545.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 254px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIn7JUYcyV6J0YtrJ74VEKoCQiqvTeiTzZkhWfh2Xsmt-qDrtJ4cKHm3lb1c6IlLKMjjSK4M6kcoQ4Z7ShkicYcBbaru-4pJq8NJ3hLyNK17LpaYltxPWJb0e5KW7CAJZv2FHS4vz1R9wD/s320/p%252F1272709342545.jpg" alt="" id="BLOGGER_PHOTO_ID_5466245210248649282" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;The complete graphics structure is done by the function :-&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;void structure();&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;The Graphics input  :&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;Taking user's  input in graphics mode is done by the function :-&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;char input();&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;The Arithmetical  Calculations is done by the function :-&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;double add(double x,double y,char ch);&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;The Trigonometrical   Calculations is done by the function :-&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;double  angle_conv(double no);&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;The Number Base Changes are  done by the function :-&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;void basecng(double y,double pnt1);&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;" align="justify"&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-size:180%;" &gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Here is the complete source code with comments :&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;#include stdio.h&lt;br /&gt;#include conio.h&lt;br /&gt;#include process.h&lt;br /&gt;#include dos.h&lt;br /&gt;#include stdlib.h&lt;br /&gt;#include graphics.h&lt;br /&gt;#include math.h&lt;br /&gt;#include string.h&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;float *mem;&lt;br /&gt;int X=0, Y=0;&lt;br /&gt;int row=17,col=5;&lt;br /&gt;char dummy;&lt;br /&gt;char flag='d',flagp='0';&lt;br /&gt;char bflag='u',bflagp='u';&lt;br /&gt;int mflag=0;&lt;br /&gt;char ch,ch1,ch2;&lt;br /&gt;int sflag=0;&lt;br /&gt;int midx,midy;&lt;br /&gt;# define UNCLICKED 0&lt;br /&gt;# define CLICKED 1&lt;br /&gt;# define PI 3.14159&lt;br /&gt;&lt;br /&gt;char str1[]={"Himadree Shekhar"};&lt;br /&gt;void typeit (int x,int y,int spacing,char string[])&lt;br /&gt;{&lt;br /&gt;char temp[2];&lt;br /&gt;for (int i=0;i&amp;lt;strlen(string);i++)&lt;br /&gt;{&lt;br /&gt;delay(100);&lt;br /&gt;temp[0]=string[i];&lt;br /&gt;temp[1]='\0';&lt;br /&gt;outtextxy(x+(i+1)*spacing,y,temp);&lt;br /&gt;}//endfor&lt;br /&gt;}&lt;br /&gt;void front()&lt;br /&gt;{&lt;br /&gt;int x,y,h;&lt;br /&gt;for(x=0;x&amp;lt;=100;x++)&lt;br /&gt;{&lt;br /&gt;settextjustify(CENTER_TEXT,CENTER_TEXT);&lt;br /&gt;setcolor(1);&lt;br /&gt;settextstyle(3,0,1);&lt;br /&gt;setusercharsize(x,6,x,3);&lt;br /&gt;/*&lt;br /&gt;moveto(int x, int y) function moves&lt;br /&gt;the current position (CP) to position (x, y).&lt;br /&gt;*/&lt;br /&gt;/*&lt;br /&gt;outtext(char far *textstring) function&lt;br /&gt;outputs textstring at the current position (CP)&lt;br /&gt;*/&lt;br /&gt;setcolor(4);&lt;br /&gt;moveto(335,140);&lt;br /&gt;outtext("--");&lt;br /&gt;if(x&amp;lt;50){&lt;br /&gt;delay(60);&lt;br /&gt;}&lt;br /&gt;else{&lt;br /&gt;delay(20);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;for(y=0;y&amp;lt;=100;y++)&lt;br /&gt;{&lt;br /&gt;if(y&amp;gt;30 &amp;amp;&amp;amp; y &amp;lt; 90){&lt;br /&gt;setcolor(2);&lt;br /&gt;settextstyle(1,0,4);&lt;br /&gt;setusercharsize(y,6,y,3);&lt;br /&gt;moveto(340,90);&lt;br /&gt;outtext("-");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(y&amp;gt;20)&lt;br /&gt;{&lt;br /&gt;settextstyle(7,0,3);&lt;br /&gt;/*&lt;br /&gt;setusercharsize(int multx, int divx, int multy, int divy);&lt;br /&gt;function gives you finer control over the size of text&lt;br /&gt;from stroked fonts used with graphics functions.&lt;br /&gt;*/&lt;br /&gt;setusercharsize(y-20,35,y-20,30);&lt;br /&gt;setcolor(15);&lt;br /&gt;outtext("CALCULATER");&lt;br /&gt;delay(15);&lt;br /&gt;if(y&amp;lt;100) // NESTED if block&lt;br /&gt;{&lt;br /&gt;settextstyle(7,0,3);&lt;br /&gt;setusercharsize(y-20,35,y-20,30);&lt;br /&gt;setcolor(0);&lt;br /&gt;outtext("CALCULATER");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;/*&lt;br /&gt;settextstyle(int font, int direction, int charsize)&lt;br /&gt;Sets the current text characteristics Like:-&lt;br /&gt;font, direction , character size&lt;br /&gt;*/&lt;br /&gt;settextstyle(1,0,2);&lt;br /&gt;//delay(50); is delaying the program execution for 50 ml.seconds&lt;br /&gt;delay(50);&lt;br /&gt;/*&lt;br /&gt;outtextxy() function is from #include&amp;lt;graphics.h&amp;gt;&lt;br /&gt;outtextxy(midx-200,midy,"By :-"); function displays&lt;br /&gt;the argument string "By :-" from&lt;br /&gt;starting cordinate (X,Y)= (midx-200,midy )&lt;br /&gt;*/&lt;br /&gt;/*&lt;br /&gt;outtextxy(int x, int y, char far *textstring);&lt;br /&gt;displays textstring at the position (x, y)&lt;br /&gt;*/&lt;br /&gt;outtextxy(midx-5,midy+100,"By");&lt;br /&gt;/*&lt;br /&gt;setcolor(int color); sets the current drawing color to color,&lt;br /&gt;which can range from 0 to 15.&lt;br /&gt;*/&lt;br /&gt;setcolor(2);&lt;br /&gt;settextstyle(0,0,1);&lt;br /&gt;typeit(midx-150,midy+140,15,str1);&lt;br /&gt;getch();&lt;br /&gt;} // END OF FUNCTION : front()&lt;br /&gt;char input();&lt;br /&gt;double add(double,double,char);&lt;br /&gt;double angle_conv(double);&lt;br /&gt;void basecng(double,double);&lt;br /&gt;/************************************************************/&lt;br /&gt;/* */&lt;br /&gt;/* THIS FUNCTION DRAWS THE BUTTONS OF THE CALCULATER */&lt;br /&gt;/* */&lt;br /&gt;/************************************************************/&lt;br /&gt;void button_3d(int x1,int y1,int x2,int y2,int check,char* text,int color)&lt;br /&gt;{&lt;br /&gt;int up,low;&lt;br /&gt;setfillstyle(1,7);&lt;br /&gt;/*&lt;br /&gt;bar(int left, int top, int right, int bottom) function&lt;br /&gt;draws a filled-in, rectangular, two-dimensional bar&lt;br /&gt;(left, top) is the top cordinate position of the one diametar&lt;br /&gt;of the rectangular bar&lt;br /&gt;(right, bottom) is the bottom cordinate position&lt;br /&gt;of the one diametar of the rectangular bar&lt;br /&gt;*/&lt;br /&gt;bar(x1,y1,x2,y2);&lt;br /&gt;if(check==0){ //Unclicked&lt;br /&gt;up=15,low=0;&lt;br /&gt;}&lt;br /&gt;else{&lt;br /&gt;up=0,low=15; //Clicked&lt;br /&gt;}&lt;br /&gt;setcolor(low);&lt;br /&gt;/*&lt;br /&gt;line(int x1, int y1, int x2, int y2)draws&lt;br /&gt;a line from (x1, y1) to (x2, y2) using&lt;br /&gt;the current color, linestyle, and thickness&lt;br /&gt;*/&lt;br /&gt;line(x2,y1,x2,y2);&lt;br /&gt;line(x2-1,y1,x2-1,y2);&lt;br /&gt;line(x1,y2,x2,y2);&lt;br /&gt;line(x1+1,y2-1,x2,y2-1);&lt;br /&gt;setcolor(up);&lt;br /&gt;line(x1,y1,x2,y1);&lt;br /&gt;line(x1+1,y1+1,x2-1,y1+1);&lt;br /&gt;line(x1,y1,x1,y2);&lt;br /&gt;line(x1+1,y1+1,x1+1,y2-1);&lt;br /&gt;setcolor(color);&lt;br /&gt;/*&lt;br /&gt;settextjustify(int horiz, int vert)Text output after&lt;br /&gt;a call to function settextjustify() is justified around the current&lt;br /&gt;position (CP) horizontally and vertically, as specified.&lt;br /&gt;*/&lt;br /&gt;settextjustify(CENTER_TEXT,CENTER_TEXT);&lt;br /&gt;outtextxy(x1+(x2 - x1)/2,(y1+(y2 - y1)/2)-2, text);&lt;br /&gt;}&lt;br /&gt;/*********************************************************************/&lt;br /&gt;/* */&lt;br /&gt;/* This function makes the opening screen */&lt;br /&gt;/* */&lt;br /&gt;/*********************************************************************/&lt;br /&gt;void frontpage(void)&lt;br /&gt;{&lt;br /&gt;int mx, my;&lt;br /&gt;mx = (getmaxx() / 2);&lt;br /&gt;my = (getmaxy() / 2);&lt;br /&gt;//SET baqckground color&lt;br /&gt;/*&lt;br /&gt;setfillstyle(int pattern, int color)function&lt;br /&gt;sets the current fill pattern and fill color&lt;br /&gt;*/&lt;br /&gt;setfillstyle(2, 8);&lt;br /&gt;bar(0,0,getmaxx(),getmaxy());&lt;br /&gt;//DRAW a bar, and make it look like a 3d bar&lt;br /&gt;setfillstyle(1,1);&lt;br /&gt;bar(50,20,600,400);&lt;br /&gt;//DRAW lines for the top and left side&lt;br /&gt;setcolor(15);&lt;br /&gt;line(50,20,600,20);&lt;br /&gt;line(51,21,599,21);&lt;br /&gt;line(50,20,50,400);&lt;br /&gt;line(51,21,51,399);&lt;br /&gt;//DRAW lines for the bottom and right side&lt;br /&gt;setcolor(8);&lt;br /&gt;line(600,20,600,400);&lt;br /&gt;line(599,21,599,400);&lt;br /&gt;line(50,400,600,400);&lt;br /&gt;line(51,399,600,399);&lt;br /&gt;//DRAW two 3D bars for the left and right side&lt;br /&gt;setfillstyle(4,2);&lt;br /&gt;bar(70,40,100,380);&lt;br /&gt;bar(545,40,575,380);&lt;br /&gt;setcolor(4);&lt;br /&gt;rectangle(70,40,100,380);&lt;br /&gt;rectangle(545,40,575,380);&lt;br /&gt;setcolor(15);&lt;br /&gt;line(100,40,100,380);&lt;br /&gt;line(70,380,100,380);&lt;br /&gt;line(575,40,575,380);&lt;br /&gt;line(545,380,575,380);&lt;br /&gt;//DRAW two 3D divider lines on both sides&lt;br /&gt;setcolor(2);&lt;br /&gt;line(110, 40, 110, 380);&lt;br /&gt;line(535, 40, 535, 380);&lt;br /&gt;setcolor(4);&lt;br /&gt;line(111, 40, 111, 380);&lt;br /&gt;line(536, 40, 536, 380);&lt;br /&gt;//PRINT 3D text CALENDAR 2002&lt;br /&gt;settextstyle(1, 0, 4);&lt;br /&gt;settextjustify(1,1);&lt;br /&gt;setcolor(15);&lt;br /&gt;outtextxy(mx+2, my - 46, "SCIENTIFIC CALCULATOR");&lt;br /&gt;setcolor(7);&lt;br /&gt;outtextxy(mx + 1, my - 45, "SCIENTIFIC CALCULATOR");&lt;br /&gt;setcolor(8);&lt;br /&gt;outtextxy(mx + 2, my - 44, "SCIENTIFIC CALCULATOR");&lt;br /&gt;//PRINT 3D text 2010&lt;br /&gt;setcolor(15);&lt;br /&gt;outtextxy(mx, my + 10, "2010");&lt;br /&gt;setcolor(7);&lt;br /&gt;outtextxy(mx + 1, my + 11, "2010");&lt;br /&gt;setcolor(8);&lt;br /&gt;outtextxy(mx + 2, my + 12, "2010");&lt;br /&gt;//PRINT copyright notice&lt;br /&gt;settextstyle(2, 0, 5);&lt;br /&gt;setcolor(15);&lt;br /&gt;outtextxy(mx + 1, my + 85, "Copyright 2010 by NSU Creations");&lt;br /&gt;getch(); //PAUSE for a while&lt;br /&gt;}&lt;br /&gt;/*********************************************************************/&lt;br /&gt;/* */&lt;br /&gt;/* This function makes the claculating screen */&lt;br /&gt;/* */&lt;br /&gt;/*********************************************************************/&lt;br /&gt;void screen(int x1, int y1, int x2, int y2)&lt;br /&gt;{&lt;br /&gt;setlinestyle(0,0,1);&lt;br /&gt;setfillstyle(SOLID_FILL, 8);&lt;br /&gt;bar(x1, y1, x2, y2);&lt;br /&gt;setfillstyle(SOLID_FILL, BLACK);&lt;br /&gt;bar(x1+1, y1+1, x2-1, y2-1);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;settextjustify(CENTER_TEXT, CENTER_TEXT);&lt;br /&gt;setcolor(15);&lt;br /&gt;line(x1+1, y1+1, x1+1, y2-1);&lt;br /&gt;line(x1+1, y1+1, x2-1, y1+1);&lt;br /&gt;line(x1+2, y1+2, x1+2, y2-2);&lt;br /&gt;line(x1+2, y1+2, x2-2, y1+2);&lt;br /&gt;setcolor(8);&lt;br /&gt;line(x1+1, y2-1, x2-1, y2-1);&lt;br /&gt;line(x2-1, y1+1, x2-1, y2-1);&lt;br /&gt;line(x1+2, y2-2, x2-2, y2-2);&lt;br /&gt;line(x2-2, y1+2, x2-2, y2-2);&lt;br /&gt;} // END OF FUNCTION : void screen(int x1, int y1, int x2, int y2)&lt;br /&gt;&lt;br /&gt;/************************************************************************/&lt;br /&gt;/* */&lt;br /&gt;/* Mouse Related Functions */&lt;br /&gt;/* */&lt;br /&gt;/************************************************************************/&lt;br /&gt;void init_mouse()&lt;br /&gt;{&lt;br /&gt;union REGS iregs, oregs;&lt;br /&gt;iregs.x.ax = 0;&lt;br /&gt;int86 (0x33, &amp;amp;iregs, &amp;amp;oregs);&lt;br /&gt;if (oregs.x.ax == 0)&lt;br /&gt;{&lt;br /&gt;cleardevice();&lt;br /&gt;printf("mouse not installed\n");&lt;br /&gt;getch();&lt;br /&gt;exit(1);&lt;br /&gt;}&lt;br /&gt;iregs.x.ax = 1;&lt;br /&gt;int86 (0x33, &amp;amp;iregs ,&amp;amp;oregs);&lt;br /&gt;}&lt;br /&gt;/*************************************************************/&lt;br /&gt;void mouse()&lt;br /&gt;{&lt;br /&gt;int button,x1,y1;&lt;br /&gt;union REGS iregs, oregs;&lt;br /&gt;iregs.x.ax = 3;&lt;br /&gt;int86 (0x33, &amp;amp;iregs ,&amp;amp;oregs);&lt;br /&gt;button = oregs.x.bx &amp;amp; 3;&lt;br /&gt;x1 = oregs.x.cx;&lt;br /&gt;y1 = oregs.x.dx;&lt;br /&gt;if(oregs.x.bx &amp;amp; 1)&lt;br /&gt;{&lt;br /&gt;X = x1 ; Y = y1;&lt;br /&gt;}&lt;br /&gt;if(button == 3)&lt;br /&gt;{&lt;br /&gt;/*&lt;br /&gt;exit(int status); function&lt;br /&gt;terminates the program&lt;br /&gt;*/&lt;br /&gt;exit(0);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*************************************************************/&lt;br /&gt;void hide_mouse()&lt;br /&gt;{&lt;br /&gt;union REGS ioRegs;&lt;br /&gt;ioRegs.x.ax=2;&lt;br /&gt;int86(0x33,&amp;amp;ioRegs,&amp;amp;ioRegs);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*************************************************************/&lt;br /&gt;void show_mouse()&lt;br /&gt;{&lt;br /&gt;union REGS ioRegs;&lt;br /&gt;ioRegs.x.ax=1;&lt;br /&gt;int86(0x33,&amp;amp;ioRegs,&amp;amp;ioRegs);&lt;br /&gt;}&lt;br /&gt;/*************************************************************/&lt;br /&gt;void remove_mouse()&lt;br /&gt;{&lt;br /&gt;union REGS ioRegs;&lt;br /&gt;ioRegs.x.ax=0;&lt;br /&gt;int86(0x33,&amp;amp;ioRegs,&amp;amp;ioRegs);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/*************************************************************************/&lt;br /&gt;/* */&lt;br /&gt;/* THIS FUNCTION DRAWS THE CALCULATER ON THE SCREEN */&lt;br /&gt;/* */&lt;br /&gt;/*************************************************************************/&lt;br /&gt;void structure()&lt;br /&gt;{&lt;br /&gt;init_mouse();&lt;br /&gt;/*&lt;br /&gt;setbkcolor(int color) function sets&lt;br /&gt;the background to the color specified by color.&lt;br /&gt;*/&lt;br /&gt;setbkcolor(0);&lt;br /&gt;/*&lt;br /&gt;cleardevice(void) function erases&lt;br /&gt;the entire graphics screen and moves&lt;br /&gt;the CP (current position) to home (0,0).&lt;br /&gt;*/&lt;br /&gt;cleardevice();&lt;br /&gt;hide_mouse();&lt;br /&gt;//**********************************************************&lt;br /&gt;// Buttons Making&lt;br /&gt;front();&lt;br /&gt;frontpage();&lt;br /&gt;settextstyle(2,0,4);&lt;br /&gt;button_3d(50,20,600,400,UNCLICKED,"",1); // main box&lt;br /&gt;screen(100,50,545,120); // screen&lt;br /&gt;&lt;br /&gt;setfillstyle(1,8);&lt;br /&gt;bar(52,22,598,42);&lt;br /&gt;button_3d(575,23,595,40,UNCLICKED,"x",0);&lt;br /&gt;setcolor(0);&lt;br /&gt;outtextxy(125,30,"Scientific Calculator 2010");&lt;br /&gt;button_3d(108,140,208,160,UNCLICKED,"DEC",15); // box of decimal&lt;br /&gt;button_3d(218,140,318,160,UNCLICKED,"OCT",0); // box of octal&lt;br /&gt;button_3d(328,140,428,160,UNCLICKED,"HEX",0); // box of hexal&lt;br /&gt;button_3d(438,140,538,160,UNCLICKED,"BIN",0); // box of binary&lt;br /&gt;button_3d(350,205,380,225,UNCLICKED,"7",0); // Box Of 7&lt;br /&gt;button_3d(390,205,420,225,UNCLICKED,"8",0); // Box Of 8&lt;br /&gt;button_3d(430,205,460,225,UNCLICKED,"9",0); // Box Of 9&lt;br /&gt;button_3d(350,230,380,250,UNCLICKED,"4",0); // Box Of 4&lt;br /&gt;button_3d(390,230,420,250,UNCLICKED,"5",0); // Box Of 5&lt;br /&gt;button_3d(430,230,460,250,UNCLICKED,"6",0); // Box Of 6&lt;br /&gt;button_3d(480,230,510,250,UNCLICKED,"*",0); // Box Of *&lt;br /&gt;button_3d(515,230,545,250,UNCLICKED,"/",0); // Box Of \&lt;br /&gt;button_3d(480,205,510,225,UNCLICKED,"AC",4); //Box Of AllClear (AC)&lt;br /&gt;button_3d(515,205,545,225,UNCLICKED,"CE",4); //Box Of Clear (C)&lt;br /&gt;button_3d(350,255,380,275,UNCLICKED,"1",0); // Box Of 1&lt;br /&gt;button_3d(390,255,420,275,UNCLICKED,"2",0); // Box Of 2&lt;br /&gt;button_3d(430,255,460,275,UNCLICKED,"3",0); // Box Of 3&lt;br /&gt;button_3d(350,280,380,300,UNCLICKED,"0",0); // Box Of Zero (0)&lt;br /&gt;button_3d(390,280,420,300,UNCLICKED,".",0); // Box Of Period (.)&lt;br /&gt;button_3d(430,280,460,300,UNCLICKED,"pi",0); // Box Of PhiFunction&lt;br /&gt;button_3d(480,255,510,275,UNCLICKED,"-",0); // Box Of -&lt;br /&gt;button_3d(515,255,545,275,UNCLICKED,"+",0); // Box Of +&lt;br /&gt;button_3d(350,305,460,325,UNCLICKED,"=",0); // Box Of Equality&lt;br /&gt;button_3d(480,305,545,325,UNCLICKED,"shift",BLUE); // Box Of shift&lt;br /&gt;button_3d(480,280,510,300,UNCLICKED,"sqrt",0); //Box of x^n&lt;br /&gt;button_3d(515,280,545,300,UNCLICKED,"inv",0); //box of 1/x&lt;br /&gt;button_3d(100,205,150,230,UNCLICKED,"Sin",0); // Box OfSin Function&lt;br /&gt;button_3d(160,205,210,230,UNCLICKED,"Cos",0); // Box Of CosFunction&lt;br /&gt;button_3d(220,205,270,230,UNCLICKED,"Tan",0); // Box Of Tan Function&lt;br /&gt;&lt;br /&gt;button_3d(100,250,150,275,UNCLICKED,"sin^-1",0); // Box Of sin^-1&lt;br /&gt;button_3d(160,250,210,275,UNCLICKED,"cos^-1",0); // Box Of cos^-1&lt;br /&gt;button_3d(220,250,270,275,UNCLICKED,"tan^-1",0); // Box Of tan^-1&lt;br /&gt;button_3d(100,300,150,325,UNCLICKED,"ln",0); // Box Of ln&lt;br /&gt;settextjustify(CENTER_TEXT,CENTER_TEXT);&lt;br /&gt;setcolor(BLUE);&lt;br /&gt;settextstyle(2,0,4);&lt;br /&gt;outtextxy(125,290,"e");&lt;br /&gt;outtextxy(185,290,"10^x");&lt;br /&gt;outtextxy(245,290,"x^3");&lt;br /&gt;button_3d(160,300,210,325,UNCLICKED,"log",0); // Box Of log&lt;br /&gt;button_3d(220,300,270,325,UNCLICKED,"x^2",0); // Box Of x^2&lt;br /&gt;button_3d(100,350,150,370,UNCLICKED,"deg",15);&lt;br /&gt;button_3d(160,350,210,370,UNCLICKED,"rad",0);&lt;br /&gt;button_3d(220,350,270,370,UNCLICKED,"gra",0);&lt;br /&gt;button_3d(480,350,545,370,UNCLICKED,"Off",4);&lt;br /&gt;&lt;br /&gt;button_3d(350,350,380,370,UNCLICKED,"M+",0);&lt;br /&gt;button_3d(390,350,420,370,UNCLICKED,"M-",0);&lt;br /&gt;button_3d(430,350,460,370,UNCLICKED,"MR",0);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;} // END OF FUNCTION void structure()&lt;br /&gt;/*********************************************************/&lt;br /&gt;/* */&lt;br /&gt;/* Main starts here */&lt;br /&gt;/* */&lt;br /&gt;/*********************************************************/&lt;br /&gt;void main()&lt;br /&gt;{&lt;br /&gt;clrscr();&lt;br /&gt;double y=0,z=0,pnt,pnt1=0,x=0,r=0;&lt;br /&gt;int gdriver = DETECT, gmode, errorcode;&lt;br /&gt;int i;&lt;br /&gt;// @@@@@@@@------very Important--------@@@@@@@&lt;br /&gt;/*&lt;br /&gt;********************************************************************&lt;br /&gt;To start the graphics system, you must first call initgraph.&lt;br /&gt;initgraph initializes the graphics system by loading&lt;br /&gt;a graphics driver from disk (or validating a registered driver)&lt;br /&gt;then putting the system into graphics mode.&lt;br /&gt;initgraph also resets all graphics settings (color, palette, current&lt;br /&gt;position, viewport, etc.) to their defaults.&lt;br /&gt;********************************************************************&lt;br /&gt;*/&lt;br /&gt;initgraph(&amp;amp;gdriver, &amp;amp;gmode, "C:\\TC\\BGI");&lt;br /&gt;midx=getmaxx()/2;midy=getmaxy()/2;&lt;br /&gt;structure();&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t\t");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("0");&lt;br /&gt;// @@@@@@@@------Important--------@@@@@@@&lt;br /&gt;mem=(float*)malloc(y*sizeof(float));&lt;br /&gt;while( ch!=27&amp;amp;&amp;amp;ch1!=27) //While Escape is not pressed&lt;br /&gt;{ //and if base is not 10&lt;br /&gt;pnt1=0;//no doubleing point entered Yet&lt;br /&gt;ch2='0';&lt;br /&gt;while(ch2!=27)&lt;br /&gt;//a=0 means that no no. has been entered yet&lt;br /&gt;{&lt;br /&gt;if(bflagp!='u')&lt;br /&gt;{&lt;br /&gt;dummy=input();&lt;br /&gt;if(dummy!='o')&lt;br /&gt;{&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("The trail version does not support this feature");&lt;br /&gt;input();&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t\t\t");&lt;br /&gt;}&lt;br /&gt;y=0;z=0;ch='0';&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t\t\t");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("0");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ch=input();&lt;br /&gt;if(ch=='&amp;gt;'||ch=='&amp;lt;'||ch=='?')&lt;br /&gt;{&lt;br /&gt;sflag=0;&lt;br /&gt;if(ch=='&amp;gt;'){ //M+&lt;br /&gt;*mem+=y;&lt;br /&gt;}&lt;br /&gt;if(ch=='&amp;lt;'){ //M-&lt;br /&gt;*mem-=y;&lt;br /&gt;}&lt;br /&gt;if(ch=='?') //MR&lt;br /&gt;{&lt;br /&gt;y=*mem;&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t\t\t");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",y);&lt;br /&gt;}&lt;br /&gt;if(*mem==0){&lt;br /&gt;mflag=0;&lt;br /&gt;}&lt;br /&gt;if(*mem!=0){&lt;br /&gt;mflag=1;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;if(mflag==0)&lt;br /&gt;{&lt;br /&gt;gotoxy(row,7);&lt;br /&gt;printf(" ");&lt;br /&gt;}&lt;br /&gt;if(mflag!=0)&lt;br /&gt;{&lt;br /&gt;gotoxy(row,7);&lt;br /&gt;printf("M");&lt;br /&gt;}&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;if(ch=='a')&lt;br /&gt;{ sflag=0;&lt;br /&gt;y=0;&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t\t");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("0");&lt;br /&gt;}&lt;br /&gt;if(ch=='o')&lt;br /&gt;//for clearing the screen of the calculater&lt;br /&gt;{&lt;br /&gt;sflag=0;&lt;br /&gt;y=0;z=0;&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("0");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;if(ch=='q')&lt;br /&gt;{&lt;br /&gt;sflag=0;&lt;br /&gt;y=sqrt(y);&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",y);&lt;br /&gt;}&lt;br /&gt;if(ch=='m')&lt;br /&gt;{&lt;br /&gt;sflag=0;&lt;br /&gt;y=1/y;&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",y);&lt;br /&gt;}&lt;br /&gt;if(ch=='+'||ch=='-'||ch=='/'||ch=='\\'||ch=='='||ch=='*')&lt;br /&gt;{&lt;br /&gt;sflag=0;&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;if(ch=='.') //case for a decimal point&lt;br /&gt;{&lt;br /&gt;sflag=0;&lt;br /&gt;if(pnt1==0) //ie no decimal has been entered yet&lt;br /&gt;{&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");// double&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g.",y);&lt;br /&gt;pnt1=.1; //ie: one decimal point no has been entered&lt;br /&gt;continue; //go back to the begining and get the next number&lt;br /&gt;}&lt;br /&gt;else //decimal point has alredy been entered and thus no change in the screen&lt;br /&gt;{&lt;br /&gt;sflag=0;&lt;br /&gt;continue; //go back to the begining&lt;br /&gt;}&lt;br /&gt;}//out of the '.' condition&lt;br /&gt;if(pnt1!=0) //ie we have a doubleing point&lt;br /&gt;{ sflag=0;&lt;br /&gt;if(ch&amp;lt;='9'&amp;amp;&amp;amp;ch&amp;gt;='0') //input integer&lt;br /&gt;{&lt;br /&gt;x=(double)ch;//type cast the character into double to perforn further&lt;br /&gt;operations&lt;br /&gt;x-=48; //since character digit indoubleing -48 gives the corresponding ASCII&lt;br /&gt;x=x*pnt1; //make it a decimal&lt;br /&gt;y=x+y; //add it in result&lt;br /&gt;pnt1*=.1; //shift to the second doubleing point&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",y);&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;continue; //back to the top&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;//if no decimal point number then proceed&lt;br /&gt;if(ch&amp;lt;='9'&amp;amp;&amp;amp;ch&amp;gt;='0')&lt;br /&gt;{ sflag=0;&lt;br /&gt;x=(double)ch; //typecast to double&lt;br /&gt;x-=48; //get corresponding ASCII&lt;br /&gt;y=(y*10)+x; //add to right of result&lt;br /&gt;gotoxy(row,col); //go back to start of the calc screen&lt;br /&gt;printf("\t\t\t\t "); //clear the screen&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",y); //print the number&lt;br /&gt;}&lt;br /&gt;if(ch=='u'||ch=='v'||ch=='w'||ch=='x')&lt;br /&gt;{ sflag=0;&lt;br /&gt;if(bflagp==bflag&amp;amp;&amp;amp;bflag=='u')&lt;br /&gt;{&lt;br /&gt;continue;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;basecng(y,pnt1);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;if(ch=='d'||ch=='r'||ch=='g')&lt;br /&gt;{&lt;br /&gt;sflag=0;&lt;br /&gt;y=angle_conv(y);&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",y);&lt;br /&gt;}&lt;br /&gt;if(ch=='s'||ch=='c'||ch=='t'||ch=='i'||ch=='j'||ch=='k'||ch=='n'||ch=='l'||ch=='p'||ch=='h')&lt;br /&gt;//ie the user opted for a function&lt;br /&gt;{&lt;br /&gt;if(ch=='s'||ch=='c'||ch=='t') //sin /cos/tan&lt;br /&gt;{&lt;br /&gt;sflag=0;&lt;br /&gt;if(flag!='r')&lt;br /&gt;{&lt;br /&gt;flagp=flag;&lt;br /&gt;flag='r';&lt;br /&gt;y=angle_conv(y);&lt;br /&gt;flag=flagp;&lt;br /&gt;}&lt;br /&gt;switch(ch)&lt;br /&gt;{&lt;br /&gt;case 's': y=sin(y); break;&lt;br /&gt;case 'c': y=cos(y); break;&lt;br /&gt;case 't': y=tan(y); break;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;if(ch=='i'||ch=='j'||ch=='k')&lt;br /&gt;{&lt;br /&gt;sflag=0;&lt;br /&gt;if(flag!='r')&lt;br /&gt;{&lt;br /&gt;flagp='r';&lt;br /&gt;}&lt;br /&gt;switch(ch)&lt;br /&gt;{&lt;br /&gt;case 'i': y=asin(y); break;&lt;br /&gt;case 'j': y=acos(y); break;&lt;br /&gt;case 'k': y=atan(y); break;&lt;br /&gt;}&lt;br /&gt;if(flag!='r')&lt;br /&gt;{&lt;br /&gt;y=angle_conv(y);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;else if(ch=='n')&lt;br /&gt;{&lt;br /&gt;if(sflag==1)&lt;br /&gt;{&lt;br /&gt;y=exp(y);&lt;br /&gt;sflag=0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;y=log(y); //ln&lt;br /&gt;}&lt;br /&gt;else if(ch=='l')&lt;br /&gt;{&lt;br /&gt;if(sflag==1)&lt;br /&gt;{&lt;br /&gt;y=pow(10,y);&lt;br /&gt;sflag=0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;y=log10(y); //log&lt;br /&gt;}&lt;br /&gt;else if(ch=='p')&lt;br /&gt;{&lt;br /&gt;if(sflag==1)&lt;br /&gt;{&lt;br /&gt;y=pow(y,3);&lt;br /&gt;sflag=0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;y=pow(y,2); //square&lt;br /&gt;}&lt;br /&gt;else if(ch=='h')&lt;br /&gt;{&lt;br /&gt;sflag=0;&lt;br /&gt;y=PI; //pi&lt;br /&gt;}&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");//Clear the screen&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",y);&lt;br /&gt;}//else condition&lt;br /&gt;}//out of second condition ie we now have the first no. or function or&lt;br /&gt;operater&lt;br /&gt;for(;ch!=27&amp;amp;&amp;amp;ch1!='='&amp;amp;&amp;amp;ch!='=';)//ie the characters input are not ESCAPE or&lt;br /&gt;Equal to&lt;br /&gt;{&lt;br /&gt;pnt1=0;z=0;&lt;br /&gt;if(ch=='o'||ch1=='o') // For Clear The Screen&lt;br /&gt;{&lt;br /&gt;sflag=0;&lt;br /&gt;y=0;z=0;&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("0");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;for(;ch1!=27;)&lt;br /&gt;{&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;ch1=input();&lt;br /&gt;if(ch1=='&amp;gt;'||ch1=='&amp;lt;'||ch1=='?')&lt;br /&gt;{&lt;br /&gt;if(ch1=='&amp;gt;') //M+&lt;br /&gt;*mem+=z;&lt;br /&gt;if(ch1=='&amp;lt;') //M-&lt;br /&gt;*mem-=z;&lt;br /&gt;if(ch1=='?') //MR&lt;br /&gt;{&lt;br /&gt;z=*mem;&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",z);&lt;br /&gt;}&lt;br /&gt;if(*mem==0)&lt;br /&gt;mflag=0;&lt;br /&gt;if(*mem!=0)&lt;br /&gt;mflag=1;&lt;br /&gt;}&lt;br /&gt;if(mflag==0)&lt;br /&gt;{&lt;br /&gt;gotoxy(row,7);&lt;br /&gt;printf(" ");&lt;br /&gt;}&lt;br /&gt;if(mflag!=0)&lt;br /&gt;{&lt;br /&gt;gotoxy(row,7);&lt;br /&gt;printf("M");&lt;br /&gt;}&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;&lt;br /&gt;if(ch1=='a')&lt;br /&gt;{&lt;br /&gt;z=0;&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("0");&lt;br /&gt;}&lt;br /&gt;if(ch=='o'||ch1=='o') // For Clear The Screen&lt;br /&gt;{&lt;br /&gt;y=0;z=0;&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("0");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;if(ch1=='q')&lt;br /&gt;{&lt;br /&gt;z=sqrt(z);&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",z);&lt;br /&gt;}&lt;br /&gt;if(ch1=='m')&lt;br /&gt;{&lt;br /&gt;z=1/z;&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",z);&lt;br /&gt;}&lt;br /&gt;if(ch1=='.')&lt;br /&gt;{&lt;br /&gt;if(pnt1==0)&lt;br /&gt;{&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g.",z);&lt;br /&gt;pnt1=.1;&lt;br /&gt;continue;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;continue;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;if(pnt1!=0)&lt;br /&gt;{&lt;br /&gt;if(ch1&amp;lt;='9'&amp;amp;&amp;amp;ch1&amp;gt;='0')&lt;br /&gt;{&lt;br /&gt;x=(double)ch1;&lt;br /&gt;x-=48;&lt;br /&gt;x=x*pnt1;&lt;br /&gt;z=x+z;&lt;br /&gt;pnt1=pnt1*.1;&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",z);&lt;br /&gt;continue;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;if(ch1=='+'||ch1=='-'||ch1=='*'||ch1=='/'||ch1=='=')&lt;br /&gt;break;&lt;br /&gt;if(ch1&amp;gt;='0'&amp;amp;&amp;amp;ch1&amp;lt;='9')&lt;br /&gt;{&lt;br /&gt;x=(double)ch1;&lt;br /&gt;x=x-48;&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;z=(z*10)+x;&lt;br /&gt;printf("%g",z);&lt;br /&gt;}&lt;br /&gt;if(ch=='u')&lt;br /&gt;if(ch=='d'||ch=='r'||ch=='g')&lt;br /&gt;{&lt;br /&gt;z=angle_conv(z);&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",z);&lt;br /&gt;}&lt;br /&gt;if(ch1=='s'||ch1=='c'||ch1=='t'||ch1=='i'||ch1=='j'||ch1=='k'||ch1=='n'||ch1=='l'||ch1=='p'||ch1=='h')&lt;br /&gt;//ie the user opted for a function&lt;br /&gt;{&lt;br /&gt;if(ch1=='s'||ch1=='c'||ch1=='t') //sin&lt;br /&gt;{&lt;br /&gt;if(flag!='r')&lt;br /&gt;{&lt;br /&gt;flagp=flag;&lt;br /&gt;flag='r';&lt;br /&gt;angle_conv(z);&lt;br /&gt;flag=flagp;&lt;br /&gt;}&lt;br /&gt;switch(ch1)&lt;br /&gt;{&lt;br /&gt;case 's': z=sin(z); break;&lt;br /&gt;case 'c': z=cos(z); break;&lt;br /&gt;case 't': z=tan(z); break;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;if(ch1=='i'||ch1=='j'||ch1=='k')&lt;br /&gt;{&lt;br /&gt;if(flag!='r')&lt;br /&gt;{&lt;br /&gt;flagp='r';&lt;br /&gt;}&lt;br /&gt;switch(ch1)&lt;br /&gt;{&lt;br /&gt;case 'i': z=asin(z); break;&lt;br /&gt;case 'j': z=acos(z); break;&lt;br /&gt;case 'k': z=atan(z); break;&lt;br /&gt;}&lt;br /&gt;z=angle_conv(z);&lt;br /&gt;}&lt;br /&gt;else if(ch1=='l')&lt;br /&gt;{&lt;br /&gt;z=log10(z); //log&lt;br /&gt;}&lt;br /&gt;else if(ch1=='p')&lt;br /&gt;{&lt;br /&gt;z=pow(z,2); //square&lt;br /&gt;}&lt;br /&gt;else if(ch1=='h')&lt;br /&gt;{&lt;br /&gt;z=PI; //pi&lt;br /&gt;}&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",z);&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;if(ch1=='+'||ch1=='-'||ch1=='=')&lt;br /&gt;{&lt;br /&gt;y=add(y,z,ch);&lt;br /&gt;if(ch2!='0')&lt;br /&gt;{&lt;br /&gt;y=add(r,y,ch2);&lt;br /&gt;ch2='0';&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;if(ch=='*'||ch=='/')&lt;br /&gt;y=add(y,z,ch);&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;ch2=ch;&lt;br /&gt;r=y;&lt;br /&gt;y=z;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",y);&lt;br /&gt;ch=ch1;&lt;br /&gt;ch1='0';&lt;br /&gt;if(ch=='='||ch1=='=')&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;if(ch=='o'||ch1=='o') // For Clear The Screen&lt;br /&gt;{ y=0;z=0;&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("0");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;continue;&lt;br /&gt;}&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%g",y);&lt;br /&gt;z=0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;closegraph();&lt;br /&gt;remove_mouse();&lt;br /&gt;exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*************************************************************/&lt;br /&gt;/* */&lt;br /&gt;/* This function gets the user's Input */&lt;br /&gt;/* */&lt;br /&gt;/*************************************************************/&lt;br /&gt;char input()&lt;br /&gt;{&lt;br /&gt;X=0;Y=0;&lt;br /&gt;char ch;&lt;br /&gt;show_mouse();&lt;br /&gt;if(bflag!='u')&lt;br /&gt;{&lt;br /&gt;button_3d(108,140,208,160,UNCLICKED,"DEC",15);&lt;br /&gt;button_3d(218,140,318,160,UNCLICKED,"OCT",0);&lt;br /&gt;button_3d(328,140,428,160,UNCLICKED,"HEX",0);&lt;br /&gt;button_3d(438,140,538,160,UNCLICKED,"BIN",0);&lt;br /&gt;bflag='u';&lt;br /&gt;}&lt;br /&gt;do&lt;br /&gt;{&lt;br /&gt;mouse();&lt;br /&gt;if (X&amp;gt;=350 &amp;amp;&amp;amp; X&amp;lt;=380 &amp;amp;&amp;amp; Y&amp;gt;=205 &amp;amp;&amp;amp; Y&amp;lt;=225) // Condition For 7&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(350,205,380,225,CLICKED,"7",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(350,205,380,225,UNCLICKED,"7",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='7';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//**********************************************&lt;br /&gt;if (X&amp;gt;=390 &amp;amp;&amp;amp; X&amp;lt;=420 &amp;amp;&amp;amp; Y&amp;gt;=205 &amp;amp;&amp;amp; Y&amp;lt;=225) // Condition For 8&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(390,205,420,225,CLICKED,"8",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(390,205,420,225,UNCLICKED,"8",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='8';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//*****************************************&lt;br /&gt;if (X&amp;gt;=430 &amp;amp;&amp;amp; X&amp;lt;=460 &amp;amp;&amp;amp; Y&amp;gt;=205 &amp;amp;&amp;amp; Y&amp;lt;=225) // Condition For 9&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(430,205,460,225,CLICKED,"9",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(430,205,460,225,UNCLICKED,"9",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='9';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//***********************************&lt;br /&gt;if (X&amp;gt;=350 &amp;amp;&amp;amp; X&amp;lt;=380 &amp;amp;&amp;amp; Y&amp;gt;=230 &amp;amp;&amp;amp; Y&amp;lt;=250) // Condition For 4&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(350,230,380,250,CLICKED,"4",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(350,230,380,250,UNCLICKED,"4",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='4';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//***********************************&lt;br /&gt;if (X&amp;gt;=390 &amp;amp;&amp;amp; X&amp;lt;=420 &amp;amp;&amp;amp; Y&amp;gt;=230 &amp;amp;&amp;amp; Y&amp;lt;=250) // Condition For 5&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(390,230,420,250,CLICKED,"5",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(390,230,420,250,UNCLICKED,"5",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='5';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//***********************************&lt;br /&gt;if (X&amp;gt;=430 &amp;amp;&amp;amp; X&amp;lt;=460 &amp;amp;&amp;amp; Y&amp;gt;=230 &amp;amp;&amp;amp; Y&amp;lt;=250) // Condition For 6&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(430,230,460,250,CLICKED,"6",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(430,230,460,250,UNCLICKED,"6",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='6';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//***********************************&lt;br /&gt;if (X&amp;gt;=480 &amp;amp;&amp;amp; X&amp;lt;=510 &amp;amp;&amp;amp; Y&amp;gt;=230 &amp;amp;&amp;amp; Y&amp;lt;=250) // Condition For *&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(480,230,510,250,CLICKED,"*",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(480,230,510,250,UNCLICKED,"*",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='*';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//***********************************&lt;br /&gt;if (X&amp;gt;=515 &amp;amp;&amp;amp; X&amp;lt;=545 &amp;amp;&amp;amp; Y&amp;gt;=230 &amp;amp;&amp;amp; Y&amp;lt;=250) // Condition For /&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(515,230,545,250,CLICKED,"/",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(515,230,545,250,UNCLICKED,"/",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='/';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//***********************************&lt;br /&gt;int a,b;&lt;br /&gt;if (X&amp;gt;=350 &amp;amp;&amp;amp; X&amp;lt;=380 &amp;amp;&amp;amp; Y&amp;gt;=255 &amp;amp;&amp;amp; Y&amp;lt;=275) // Condition For 1&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(350,255,380,275,CLICKED,"1",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(350,255,380,275,UNCLICKED,"1",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='1';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;// *************************************&lt;br /&gt;if (X&amp;gt;=390 &amp;amp;&amp;amp; X&amp;lt;=420 &amp;amp;&amp;amp; Y&amp;gt;=255 &amp;amp;&amp;amp; Y&amp;lt;=275) // Condition For 2&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(390,255,420,275,CLICKED,"2",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(390,255,420,275,UNCLICKED,"2",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='2';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;// *************************************&lt;br /&gt;if (X&amp;gt;=430 &amp;amp;&amp;amp; X&amp;lt;=460 &amp;amp;&amp;amp; Y&amp;gt;=255 &amp;amp;&amp;amp; Y&amp;lt;=275) // Condition For 3&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(430,255,460,275,CLICKED,"3",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(430,255,460,275,UNCLICKED,"3",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='3';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;// *************************************&lt;br /&gt;if (X&amp;gt;=350 &amp;amp;&amp;amp; X&amp;lt;=380 &amp;amp;&amp;amp; Y&amp;gt;=280 &amp;amp;&amp;amp; Y&amp;lt;=300) // Condition For 0&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(350,280,380,300,CLICKED,"0",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(350,280,380,300,UNCLICKED,"0",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='0';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;// *************************************&lt;br /&gt;if (X&amp;gt;=390 &amp;amp;&amp;amp; X&amp;lt;=420 &amp;amp;&amp;amp; Y&amp;gt;=280 &amp;amp;&amp;amp; Y&amp;lt;=300) // Condition For .&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(390,280,420,300,CLICKED,".",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(390,280,420,300,UNCLICKED,".",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='.';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//**********************************************&lt;br /&gt;if (X&amp;gt;=430 &amp;amp;&amp;amp; X&amp;lt;=460 &amp;amp;&amp;amp; Y&amp;gt;=280 &amp;amp;&amp;amp; Y&amp;lt;=300) // Condition For pi&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(430,280,460,300,CLICKED,"pi",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(430,280,460,300,UNCLICKED,"pi",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='h';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//***********************************************&lt;br /&gt;if (X&amp;gt;=480 &amp;amp;&amp;amp; X&amp;lt;=510 &amp;amp;&amp;amp; Y&amp;gt;=255 &amp;amp;&amp;amp; Y&amp;lt;=275) // Condition For -&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(480,255,510,275,CLICKED,"-",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(480,255,510,275,UNCLICKED,"-",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='-';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//**************************************************&lt;br /&gt;if (X&amp;gt;=515 &amp;amp;&amp;amp; X&amp;lt;=545 &amp;amp;&amp;amp; Y&amp;gt;=255 &amp;amp;&amp;amp; Y&amp;lt;=275) // Condition For +&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(515,255,545,275,CLICKED,"+",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(515,255,545,275,UNCLICKED,"+",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='+';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//*****************************************************&lt;br /&gt;if (X&amp;gt;=350 &amp;amp;&amp;amp; X&amp;lt;=460 &amp;amp;&amp;amp; Y&amp;gt;=305 &amp;amp;&amp;amp; Y&amp;lt;=325) // Condition For =&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(350,305,460,325,CLICKED,"=",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(350,305,460,325,UNCLICKED,"=",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='=';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//*****************************************************&lt;br /&gt;if (X&amp;gt;=480 &amp;amp;&amp;amp; X&amp;lt;=545 &amp;amp;&amp;amp; Y&amp;gt;=305 &amp;amp;&amp;amp; Y&amp;lt;=325) // Condition For shift&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(480,305,545,325,CLICKED,"shift",BLUE);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(480,305,545,325,UNCLICKED,"shift",BLUE);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='~';&lt;br /&gt;sflag=1;&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//*************************************&lt;br /&gt;if (X&amp;gt;=480 &amp;amp;&amp;amp; X&amp;lt;=510 &amp;amp;&amp;amp; Y&amp;gt;=205 &amp;amp;&amp;amp; Y&amp;lt;=225) // Condition For AC&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(480,205,510,225,CLICKED,"AC",4);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(480,205,510,225,UNCLICKED,"AC",4);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='o';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;/********************C*/&lt;br /&gt;if (X&amp;gt;=515 &amp;amp;&amp;amp; X&amp;lt;=545 &amp;amp;&amp;amp; Y&amp;gt;=205 &amp;amp;&amp;amp; Y&amp;lt;=225) // Condition For C&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(515,205,545,225,CLICKED,"CE",4);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(515,205,545,225,UNCLICKED,"CE",4);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='a';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;// ****************************************&lt;br /&gt;if (X&amp;gt;=100 &amp;amp;&amp;amp; X&amp;lt;=150 &amp;amp;&amp;amp; Y&amp;gt;=205 &amp;amp;&amp;amp; Y&amp;lt;=230) // Condition For Sin&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(100,205,150,230,CLICKED,"Sin",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(100,205,150,230,UNCLICKED,"Sin",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='s';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//***********************************&lt;br /&gt;if (X&amp;gt;=160 &amp;amp;&amp;amp; X&amp;lt;=210 &amp;amp;&amp;amp; Y&amp;gt;=205 &amp;amp;&amp;amp; Y&amp;lt;=230) // Condition For Cos&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(160,205,210,230,CLICKED,"Cos",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(160,205,210,230,UNCLICKED,"Cos",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='c';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//***********************************&lt;br /&gt;if(X&amp;gt;=515&amp;amp;&amp;amp;X&amp;lt;=545&amp;amp;&amp;amp;Y&amp;gt;=280&amp;amp;&amp;amp;Y&amp;lt;=300) //inverse&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(515,280,545,300,CLICKED,"inv",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(515,280,545,300,UNCLICKED,"inv",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='m';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (X&amp;gt;=220 &amp;amp;&amp;amp; X&amp;lt;=270 &amp;amp;&amp;amp; Y&amp;gt;=205 &amp;amp;&amp;amp; Y&amp;lt;=230) // Condition For Tan&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(220,205,270,230,CLICKED,"Tan",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(220,205,270,230,UNCLICKED,"Tan",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='t';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//*********************************** */&lt;br /&gt;&lt;br /&gt;if (X&amp;gt;=100 &amp;amp;&amp;amp; X&amp;lt;=150 &amp;amp;&amp;amp; Y&amp;gt;=250 &amp;amp;&amp;amp; Y&amp;lt;=275) // Condition For sin^-1&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(100,250,150,275,CLICKED,"sin^-1",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(150);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(100,250,150,275,UNCLICKED,"sin^-1",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='i';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//**************************&lt;br /&gt;if (X&amp;gt;=160 &amp;amp;&amp;amp; X&amp;lt;=210 &amp;amp;&amp;amp; Y&amp;gt;=250 &amp;amp;&amp;amp; Y&amp;lt;=275) // Condition For cos^-1&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(160,250,210,275,CLICKED,"cos^-1",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(160,250,210,275,UNCLICKED,"cos^-1",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='j';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//**************************&lt;br /&gt;if (X&amp;gt;=430 &amp;amp;&amp;amp; X&amp;lt;=460 &amp;amp;&amp;amp; Y&amp;gt;=350 &amp;amp;&amp;amp; Y&amp;lt;=370) // Condition For MR&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(430,350,460,370,CLICKED,"MR",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(430,350,460,370,UNCLICKED,"MR",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='?';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;if (X&amp;gt;=390 &amp;amp;&amp;amp; X&amp;lt;=420 &amp;amp;&amp;amp; Y&amp;gt;=350 &amp;amp;&amp;amp; Y&amp;lt;=370) // Condition For M-&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(390,350,420,370,CLICKED,"M-",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(390,350,420,370,UNCLICKED,"M-",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='&amp;lt;';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;if (X&amp;gt;=350 &amp;amp;&amp;amp; X&amp;lt;=380 &amp;amp;&amp;amp; Y&amp;gt;=350 &amp;amp;&amp;amp; Y&amp;lt;=370) // Condition For M+&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(350,350,380,370,CLICKED,"M+",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(350,350,380,370,UNCLICKED,"M+",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='&amp;gt;';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;if (X&amp;gt;=220 &amp;amp;&amp;amp; X&amp;lt;=270 &amp;amp;&amp;amp; Y&amp;gt;=250 &amp;amp;&amp;amp; Y&amp;lt;=275) // Condition For tan^-1&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(220,250,270,275,CLICKED,"tan^-1",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(220,250,270,275,UNCLICKED,"tan^-1",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='k';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//**************************&lt;br /&gt;&lt;br /&gt;if (X&amp;gt;=100 &amp;amp;&amp;amp; X&amp;lt;=150 &amp;amp;&amp;amp; Y&amp;gt;=300 &amp;amp;&amp;amp; Y&amp;lt;=325) // Condition For ln&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(100,300,150,325,CLICKED,"ln",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(100,300,150,325,UNCLICKED,"ln",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='n';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//**************************&lt;br /&gt;if (X&amp;gt;=160 &amp;amp;&amp;amp; X&amp;lt;=210 &amp;amp;&amp;amp; Y&amp;gt;=300 &amp;amp;&amp;amp; Y&amp;lt;=325) // Condition For log&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(160,300,210,325,CLICKED,"log",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(150);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(160,300,210,325,UNCLICKED,"log",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='l';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;//**************************&lt;br /&gt;if (X&amp;gt;=220 &amp;amp;&amp;amp; X&amp;lt;=270 &amp;amp;&amp;amp; Y&amp;gt;=300 &amp;amp;&amp;amp; Y&amp;lt;=325) // Condition For X^2&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(220,300,270,325,CLICKED,"x^2",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(220,300,270,325,UNCLICKED,"x^2",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='p';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;if (X&amp;gt;=100 &amp;amp;&amp;amp; X&amp;lt;=150 &amp;amp;&amp;amp; Y&amp;gt;=350 &amp;amp;&amp;amp; Y&amp;lt;=370) // Condition For deg&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(100,350,150,370,CLICKED,"deg",15);&lt;br /&gt;button_3d(160,350,210,370,UNCLICKED,"rad",0);&lt;br /&gt;button_3d(220,350,270,370,UNCLICKED,"gra",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(100,350,150,370,UNCLICKED,"deg",15);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='d';&lt;br /&gt;flagp=flag;&lt;br /&gt;flag=ch;&lt;br /&gt;return ch;&lt;br /&gt;} //**************************&lt;br /&gt;if (X&amp;gt;=160 &amp;amp;&amp;amp; X&amp;lt;=210 &amp;amp;&amp;amp; Y&amp;gt;=350 &amp;amp;&amp;amp; Y&amp;lt;=370) // Condition For rad&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(100,350,150,370,UNCLICKED,"deg",0);&lt;br /&gt;button_3d(160,350,210,370,CLICKED,"rad",15);&lt;br /&gt;button_3d(220,350,270,370,UNCLICKED,"gra",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(160,350,210,370,UNCLICKED,"rad",15);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='r';&lt;br /&gt;flagp=flag;&lt;br /&gt;flag=ch;&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;if (X&amp;gt;=220 &amp;amp;&amp;amp; X&amp;lt;=270 &amp;amp;&amp;amp; Y&amp;gt;=350 &amp;amp;&amp;amp; Y&amp;lt;=370) // Condition For gra&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(100,350,150,370,UNCLICKED,"deg",0);&lt;br /&gt;button_3d(160,350,210,370,UNCLICKED,"rad",0);&lt;br /&gt;button_3d(220,350,270,370,CLICKED,"gra",15);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(220,350,270,370,UNCLICKED,"gra",15);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='g';&lt;br /&gt;flagp=flag;&lt;br /&gt;flag=ch;&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;if ((X&amp;gt;=480 &amp;amp;&amp;amp; X&amp;lt;=545 &amp;amp;&amp;amp;Y&amp;gt;=350 &amp;amp;&amp;amp;Y &amp;lt;=370)||(X&amp;gt;=575&amp;amp;&amp;amp;X&amp;lt;=595&amp;amp;&amp;amp;Y&amp;gt;=23&amp;amp;&amp;amp;Y&amp;lt;=40))&lt;br /&gt;//OFF&lt;br /&gt;{&lt;br /&gt;free(mem);&lt;br /&gt;exit(0);&lt;br /&gt;}&lt;br /&gt;if (X&amp;gt;=108 &amp;amp;&amp;amp; X&amp;lt;=208 &amp;amp;&amp;amp; Y&amp;gt;=140 &amp;amp;&amp;amp; Y&amp;lt;=160) // Condition For dec&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(108,140,208,160,CLICKED,"DEC",15);&lt;br /&gt;button_3d(218,140,318,160,UNCLICKED,"OCT",0);&lt;br /&gt;button_3d(328,140,428,160,UNCLICKED,"HEX",0);&lt;br /&gt;button_3d(438,140,538,160,UNCLICKED,"BIN",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(108,140,208,160,UNCLICKED,"DEC",15);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='u';&lt;br /&gt;bflagp=bflag;&lt;br /&gt;bflag=ch;&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;if (X&amp;gt;=218 &amp;amp;&amp;amp; X&amp;lt;=318 &amp;amp;&amp;amp; Y&amp;gt;=140 &amp;amp;&amp;amp; Y&amp;lt;=160) // Condition For oct&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(108,140,208,160,UNCLICKED,"DEC",0);&lt;br /&gt;button_3d(218,140,318,160,CLICKED,"OCT",15);&lt;br /&gt;button_3d(328,140,428,160,UNCLICKED,"HEX",0);&lt;br /&gt;button_3d(438,140,538,160,UNCLICKED,"BIN",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(218,140,318,160,UNCLICKED,"OCT",15);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='v';&lt;br /&gt;bflagp=bflag;&lt;br /&gt;bflag=ch;&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;if (X&amp;gt;=328 &amp;amp;&amp;amp; X&amp;lt;=428 &amp;amp;&amp;amp; Y&amp;gt;=140 &amp;amp;&amp;amp; Y&amp;lt;=160) // Condition For hex&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(108,140,208,160,UNCLICKED,"DEC",0);&lt;br /&gt;button_3d(218,140,318,160,UNCLICKED,"OCT",0);&lt;br /&gt;button_3d(328,140,428,160,CLICKED,"HEX",15);&lt;br /&gt;button_3d(438,140,538,160,UNCLICKED,"BIN",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(328,140,428,160,UNCLICKED,"HEX",15);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='w';&lt;br /&gt;bflagp=bflag;&lt;br /&gt;bflag=ch;&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;if (X&amp;gt;=438 &amp;amp;&amp;amp; X&amp;lt;=538 &amp;amp;&amp;amp; Y&amp;gt;=140 &amp;amp;&amp;amp; Y&amp;lt;=160) // Condition For dec&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(108,140,208,160,UNCLICKED,"DEC",0);&lt;br /&gt;button_3d(218,140,318,160,UNCLICKED,"OCT",0);&lt;br /&gt;button_3d(328,140,428,160,UNCLICKED,"HEX",0);&lt;br /&gt;button_3d(438,140,538,160,CLICKED,"BIN",15);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(438,140,538,160,UNCLICKED,"BIN",15);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='x';&lt;br /&gt;bflagp=bflag;&lt;br /&gt;bflag=ch;&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;if(X&amp;gt;=480&amp;amp;&amp;amp;X&amp;lt;=510&amp;amp;&amp;amp;Y&amp;gt;=280&amp;amp;&amp;amp;Y&amp;lt;=300)&lt;br /&gt;{&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(480,280,510,300,CLICKED,"sqrt",0);&lt;br /&gt;show_mouse();&lt;br /&gt;delay(250);&lt;br /&gt;hide_mouse();&lt;br /&gt;button_3d(480,280,510,300,UNCLICKED,"sqrt",0);&lt;br /&gt;show_mouse();&lt;br /&gt;ch='q';&lt;br /&gt;return ch;&lt;br /&gt;}&lt;br /&gt;/*&lt;br /&gt;kbhit(void) function checks to see&lt;br /&gt;if any key is currently pressed by the user&lt;br /&gt;*/&lt;br /&gt;}while(kbhit() == 0);&lt;br /&gt;ch=getch();&lt;br /&gt;return ch;&lt;br /&gt;} //END OF FUNCTION char input()&lt;br /&gt;/*************************************************************************/&lt;br /&gt;/* */&lt;br /&gt;/* This function performs the Calculations */&lt;br /&gt;/* */&lt;br /&gt;/*************************************************************************/&lt;br /&gt;double add(double x,double y,char ch)&lt;br /&gt;{&lt;br /&gt;switch(ch)&lt;br /&gt;{&lt;br /&gt;case '+':&lt;br /&gt;y=x+y;&lt;br /&gt;break;&lt;br /&gt;case '-':&lt;br /&gt;y=x-y;&lt;br /&gt;break;&lt;br /&gt;case '*':&lt;br /&gt;y=x*y;&lt;br /&gt;break;&lt;br /&gt;case '/':&lt;br /&gt;y=x/y;&lt;br /&gt;}&lt;br /&gt;return y;&lt;br /&gt;} //ENF OF FUNCTION double add(double x,double y,char ch)&lt;br /&gt;double angle_conv(double no)&lt;br /&gt;{&lt;br /&gt;if(flagp=='d')&lt;br /&gt;{&lt;br /&gt;if(flag=='r')&lt;br /&gt;{&lt;br /&gt;no=no*PI/180;&lt;br /&gt;}&lt;br /&gt;if(flag=='g')&lt;br /&gt;{&lt;br /&gt;no=no*1.1111111;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;else if(flagp=='r')&lt;br /&gt;{&lt;br /&gt;if(flag=='d')&lt;br /&gt;{&lt;br /&gt;no=no*180/PI;&lt;br /&gt;}&lt;br /&gt;if(flag=='g')&lt;br /&gt;{&lt;br /&gt;no=no*180/PI*1.1111111;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;else if(flagp=='g')&lt;br /&gt;{&lt;br /&gt;if(flag=='r')&lt;br /&gt;{&lt;br /&gt;no=no/(180*1.1111111)*PI;&lt;br /&gt;}&lt;br /&gt;if(flag=='d')&lt;br /&gt;{&lt;br /&gt;no=no/1.1111111;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;return(no);&lt;br /&gt;}//END OF FUNCTION double angle_conv(double no)&lt;br /&gt;&lt;br /&gt;void basecng(double y,double pnt1)&lt;br /&gt;{&lt;br /&gt;char str[17];&lt;br /&gt;if(pnt1!=0)&lt;br /&gt;{&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("The version does not support this feature");&lt;br /&gt;getch();&lt;br /&gt;bflag='u';&lt;br /&gt;bflagp='0';&lt;br /&gt;/*@@@@@@@@@@-----Important-----@@@@@@@@@&lt;br /&gt;*/&lt;br /&gt;main();&lt;br /&gt;}&lt;br /&gt;if(bflagp!='u')&lt;br /&gt;{&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("The version does not support this feature ");&lt;br /&gt;getch();&lt;br /&gt;bflagp='0';&lt;br /&gt;bflag='u';&lt;br /&gt;/*&lt;br /&gt;@@@@@@@@@@-----Important-----@@@@@@@@@&lt;br /&gt;*/&lt;br /&gt;main();&lt;br /&gt;}&lt;br /&gt;switch(bflag)&lt;br /&gt;{&lt;br /&gt;case 'v':&lt;br /&gt;itoa(y,str,8);&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%s",str);&lt;br /&gt;bflagp='0';&lt;br /&gt;break;&lt;br /&gt;case 'w':&lt;br /&gt;itoa(y,str,16);&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%s",str);&lt;br /&gt;bflagp='0';&lt;br /&gt;break;&lt;br /&gt;case 'x':&lt;br /&gt;itoa(y,str,2);&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("\t\t\t\t ");&lt;br /&gt;gotoxy(row,col);&lt;br /&gt;printf("%s",str);&lt;br /&gt;bflagp='0';&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;bflag='u';&lt;br /&gt;} // END OF FUNCTION void basecng(double y,double pnt1)&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);font-family:verdana;" &gt;Note : For more information, you  can also visit my other blogs. And don't forget to give your valuable  comments.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://shikhor-himadrir.blogspot.com/2010/04/scientific-calculator-in-c.html</link><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmm1DBH3ytlHZmRp8ms95M2th90EyzT_snL0W-W8ktD7PSqatdu67KzDEdbbkQm_my1m9XphDojWGwQlukanlccRiV4lknapm-N3yKkwg-O3l-CExZFNF1LUhxzbAry735wO4yyJxFM8aK/s72-c/p%252F1272651297442.jpg" width="72"/><thr:total>3</thr:total><author>noreply@blogger.com (Shikhor Himadrir)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-174271235475244033.post-9111321179529112701</guid><pubDate>Thu, 11 Feb 2010 15:03:00 +0000</pubDate><atom:updated>2010-05-27T02:58:13.879-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Basic Computer</category><category domain="http://www.blogger.com/atom/ns#">Data</category><category domain="http://www.blogger.com/atom/ns#">Digital Design</category><title>Instruction Codes</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3lwWnYSoQL1cGQ4UNup9gqrgW10MPq_SxYc8Mhf9jekxhQ7BckrpFWqxXWdRQzREbaK2GpT5KJ9fA2PLfjdamt9mehK3LL59b5pwN87qg-Siz_HmqqTjbfIXt3kOovW6PmMIDK-8l7qo/s1600-h/screenshot.jpg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 160px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3lwWnYSoQL1cGQ4UNup9gqrgW10MPq_SxYc8Mhf9jekxhQ7BckrpFWqxXWdRQzREbaK2GpT5KJ9fA2PLfjdamt9mehK3LL59b5pwN87qg-Siz_HmqqTjbfIXt3kOovW6PmMIDK-8l7qo/s320/screenshot.jpg" alt="" id="BLOGGER_PHOTO_ID_5437016650152775762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;Preface&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;Computer is a well organized digital system which is internally defined by the sequence of micro operations[micro operation : some basic function of computer by which all other tasks are performed by computer. hints: it was discussed on my blog :&lt;a href="http://rgnrgtr.blogspot.com/"&gt;Register and Register Transfer&lt;/a&gt;] it performs on data stored in its registers.The general purpose of digital computer is capable of executing various micro operations and in addition, can be instructed as to what specific sequence of operations it must perform.There is controller who can control the process. This controller is the user of computer.Programs are the user of computer.&lt;br /&gt;A program  is set of instructions that specify the operations, operands, and the sequence by which processing has to occur. the data processing may be altered by specifying a new program with different instructions or specifying same instructions with different data.So there are clearly some instructions for defining sequence  micro operations. These  instructions are called computer instructions.&lt;br /&gt;&lt;/div&gt;&lt;span style="color: rgb(51, 51, 255);font-size:180%;" &gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Computer instructions&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;A computer instruction is a binary code that specifies a sequence of micro operations for the computer.These binary codes are called instruction codes. All instruction codes together with their data are kept stored in computer memory.The computer can read each instructions from the memory and places it in a control register.The control then interpret the binary of  instruction code and proceeds to execute it by issuing a  sequence of micro operations .Every computer has its own unique instruction set.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;Instruction Code&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;An instruction code is a group of bits that instruct the computer to perform a specific operation.it is usually divided into parts, each having its own particular interpretation.The most basic part of a instruction code is its operation part.The operation part of instruction code is called operation code or op-code.The op-code is a group of bits that define such operations as add, subtract, multiply, shift and complement.The  number of bits required for the operation code of an instruction code depends on the total number of operations available in the computer.The operation code must consists of at least n bit for  given 2^n (or less) distinct operations.So if there are 16 operations available in the computer,then operation code must have 4 bits of code .For illustration, consider a computer with 64 distinct operations, one of them is an ADD operations.Then the op-code will have 6 bits length and the 6 bit binary op-code 110010 represent the ADD operation.So these code are just like acting as a token for a specific operation.When this operation code is decoded in the control unit, the computer issues the control signals to read an operand from memory and add the operand to a processor register.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;We could be confused with 2 wards  computer operation and micro operation.So we must recognize the relationship between computer operation and micro operation. An operation is part of an instruction stored in the computer memory.It is a binary code that tells the computer to perform a specific operation.The control unit receives the instruction from the memory and interprets the operation bits.It then issues a sequence of control signals to initiate micro operations in internal computer registers.For every operation code, the control issues a sequence of micro operations needed for the hardware implementation of the specified operation.For this reason, an operation code is sometimes called a micro operation because it specifies a set of micro operations.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The operation part of an instruction code specifies the operation be performed. This operation must be performed on some data stored on processor register or in memory.An instruction code must therefore specify not only the operation but also the registers or the memory words where the operands are to be found, as well as the register or memory word where the result is to be stored.memory words can be specified in instruction codes by their address.Processor registers can be specified by assigning to the instruction another binary code of k-bits that specifies one of 2^k registers.There are many variations for arranging the binary code of instructions and each computer has its own particular instruction code format.instruction code format are conceived by computer designers who specify the architecture of computer.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;Stored Program Organization&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;The simplest way to organize a computer is to have one processor register and an instruction code format with two parts.The first part specifies the operation to be performed and the second specifies an address.This operand is read from memory and used as the data to be operated on together with the data stored in the processor register.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The given figure depicts this type of organization.Instructions are stored in one section of memory and data in another.For a memory unit with 4096 words we need 12 bits to specify an address since 2^12 = 4096.if we store each instruction code in one 16-bit word, we have available 4-bits for the operation code(abbreviated op code) to specify one of 16 possible operations, and 12-bits to specify the address of an operand.The control reads 16-bit instruction from the program portion of the memory.It uses the 12-bit address part of the instruction to read a 16-bit operand from the data portion of memory.It then executes the operation specified by the operation code.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJN4GbkuIErotl7txc7Af9j4n9UbcbsXz-w1xJXqWjLbXEoMN2_df9o7DndbX6sZH5S4UxJsh4Adsr_2TPqnl4YDHcqZu1qlzPJDWcE0S1QNbgyFUlJCqM65XblvYj7QfjKTKc0Q_oYvg/s1600-h/stored.jpeg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 160px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJN4GbkuIErotl7txc7Af9j4n9UbcbsXz-w1xJXqWjLbXEoMN2_df9o7DndbX6sZH5S4UxJsh4Adsr_2TPqnl4YDHcqZu1qlzPJDWcE0S1QNbgyFUlJCqM65XblvYj7QfjKTKc0Q_oYvg/s320/stored.jpeg" alt="" id="BLOGGER_PHOTO_ID_5437258687538989570" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Computer that have a single processor register usually assign to it the name accumulator and label it AC.The operation is performed with the memory operand and the content of AC.&lt;br /&gt;If an operation in an instruction code does not need an operand from memory, the rest of the bits in the instruction can be used for other purposes.For example, operations such as clear AC complement AC, and increment AC operate on data stored in the AC register.They do not need an operand from memory.For these types of operations, the second part of the instruction code (bits 0 through 11) is not needed for specifying a memory address and can be used to specify other operations for the computer.&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255);font-size:180%;" &gt;Indirect Address&lt;/span&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: justify;"&gt;It is sometimes convenient to use the address bits of an instruction code not as an address but as the actual operand.When the second part of an instruction code specifies an operand, the instruction is said to have an immediate operand.When second part specifies the address of an operand, the instruction has said to have a direct address.This is an contrast to a third possibility&lt;br /&gt;called indirect address, where the bits in the second part of the instruction designate an address of a memory word in which the address of the operand is found.One bit of the instruction code can can be used to distinguish between a direct and an indirect address.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;As an illustration of this configuration of instruction, consider the instruction code format shown in given figure fig(a).It consists of a 3-bit operation code, a 12-bit address, and an indirect address mode bit designated by 'I'.When the mode bit I = 0, then instruction code is in direct address form and when the mode bit I = 0, then instruction code is in indirect address form.A direct address instruction is shown in given figure fig(b). It is placed in address 20 in memory.The I bit is 0, so the instruction is recognized as a direct address instruction.The op code specifies an ADD operation, and the address part is the binary equivalent of 400. The control finds the operation in memory at address 400 and adds it to the content of AC.The instruction in address 30 is shown in figure fig(c) has a mode bit I = 1.Therefore, it is recognized as an indirect address instruction.The address part is the binary equivalent of 300.The control goes to address 300 to find the address of the operand.The address of the operand in this case is 1200.The operand found in address 1200 is then added to the content of AC.&lt;br /&gt;&lt;br /&gt;The indirect address instruction needs two references to memory to fetch an operand.The first reference is needed to read the address of the operand ; the second is for the operand itself.We define the effective address to be the address of the operand in a computation-type instruction of the target address in a branch type instruction.Thus the effective address in the instruction of fig(b)is 400 and in the instruction of fig(c) is 1200.So if any reader is familiar with some programing language, he/she can clearly see that indirect addressing is as like pointer referencing.&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7zwrNdSyUI40AhLEHJF-_8cSZeJ57w0s-WAXC8bm7wd1h4fx0p0Yyh5DIOxTwsTq-hsa15la0XzRK2vmjjAZD66QxJk-gKn2APIu1kP-QNArgRiAnNnuVf0iQmzzSz3iTc2nYg6tn9TA/s1600-h/indirect.jpeg"&gt;&lt;img style="cursor: pointer; width: 320px; height: 212px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7zwrNdSyUI40AhLEHJF-_8cSZeJ57w0s-WAXC8bm7wd1h4fx0p0Yyh5DIOxTwsTq-hsa15la0XzRK2vmjjAZD66QxJk-gKn2APIu1kP-QNArgRiAnNnuVf0iQmzzSz3iTc2nYg6tn9TA/s320/indirect.jpeg" alt="" id="BLOGGER_PHOTO_ID_5437320343077857986" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Note : For more information, you  can also visit my other blogs. And don't forget to give your valuable  comments.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</description><link>http://shikhor-himadrir.blogspot.com/2010/02/instruction-codes.html</link><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3lwWnYSoQL1cGQ4UNup9gqrgW10MPq_SxYc8Mhf9jekxhQ7BckrpFWqxXWdRQzREbaK2GpT5KJ9fA2PLfjdamt9mehK3LL59b5pwN87qg-Siz_HmqqTjbfIXt3kOovW6PmMIDK-8l7qo/s72-c/screenshot.jpg" width="72"/><thr:total>0</thr:total><author>noreply@blogger.com (Shikhor Himadrir)</author></item></channel></rss>