<?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>programs on c++ Archives -</title>
	<atom:link href="https://mitindia.in/tag/programs-on-c/feed/" rel="self" type="application/rss+xml" />
	<link>https://mitindia.in/tag/programs-on-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>programs on c++ Archives -</title>
	<link>https://mitindia.in/tag/programs-on-c/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<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 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>
