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

<channel>
	<title>C++ Archives -</title>
	<atom:link href="https://mitindia.in/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>https://mitindia.in/tag/c/</link>
	<description></description>
	<lastBuildDate>Sat, 26 Nov 2016 07:20:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://mitindia.in/wp-content/uploads/2023/03/cropped-android-chrome-512x512-1-32x32.png</url>
	<title>C++ Archives -</title>
	<link>https://mitindia.in/tag/c/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Data structure and algorithm</title>
		<link>https://mitindia.in/data-structure-algorithm/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Sun, 20 Nov 2016 07:36:04 +0000</pubDate>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[data structure]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=594</guid>

					<description><![CDATA[<p>Data Structures A data structure is a logical method of representing data in memory. Data structure is strictly described as an instance of an Abstract Data Type (ADT). An Abstract Data Type is defined as a mathematical model of a user-defined type along with the operations performed on that model. Data Structure Strengths Weaknesses Array [&#8230;]</p>
<p>The post <a href="https://mitindia.in/data-structure-algorithm/">Data structure and algorithm</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Data Structures<img decoding="async" class="alignright" src="http://image.slidesharecdn.com/lecture1-m-131122062232-phpapp02/95/lecture-1-data-structures-and-algorithms-1-638.jpg?cb=1385105034" alt="Image result for data structures and algorithms" width="177" height="133" /></h3>
<ul>
<li>A data structure is a logical method of representing data in memory.</li>
<li>Data structure is strictly described as an instance of an Abstract Data Type (ADT).</li>
<li>An Abstract Data Type is defined as a mathematical model of a user-defined type along with the operations performed on that model.</li>
</ul>
<table border="1" width="650">
<tbody>
<tr>
<td width="169"><strong>Data Structure</strong></td>
<td width="334"><strong>Strengths</strong></td>
<td width="254"><strong>Weaknesses</strong></td>
</tr>
<tr>
<td width="169">Array</td>
<td width="334">Fast access if index is known</td>
<td width="254">Slow search, fixed size</td>
</tr>
<tr>
<td width="169">Stack</td>
<td width="334">Features last in – first out access</td>
<td width="254">Slow access to other elements</td>
</tr>
<tr>
<td width="169">Queue</td>
<td width="334">Features first in – first out access</td>
<td width="254">Slow access to other elements</td>
</tr>
<tr>
<td width="169">Linked list</td>
<td width="334">Quick insertion and deletion</td>
<td width="254">Slow search</td>
</tr>
<tr>
<td width="169">Binary tree</td>
<td width="334">Quick insertion, deletion and search when tree is balanced</td>
<td width="254">Deletion procedure is complex</td>
</tr>
<tr>
<td width="169">Hash table</td>
<td width="334">Fast insertion and access if key is known</td>
<td width="254">Inefficient memory usage, slow access if key is not known</td>
</tr>
<tr>
<td width="169">Heap</td>
<td width="334">Fast insertion, deletion and access to largest element</td>
<td width="254">Slow access to other elements</td>
</tr>
<tr>
<td width="169">Graph</td>
<td width="334">Simulates real world problems</td>
<td width="254">Some algorithms are slow and complex</td>
</tr>
</tbody>
</table>
<h5>Algorithm</h5>
<p>An algorithm can be described as sequence of steps or instructions required to solve a given problem.</p>
<p>It is a finite set of instructions written to accomplish a particular task.</p>
<p>When designing an algorithm, one must ensure that the</p>
<p>algorithm adheres to the following criteria:</p>
<p>Input: Some input data (can be empty in some cases) externally supplied to the algorithm</p>
<p>Output: At least one output is produced</p>
<p>Finiteness: The algorithm must terminate after finite number of steps</p>
<p>Definiteness: The instructions must be clear and unambiguous</p>
<p>Effectiveness: Every instruction must be basic enough to be carried out on paper</p>
<p><strong>Following are certain points to be considered</strong></p>
<p>while writing an algorithm :</p>
<p>Representing an algorithm.</p>
<p>Designing an algorithm.</p>
<p>Analyzing an algorithm.</p>
<p><strong>Algorithm Analysis</strong></p>
<p>Algorithm Analysis involves comparing different algorithms written for a specific problem. All the algorithms are compared for their space and time complexities.</p>
<p>Space complexity: It refers to the amount of storage the algorithm consumes.</p>
<p>Time complexity: It is the time required by the algorithm for execution.</p>
<p><strong>Following are the different types of time complexities:</strong></p>
<p>Best-case time complexity: It is the measure of minimum time required for an algorithm to execute for a known input size.</p>
<p>Average case time complexity: Average time complexity is the measure of time an algorithm will require to execute, for a typical input data size. This method requires statistical calculations.</p>
<p>Worst-case time complexity: It is the measure of maximum time required for an algorithm to execute for a known input size.</p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fdata-structure-algorithm%2F&amp;linkname=Data%20structure%20and%20algorithm" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fdata-structure-algorithm%2F&amp;linkname=Data%20structure%20and%20algorithm" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fdata-structure-algorithm%2F&#038;title=Data%20structure%20and%20algorithm" data-a2a-url="https://mitindia.in/data-structure-algorithm/" data-a2a-title="Data structure and algorithm"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/data-structure-algorithm/">Data structure and algorithm</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>History of programming languages</title>
		<link>https://mitindia.in/history-programming-languages/</link>
					<comments>https://mitindia.in/history-programming-languages/#comments</comments>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Mon, 01 Aug 2016 06:02:46 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[history of programming languages]]></category>
		<category><![CDATA[Java]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=406</guid>

					<description><![CDATA[<p>Brief history on programming languages. We can’t imagine a single moment without use of computer and internet today and it become necessary routine of our life but behind the use of computer and internet there are many computer languages involved and of course our dedicated programmer who always uses these programming languages to write software [&#8230;]</p>
<p>The post <a href="https://mitindia.in/history-programming-languages/">History of programming languages</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Brief history on programming languages.</h3>
<p>We can’t imagine a single moment without use of computer and internet today and it become necessary routine of our life but behind the use of computer and internet there are many computer languages involved and of course our dedicated programmer who always uses these programming languages to write software / web application and keep themselves in innovating new things such as design of interface or logic of the program and big thanks to them!</p>
<p><img fetchpriority="high" decoding="async" class="alignright" src="http://m.c.lnkd.licdn.com/mpr/mpr/AAEAAQAAAAAAAAXUAAAAJGM5NzBjYWFmLTVhZWUtNDY1Yi1iMDU4LTE4YTc2N2Y0N2Q2Ng.jpg" alt="programming languages " width="650" height="372" /></p>
<h6>Following are the programming languages based on historical advancement and implementation in various real-time applications.</h6>
<table style="width: 514px; height: 3384px;">
<tbody>
<tr style="height: 84px;">
<td style="text-align: center; height: 84px; width: 43px;"><span style="color: #800000;"><strong>Sr no</strong></span></td>
<td style="text-align: center; height: 84px; width: 138px;"><span style="color: #800000;"><strong>Programming language</strong></span></td>
<td style="text-align: center; height: 84px; width: 157px;"><span style="color: #800000;"><strong>Application</strong></span></td>
<td style="text-align: center; height: 84px; width: 115px;"><span style="color: #800000;"><strong>Used by</strong></span></td>
</tr>
<tr style="height: 252px;">
<td style="height: 252px; width: 43px;">1</td>
<td style="height: 252px; width: 138px;">FORTRAN [Formula Transfer]</p>
<p>[1957] used for  scientific, mathematics purpose etc.</td>
<td style="height: 252px; width: 157px;">Artificial intelligence application, supercomputing and business software’s</td>
<td style="height: 252px; width: 115px;"><a href="https://www.nasa.gov/">NASA</a></td>
</tr>
<tr style="height: 196px;">
<td style="height: 196px; width: 43px;">2</td>
<td style="height: 196px; width: 138px;">LISP [List processor]</p>
<p>[1958]</td>
<td style="height: 196px; width: 157px;">Artificial intelligence application, supercomputing and business software’s</td>
<td style="height: 196px; width: 115px;">NASA</td>
</tr>
<tr style="height: 308px;">
<td style="height: 308px; width: 43px;">3</td>
<td style="height: 308px; width: 138px;">COBOL [Common Business Oriented Language]</p>
<p>[1959], used for developing commercial purpose.</td>
<td style="height: 308px; width: 157px;">Business application</td>
<td style="height: 308px; width: 115px;">Various companies</td>
</tr>
<tr style="height: 336px;">
<td style="height: 336px; width: 43px;">4</td>
<td style="height: 336px; width: 138px;">PASCAL [1970], best for academic purpose and data structures programs widely used until 80’s. Developed by Niklaus writh.</td>
<td style="height: 336px; width: 157px;">Windows applications, teaching programming language for many universities.</td>
<td style="height: 336px; width: 115px;">Skype [Microsoft]</td>
</tr>
<tr style="height: 308px;">
<td style="height: 308px; width: 43px;">5</td>
<td style="height: 308px; width: 138px;">C Language [1972], general purpose low-level programming language. Developed by Dennis Ritchie.</td>
<td style="height: 308px; width: 157px;">Cross platform programming language, OS development, System side applications etc.</td>
<td style="height: 308px; width: 115px;">Unix</td>
</tr>
<tr style="height: 336px;">
<td style="height: 336px; width: 43px;">6</td>
<td style="height: 336px; width: 138px;">C++ [1983], it is also called “C with classes”, object oriented programming language.  Developed by BJarne Stroustrup.</td>
<td style="height: 336px; width: 157px;">Commercial application development. Client / server applications, multimedia applications etc.</td>
<td style="height: 336px; width: 115px;">Google, Facebook, Microsoft, Mozilla, Chrome etc.</td>
</tr>
<tr style="height: 308px;">
<td style="height: 308px; width: 43px;">7</td>
<td style="height: 308px; width: 138px;">Objective C [1983], general purpose high-level programming language. Developed by Brad Cox and Tam Love.</td>
<td style="height: 308px; width: 157px;">Message passing. OS development [Apple]</td>
<td style="height: 308px; width: 115px;">Apple’s X OS</td>
</tr>
<tr style="height: 252px;">
<td style="height: 252px; width: 43px;">8</td>
<td style="height: 252px; width: 138px;">PERL [1987], it is a general purpose and processing reports on Unix. Developed by Larry Wall.</td>
<td style="height: 252px; width: 157px;">Database applications, Network administration, net work programming etc.</td>
<td style="height: 252px; width: 115px;">Cisco, AMD, <a href="http://www.amazon.com/">Amazon</a> etc.</td>
</tr>
<tr style="height: 168px;">
<td style="height: 168px; width: 43px;">9</td>
<td style="height: 168px; width: 138px;">PYTHON [1991] Developed by GUIDO VAN ROSSUM.</td>
<td style="height: 168px; width: 157px;">Web application, security software etc.</td>
<td style="height: 168px; width: 115px;"><a href="http://google.co.in">Google</a>, Yahoo, Facebook etc.</td>
</tr>
<tr style="height: 140px;">
<td style="height: 140px; width: 43px;">10</td>
<td style="height: 140px; width: 138px;">RUBY [1993] Developed by YUKHIRO MATSUMOTO</td>
<td style="height: 140px; width: 157px;">Ruby on Rails</td>
<td style="height: 140px; width: 115px;">Groupon, <a href="https://twitter.com">Twitter </a>etc.</td>
</tr>
<tr style="height: 224px;">
<td style="height: 224px; width: 43px;">11</td>
<td style="height: 224px; width: 138px;">PHP [Preprocessor Hypertext PHP] [1994] Developed by RASMUS LERDORF.</td>
<td style="height: 224px; width: 157px;">Building dynamic web pages.</td>
<td style="height: 224px; width: 115px;"><a href="https://www.facebook.com/">Facebook</a>, <a href="https://wordpress.com/">WordPress</a>, Joomla, <a href="https://en.wikipedia.org/wiki/Main_Page">Wikipedia</a> etc.</td>
</tr>
<tr style="height: 228.078px;">
<td style="height: 228.078px; width: 43px;">12</td>
<td style="height: 228.078px; width: 138px;">JAVA [1995], Platform independent programming language. Developed by James Gosling.</td>
<td style="height: 228.078px; width: 157px;">Web applications, network softwares, mobile devices, consumer devices etc.</td>
<td style="height: 228.078px; width: 115px;"><a href="https://www.android.com/">Android</a> OS and Apps</td>
</tr>
</tbody>
</table>
<p><span style="color: #ff6600;">That&#8217;s all for now! wait for next article for more on history of programming  languages. </span></p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fhistory-programming-languages%2F&amp;linkname=History%20of%20programming%20languages" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fhistory-programming-languages%2F&amp;linkname=History%20of%20programming%20languages" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fhistory-programming-languages%2F&#038;title=History%20of%20programming%20languages" data-a2a-url="https://mitindia.in/history-programming-languages/" data-a2a-title="History of programming languages"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/history-programming-languages/">History of programming languages</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mitindia.in/history-programming-languages/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>C# Introduction</title>
		<link>https://mitindia.in/c-introduction/</link>
					<comments>https://mitindia.in/c-introduction/#comments</comments>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Tue, 19 Jul 2016 12:30:03 +0000</pubDate>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[visual c#]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=347</guid>

					<description><![CDATA[<p>All about C#.Net The .NET Framework defines the environment to execute Visual C# .NET applications and the services you can use within those applications. The .NET Framework has two main components:  Common Language Runtime (CLR)  A unified set of class libraries The .NET class libraries include code for programming topics such as threading, file I/O, [&#8230;]</p>
<p>The post <a href="https://mitindia.in/c-introduction/">C# Introduction</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h6><span style="color: #000080;">All about C#.Net</span></h6>
<p>The .NET Framework defines the environment to execute Visual C# .NET applications and the services you can use within those applications.</p>
<p><img decoding="async" class="alignright" src="http://blog.greymatterindia.com/wp-content/uploads/2014/09/C-Application-Development.png" width="179" height="134" /></p>
<p>The .NET Framework has two main components:</p>
<ul>
<li> Common Language Runtime (CLR)</li>
<li> A unified set of class libraries</li>
</ul>
<p>The .NET class libraries include code for programming topics such as threading, file I/O, database support, XML parsing, and data structures.</p>
<p>In addition to CLR and class libraries, the .NET framework also includes the programming languages and ASP.NET.</p>
<h6>CLR and MSIL</h6>
<p>CLR ensures that the functionality available to one language is available to any other .NET language.</p>
<p>Microsoft Intermediate Language (MSIL) is composed of a specific set of instructions that indicate how your code should be executed.</p>
<p>The main job of a JIT compiler is to translate your generic MSIL code into machine code that can be directly executed by your CPU.</p>
<p>MSIL code can be easily read by the verification process</p>
<h5>CLS,CTS &amp; Garbage Collector</h5>
<ul>
<li>Common Language Specification (CLS)</li>
<li>Is a set of rules that any .NET language should follow</li>
<li>Is used to create applications that are interoperable with other languages</li>
</ul>
<h4>Common Type System (CTS) commonly:</h4>
<ul>
<li>Contains the standard data types</li>
<li>Contains the set of guidelines.</li>
</ul>
<h5>Garbage Collector</h5>
<ul>
<li> Is a destructor used for clean up operations</li>
<li> Is responsible for freeing up memory</li>
</ul>
<h6>Conclusion</h6>
<ul>
<li>.NET Framework is made up of two major components; .NET Framework Class Library and Common Language Runtime.</li>
<li>The CLR is a modern runtime environment that manages the execution of user code, providing services such as JIT compilation, memory management, exception management, debugging etc.</li>
<li>The CTS defines the rules by which all types are declared, defined and managed, regardless of source language.</li>
<li>The CLS is a set of minimum standards that all compilers targeting .NET must support to ensure language interoperability.</li>
<li>Namespaces is a grouping of similar classes having related methods and is used specifically to avoid name clashes between classes.</li>
<li>The Just In Time (JIT) compiler compiles the MSIL code into a native code that is specific to the OS and machine architecture being targeted.</li>
</ul>
<p><a href="http://www.mitindia.in/2016/07/21/basics-of-c/">Basic Data Types in C#</a></p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fc-introduction%2F&amp;linkname=C%23%20Introduction" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fc-introduction%2F&amp;linkname=C%23%20Introduction" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fc-introduction%2F&#038;title=C%23%20Introduction" data-a2a-url="https://mitindia.in/c-introduction/" data-a2a-title="C# Introduction"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/c-introduction/">C# Introduction</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mitindia.in/c-introduction/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>CPP Basic Programs-List1</title>
		<link>https://mitindia.in/cpp-basic-programs-list1/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Wed, 22 Jun 2016 09:58:07 +0000</pubDate>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[programs on c++]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=123</guid>

					<description><![CDATA[<p>Following are the list of C++ Programs. 1. C++ Program to display employee salary information. #include&#60;iostream.h&#62; #include&#60;conio.h&#62; class test { public: int bs, hra, pf, net; getdata(int bs1, int hra1, int pf1) { bs=bs1; hra=hra1; pf=pf1; net=bs+hra-pf; return(net); } void display() { cout &#60;&#60;"Net Salary="&#60;&#60;net; } }; main() { clrscr(); test t; t.getdata(10000,3000, 1500); t.display(); [&#8230;]</p>
<p>The post <a href="https://mitindia.in/cpp-basic-programs-list1/">CPP Basic Programs-List1</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3 class="post-title entry-title"><img loading="lazy" decoding="async" class="alignright" src="http://2.bp.blogspot.com/-Pp3UvmGLhVA/VqsSn4UcXyI/AAAAAAAABHs/FOJggt5vyz8/s200/c%252B%252B.png" width="200" height="133" border="0" /></h3>
<div id="post-body-3733420058612887410" class="post-body entry-content">
<div dir="ltr">
<div><b>Following are the list of C++ Programs.</b></div>
<p>1. C++ Program to display employee salary information.</p>
<pre>#include&lt;iostream.h&gt;
#include&lt;conio.h&gt;
class test
{
public:
int bs, hra, pf, net;

getdata(int bs1, int hra1, int pf1)
{
bs=bs1;
hra=hra1;
pf=pf1;
net=bs+hra-pf;
return(net);
}

void display()
{
cout &lt;&lt;"Net Salary="&lt;&lt;net;
}
};

main()
{
clrscr();
test t;
t.getdata(10000,3000, 1500);
t.display();
}
</pre>
<div></div>
<div>2. C++ Program to add 2 numbers.</div>
<div>
<pre>#include&lt;iostream.h&gt;
#include&lt;conio.h&gt;
void main()
{
int a,b;
clrscr();
cout&lt;&lt;"\nEnter two numbers:";
cin&gt;&gt;a&gt;&gt;b;
int sum=a+b;
cout&lt;&lt;"\nResult="&lt;&lt;sum;
getch();
}</pre>
</div>
<div></div>
<div>3. C++ Program to display square and cube of entered number.</div>
<div>
<pre>#include&lt;iostream.h&gt;
#include&lt;math.h&gt;
#include&lt;conio.h&gt;
main()
{
int num;
clrscr();
cout&lt;&lt;"\nEnter number:";
cin&gt;&gt;num;
cout&lt;&lt;"\nSquare of the given number="&lt;&lt;num*num;
cout&lt;&lt;"\nCube of the given number="&lt;&lt;num*num*num;
cout&lt;&lt;"\nSquare root of the given number="&lt;&lt;sqrt(num);
getch();
}
</pre>
</div>
<div></div>
<div>4. C++ Program to show inventory information.</div>
<div>
<pre>#include&lt;iostream.h&gt;
#include&lt;conio.h&gt;
main()
{
int qty;
char itemnm[15];
float price,tot;
clrscr();
cout&lt;&lt;"\nEnter item name:";
cin&gt;&gt;itemnm;
cout&lt;&lt;"\nEnter qty:";
cin&gt;&gt;qty;
cout&lt;&lt;"\nEnter price:";
cin&gt;&gt;price;
tot=qty*price;
clrscr();
cout&lt;&lt;"\n=====BILL=====";
cout&lt;&lt;"\nItem name:"&lt;&lt;itemnm;
cout&lt;&lt;"\nQty      :"&lt;&lt;qty;
cout&lt;&lt;"\nPrice    :"&lt;&lt;price;
cout&lt;&lt;"\nTotal Amt:"&lt;&lt;tot;
cout&lt;&lt;"\n==============";
getch();
}
</pre>
</div>
<div></div>
<div>5. C++ program to display addition and multiplication using switch case.</div>
<div>
<pre>#include&lt;iostream.h&gt;
#include&lt;conio.h&gt;
main()
{
int a,b,ch;
clrscr();
cout&lt;&lt;"\n1.Addition";
cout&lt;&lt;"\n2.Multilplication";
cout&lt;&lt;"\nEnter choice:";
cin&gt;&gt;ch;
switch(ch)
{
case 1:
cout&lt;&lt;"\nResult="&lt;&lt;a+b;
break;
case 2:
cout&lt;&lt;"\nResult="&lt;&lt;a-b;
break;
default:
cout&lt;&lt;"\nInvalid choice";
break;
}
getch();
}</pre>
</div>
<div></div>
<div>6. C++ Program to use goto statement.</div>
<div>
<pre>#include&lt;iostream.h&gt;
#include&lt;conio.h&gt;
main()
{
int i;
clrscr();
for(i=1;i&lt;=10;i++)
{
if(i==5)
goto a;
cout&lt;&lt;"\nI="&lt;&lt;i;
}
a:
cout&lt;&lt;"\nProgram terminated";
getch();
}</pre>
</div>
<div></div>
<div>7. C++ Program to display smallest and largest number.</div>
<div>
<pre>#include&lt;iostream.h&gt;
#include&lt;conio.h&gt;
main()
{
int num[10];
int range;
clrscr();
cout&lt;&lt;"\nEnter range:";
cin&gt;&gt;range;
cout&lt;&lt;"\nEnter "&lt;&lt;range&lt;&lt;" numbers:";
for(int i=0;i&lt;range;i++)
cin&gt;&gt;num[i];
cout&lt;&lt;"\nThe given numbers are:";
for(i=0;i&lt;range;i++)
cout&lt;&lt;"\n"&lt;&lt;num[i];
int big,small;
big=num[0];
small=num[0];
for(i=1;i&lt;range;i++)
{
if(num[i]&gt;big)
big=num[i];
else if(num[i]&lt;small)
small=num[i];
}
cout&lt;&lt;"\nLargest number="&lt;&lt;big;
cout&lt;&lt;"\nSmallest number="&lt;&lt;small;
getch();
}</pre>
</div>
<div></div>
<div>8. C++ Program to swap 2 numbers using function.</div>
<div>
<pre>#include&lt;iostream.h&gt;
#include&lt;conio.h&gt;
swap(int,int);

main()
{
int a,b;
clrscr();
cout&lt;&lt;"\nEnter two numbers:";
cin&gt;&gt;a&gt;&gt;b;

cout&lt;&lt;"\nBefore calling the function";
cout&lt;&lt;"\nA="&lt;&lt;a;
cout&lt;&lt;"\nB="&lt;&lt;b;

swap(a,b);
cout&lt;&lt;"\nAfter calling the function";
cout&lt;&lt;"\nA="&lt;&lt;a;
cout&lt;&lt;"\nB="&lt;&lt;b;
getch();
}

swap(int a,int b)
{
int temp=a;
a=b;
b=temp;
cout&lt;&lt;"\nInside the function";
cout&lt;&lt;"\nA="&lt;&lt;a;
cout&lt;&lt;"\nB="&lt;&lt;b;
}</pre>
</div>
<div></div>
<div>9. C++ Program to find length of the string.</div>
<div>
<pre>#include&lt;iostream.h&gt;
#include&lt;conio.h&gt;
#include&lt;string.h&gt;
main()
{
char str[25];
int i,len=0;
clrscr();
cout&lt;&lt;"\nEnter string:";
cin&gt;&gt;str;
for(i=0;str[i]!='\0';i++)
{
len++;
}
cout&lt;&lt;"\nLength of the string="&lt;&lt;len;
getch();
}
</pre>
</div>
<div></div>
<div>10. C++ Program to calculate electricity bill.</div>
<div>
<pre>#include&lt;iostream.h&gt;
#include&lt;conio.h&gt;
class EBill
{
 int meterno,units,tot;
 char cnm[15];
 public:
 void getInfo()
 {
  cout&lt;&lt;"\nEnter customer name:";
  cin&gt;&gt;cnm;
  cout&lt;&lt;"\nEnter number of units used:";
  cin&gt;&gt;units;
  cout&lt;&lt;"\nEnter meter number:";
  cin&gt;&gt;meterno;
 }
 void calc()
{
 if(1&lt;= units&lt;=150)
 tot=units*2+100;
 else if(150&lt; units&lt;=300)
 tot=units*3+100;
 else if(300&lt; units&lt;=400)
 tot=units*4+100;
 else
 tot=units*5+100;
}
void showBill()
{
cout&lt;&lt;"\n=====Electricity BILL======";
cout&lt;&lt;"\nCustomer name="&lt;&lt;cnm;
cout&lt;&lt;"\nNo. of Units ="&lt;&lt;units;
cout&lt;&lt;"\nMeter number ="&lt;&lt;meterno;
cout&lt;&lt;"\nTotal Bill   ="&lt;&lt;tot;
cout&lt;&lt;"\n================";
}
};
main()
{
clrscr();
EBill ob;
ob.getInfo();
ob.calc();
ob.showBill();
getch();
}</pre>
</div>
<div></div>
<div><b>Thank you for referring above programs. </b></div>
<div><b>keep subscribe to latest and updated programs.</b></div>
</div>
</div>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fcpp-basic-programs-list1%2F&amp;linkname=CPP%20Basic%20Programs-List1" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fcpp-basic-programs-list1%2F&amp;linkname=CPP%20Basic%20Programs-List1" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fcpp-basic-programs-list1%2F&#038;title=CPP%20Basic%20Programs-List1" data-a2a-url="https://mitindia.in/cpp-basic-programs-list1/" data-a2a-title="CPP Basic Programs-List1"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/cpp-basic-programs-list1/">CPP Basic Programs-List1</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
