tag:blogger.com,1999:blog-13795401336411153312024-03-05T08:34:57.812-08:00c language basics | c++ programming examples.Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management.Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comBlogger482125tag:blogger.com,1999:blog-1379540133641115331.post-53494577870192167942020-08-13T19:44:00.002-07:002020-08-13T19:45:35.283-07:00C++ Identifiers.<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://www.cprogramcoding.com/en" hreflang="en" />
<link rel="alternate" href="https://www.cprogramcoding.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://www.cprogramcoding.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://www.cprogramcoding.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://www.cprogramcoding.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">C++ Programming Tutorial</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4></li>
<li><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Home</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-difference-between-c-and-c-c-c_4.html"><span style="font-size:100%;color:green;">C vs C++</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/introduction-to-c-c.html"><span style="font-size:100%;color:green;">C++ History</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-features.html"><span style="font-size:100%;color:green;">C++ Features</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/how-to-make-first-program-of-c.html"><span style="font-size:100%;color:green;">C++ Program</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-inputoutput-operation.html"><span style="font-size:100%;color:green;">C++ cout, cin, endl</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-variable.html"><span style="font-size:100%;color:green;">C++ Variable</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/variable-scope-in-c-language.html"><span style="font-size:100%;color:green;">C++ Variable Scope</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/constants-c-programming-language.html"><span style="font-size:100%;color:green;">C++ Constants</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/storage-classes-in-c-language.html"><span style="font-size:100%;color:green;">C++ Storage Classes</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-data-types.html"><span style="font-size:100%;color:green;">C++ Data types</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/reserved-words-or-keywords-in-c.html"><span style="font-size:100%;color:green;">C++ Keywords</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/operators-in-c.html"><span style="font-size:100%;color:green;">C++ Operators</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-identifiers.html"><span style="font-size:100%;color:green;">C++ Identifiers</span></a></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-control-statement-c-control-statement.html"><span style="font-size:100%;color:green;">C++ Control Statement</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Functions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Arrays</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Pointers</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Object Class</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Inheritance</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Polymorphism</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Abstraction</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Namespaces</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Strings</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Exceptions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Templates</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">Signal Handling</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ File & Stream</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Misc</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ STL Tutorial</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Iterators</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4></li>
</ul></div>
<div class="col-6 col-s-9">
<h2><span style="color:blue;">C++ Identifiers.</span></h2><br />
<p style="text-align: justify;text-indent: 30px;">The name that we give to an entity in the program so that it can be uniquely identified, is called "identifier". The names of variables, functions, labels of a class, and other user-defined objects are called 'identifiers'. ‘Identifiers’ cannot be used as keywords.</p>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<br />
<br />
<h3><span style="color:blue;">List of identifiers.</span></h3>
<ol type="1" start="1">
<li><p style="text-align: justify;text-indent: 10px;">Constants.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Variables</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Functions</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Labels</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Defined data types</p></li>
</ol><br />
<h3><span style="color:blue;">Rules for identifiers declaraion.</span></h3>
<ol type="1" start="1">
<li><p style="text-align: justify;text-indent: 10px;">Only alphabetic characters, digits, and underscores are allowed.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">The identifier name cannot start with a digit.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Therefore, we can say that C++ identifiers are case-sensitive. For eg int 'a' and int 'A' are differnt variables.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">A declared keyword cannot be used as a variable name.</p></li>
</ol><br />
<br />
<div><script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div><br />
<br />
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-7.7165518848024206 43.806627317790984 48.90391988480242 114.11913268220901tag:blogger.com,1999:blog-1379540133641115331.post-1452343824842528982020-08-11T07:45:00.002-07:002020-08-13T19:46:33.328-07:00Operators in C++. <div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://www.cprogramcoding.com/en" hreflang="en" />
<link rel="alternate" href="https://www.cprogramcoding.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://www.cprogramcoding.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://www.cprogramcoding.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://www.cprogramcoding.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">C++ Programming Tutorial</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4></li>
<li><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Home</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-difference-between-c-and-c-c-c_4.html"><span style="font-size:100%;color:green;">C vs C++</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/introduction-to-c-c.html"><span style="font-size:100%;color:green;">C++ History</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-features.html"><span style="font-size:100%;color:green;">C++ Features</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/how-to-make-first-program-of-c.html"><span style="font-size:100%;color:green;">C++ Program</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-inputoutput-operation.html"><span style="font-size:100%;color:green;">C++ cout, cin, endl</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-variable.html"><span style="font-size:100%;color:green;">C++ Variable</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/variable-scope-in-c-language.html"><span style="font-size:100%;color:green;">C++ Variable Scope</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/constants-c-programming-language.html"><span style="font-size:100%;color:green;">C++ Constants</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/storage-classes-in-c-language.html"><span style="font-size:100%;color:green;">C++ Storage Classes</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-data-types.html"><span style="font-size:100%;color:green;">C++ Data types</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/reserved-words-or-keywords-in-c.html"><span style="font-size:100%;color:green;">C++ Keywords</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/operators-in-c.html"><span style="font-size:100%;color:green;">C++ Operators</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-identifiers.html"><span style="font-size:100%;color:green;">C++ Identifiers</span></a></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-control-statement-c-control-statement.html"><span style="font-size:100%;color:green;">C++ Control Statement</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Functions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Arrays</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Pointers</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Object Class</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Inheritance</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Polymorphism</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Abstraction</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Namespaces</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Strings</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Exceptions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Templates</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">Signal Handling</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ File & Stream</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Misc</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ STL Tutorial</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Iterators</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4></li>
</ul></div>
<div class="col-6 col-s-9">
<h2><span style="color:blue;">Operators in C++.</span></h2><br />
<p style="text-align: justify;text-indent: 30px;">The operator is a symbol that tells the compiler to perform any mathematical and logical operation. </p>
<p style="text-align: justify;text-indent: 30px;">Such symbols which are used to perform any type of mathematical and logical operation. They are called operators in C++ programming. In programming, operators are used to manipulating data and variables.</p>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<br />
<br />
<p style="text-align: justify;text-indent: 30px;">Operators work together with one or more variables, constants, or operands. Variable, constant, operands, function, and operators merge all these together to form an expression.</p>
<h3><span style="color:blue;">Types of operators in C++ programming.</span></h3>
<p style="text-align: justify;text-indent: 30px;">In C++ programming there are lots of built-in operators that have been divided into different types.</p>
<ol type="1" start="1">
<li><p style="text-align: justify;text-indent: 10px;">Arithmetic Operators.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Assignment Operators.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Relational Operators.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Logical Operators.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Conditional Operators (Ternary Operators).</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Bitwise Operators.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Increment / Decrement Operators.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Special Operators.</p></li>
</ol><br />
<h3><span style="color:blue;">1.Arithmetic Operators</span></h3>
<p style="text-align: justify;text-indent: 30px;">Arithmetic operators are the most basic operators. These operators are used to perform mathematical operations such as Addition (addition), Subtraction (subtraction), Multiplication (multiplication), Division (division / division), Modulus division (modulus division).</p>
<table width="100%" class="r10">
<tr style="border: 1px solid black;">
<th style="border: 1px solid black;">Operators</th>
<th style="border: 1px solid black;">Explanation</th>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">+ (Addition)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">It adds two operands.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">- (Subtraction)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">This removes the left operand from the right operand.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">* (Multiplication)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">It multiplies the two operands.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">/ (Division)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">It divides left operand by the right operand.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">% (Modulus)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">It extracts the remainder by dividing left operand by the right operand.</p></td>
</tr>
</table>
<pre><div class="r">
#include <iostream>
using namespace std;
int main()
{
int number1,number2,res;
cout<<"\n Enter first number:";
cin>>number1;
cout<<"\n Enter second number:";
cin>>number2;
res=number1+number2;
cout<<"\n Sum of two numbers : "<<res;
res=number1-number2;
cout<<"\n Subtraction of two numbers : "<<res;
res=number1*number2;
cout<<"\n Multiplication of two numbers : "<<res;
res=number1/number2;
cout<<"\n Division of two numbers : "<<res;
res=number1%number2;
cout<<"\n Remainder of two numbers : "<<res;
return 0;
}
</div></pre>
<h5><strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter first number:5
Enter second number:3
Sum of two numbers : 8
Subtraction of two numbers : 2
Multiplication of two numbers : 15
Division of two numbers : 1
Remainder of two numbers : 2
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<h3><span style="color:blue;">2.Assignment Operators</span></h3>
<p style="text-align: justify;text-indent: 30px;">The assignment operator is used to assign a value to a variable. Some operators come in the list of these operators, whose list is given in the table below. For example x=x+y same as x+=y.</p>
<table width="100%" class="r10">
<tr style="border: 1px solid black;">
<th style="border: 1px solid black;">Operators</th>
<th style="border: 1px solid black;">Examples</th>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">= (assignment)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">c = a + b</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">+= (add assignment)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">c += a same as c = c + a</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">-= (subtract assignment)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">c -= a same as c = c - a</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">*= (multiply assignment)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">c *= a same as c = c * a</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">/= (divide assignment)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">c /= a same as c = c / a</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">%= (modulus assignment)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">c %= a same as c = c % a</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">&= (AND assignment)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">c &= a same as c = c & a</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">|= (OR assignment)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">c |= a same as c = c | a</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">^= (XOR assignment)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">c ^= a same as c = c ^ a</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;"><<= (Left Shift assignment)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">c <<= a same as c = c << a</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">>>= (Right Shift assignment)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">c >>= a same as c = c >> a</p></td>
</tr>
</table>
<pre><div class="r">
#include <iostream>
using namespace std;
int main()
{
int number1,number2;
cout<<"\n Enter first number:";
cin>>number1;
cout<<"\n Enter second number:";
cin>>number2;
number1+=number2;
cout<<"\n Sum of two numbers : "<<number1;
number1-=number2;
cout<<"\n Subtraction of two numbers : "<<number1;
number1*=number2;
cout<<"\n Multiplication of two numbers : "<<number1;
number1/=number2;
cout<<"\n Division of two numbers : "<<number1;
number1%=number2;
cout<<"\n Remainder of two numbers : "<<number1;
number2 &= 2;
cout<<"\nvalue of number2 &= 2 is "<< number2<<endl;
number2 |= 2;
cout<<"value of 'number2 |= 2' is "<< number2<<endl;
number2 ^= 2;
cout<<"value of number2 ^= 2 is "<< number2<<endl;
number2 <<= 2;
cout<<"value of number2 <<= 2 is "<< number2<<endl;
number2 >>= 2;
cout<<"value of number2 >>= 2 is "<< number2<<endl;
return 0;
}
</div></pre>
<h5><strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter first number:5
Enter second number:3
Sum of two numbers : 8
Subtraction of two numbers : 5
Multiplication of two numbers : 15
Division of two numbers : 5
Remainder of two numbers : 2
value of number2 &= 2 is 2
value of 'number2 |= 2' is 2
value of number2 ^= 2 is 0
value of number2 <<= 2 is 0
value of number2 >>= 2 is 0
Enter first number:20
Enter second number:12
Sum of two numbers : 32
Subtraction of two numbers : 20
Multiplication of two numbers : 240
Division of two numbers : 20
Remainder of two numbers : 8
value of number2 &= 2 is 0
value of 'number2 |= 2' is 2
value of number2 ^= 2 is 0
value of number2 <<= 2 is 0
value of number2 >>= 2 is 0
</div></pre>
<h3><span style="color:blue;">3.Relational Operators</span></h3>
<p style="text-align: justify;text-indent: 30px;">Relational Operator is used to compare the value of two operands, hence it is also called a Comparison operator. In the table below, lists of Relational Operators are given.</p>
<table width="100%" class="r10">
<tr style="border: 1px solid black;">
<th style="border: 1px solid black;">Operator</th>
<th style="border: 1px solid black;">Description</th>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">==</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">This operator is called equal to the operator. This operator is used to equal check two values. If both values are equal, then it returns true.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">!=</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">This operator is called Not equal to the operator. It is used to check that two operands are not equal. Meaning that this operator is used to check the value of two operands, if the value of both operands is not equal then it returns true.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">></p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">This operator is called Greater than the operator. It is used to check the value of the first operand greater than the value of the second operand. If the value of the first operand is greater than the value of the second operand, then it returns true like (5> 2) return true.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;"><</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">This operator is called Less than the operator. It is used to check the value of the first operand less than the value of the second operand. If the value of the first operand is smaller than the value of the second operand, then it returns true such as (3 <4) return true.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">>=</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">This operator is called Greater than equal to the operator. It is used to check the value of the first operand greater than and equal to the value of the second operand. If the value of the first operand is greater than or equal to the value of the second operand, then it returns true as (5> = 5) return true.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;"><=</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">This operator is called Less than equal to the operator. It is used to check the value of the first operand less than the value of the second operand. If the value of the first operand is smaller than or equal to the value of the second operand, it returns true such that (5 <= 5) return true.</p></td>
</tr>
</table>
<pre><div class="r">
#include <iostream>
using namespace std;
int main(){
int number1, number2;
cout<<"\n Enter first number : ";
cin>>number1;
cout<<"\n Enter second number : ";
cin>>number2;
if(number1< number2)
{
cout<<" number1 is less than number2"<<endl;
}
else
{
cout<<" number1 is greater than number2"<<endl;
}
if(number1<= number2)
{
cout<<" number1 is less than number2"<<endl;
}
else{
cout<<" number1 is greater than number2"<<endl;
}
if(number1> number2)
{
cout<<" number1 is greater than number2"<<endl;
}
else
{
cout<<" number1 is less than number2"<<endl;
}
if(number1>= number2)
{
cout<<" number1 is greater than number2"<endl;
}
else
{
cout<<" number1 is less than number2"<<endl;
}
if(number1== number2)
{
cout<<" number1 is equal to number2"<<endl;
}
else
{
cout<<" number1 is not equal to number2"<<endl;
}
return 0;
}
</div></pre>
<h5><strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter first number : 31
Enter second number : 36
number1 is less than number2
number1 is less than number2
number1 is less than number2
number1 is less than number2
number1 is not equal to number2
Enter first number : 31
Enter second number : 31
number1 is greater than number2
number1 is less than number2
number1 is less than number2
number1 is greater than number2
number1 is equal to number2
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<h3><span style="color:blue;">4.Logical Operators.</span></h3>
<p style="text-align: justify;text-indent: 30px;">Logical operators are used to combining two expressions and a condition. These operators are used to perform logical operations. </p>
<table width="100%" class="r10">
<tr style="border: 1px solid black;">
<th style="border: 1px solid black;">Operators</th>
<th style="border: 1px solid black;">Explanation</th>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">&& (logical &&)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">If both the conditions are true then it will return true.for e.g. (5 <6) && (6> 5)</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">|| (logical OR)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">If either one is true, then it will return true. For e.g. (5 <6) || (6> 5)</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">! (logical not)</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">If the condition is true, it makes it false.for e.g. ! ((5 <6) && (6> 5))
! ((5 <6) || (6> 5))
</p></td>
</tr>
</table>
<pre><div class="r">
#include <iostream>
using namespace std;
int main()
{
int number1,number2,number3,number4;
cout<<"\n Enter first number :";
cin>>number1;
cout<<"\n Enter second number :";
cin>>number2;
cout<<"\n Enter third number :";
cin>>number3;
cout<<"\n Enter fourth number :";
cin>>number4;
if((number1<number2) && (number3>number4))
{
cout<<"Condition is true ( AND operator)."<<endl;
}
else
{
cout<<"Condition is false ( AND operator)."<<endl;
}
if((number1<number2) || (number3>number4))
{
cout<<"Condition is true ( OR operator)."<<endl;
}
else
{
cout<<"Condition is false ( OR operator)."<<endl;
}
if(!((number1<number2) && (number3>number4)))
{
cout<<"Condition is true ( NOT operator)."<<endl;
}
else
{
cout<<"Condition is false ( NOT operator)."<<endl;
}
return 0;
}
</div></pre>
<h5><strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter first number :10
Enter second number :20
Enter third number :15
Enter fourth number :8
Condition is true ( AND operator).
Condition is true ( OR operator).
Condition is false ( NOT operator).
</div></pre>
<h3><span style="color:blue;">5.Conditional Operators (Ternary Operators)</span></h3>
<p style="text-align: justify;text-indent: 30px;">Conditional operators are used to checking the condition. This operator has only two options TRUE and FALSE. If the given condition satisfies, then TRUE will return otherwise FALSE will be returned.</p>
<h5><strong>Syntax of conditional operators.</strong></h5>
<pre><div class="r" style="color:green;">
Condition ? True Expression : False Expression;
</div></pre>
<pre><div class="r">
#include <iostream>
using namespace std;
int main()
{
int number;
cout<<"\n Enter any number :";
cin>>number;
( number%2==0) ? cout<<"\n It is Even number" : cout<<"\n It is Odd number" ;
return 0;
}
</div></pre>
<h5><strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter any number :31
It is Odd number
Enter any number :36
It is Even number
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<h3><span style="color:blue;">6.Bitwise Operators.</span></h3>
<p style="text-align: justify;text-indent: 30px;">Bitwise operator is used to manipulating BIT level data. This operator is used for shifting from right to left and left to right bit. The bitwise operator does not apply to float and double data type.</p>
<p style="text-align: justify;text-indent: 30px;">The full form of Bit is a binary digit which is 0 and 1. The bitwise operator is calculated at 0 and 1. Whenever we manipulate the decimal number by the bitwise operator, the processor first converts it in the form of 0 and 1 and then calculates it.</p>
<table width="100%" class="r10">
<tr style="border: 1px solid black;">
<th style="border: 1px solid black;">Operator</th>
<th style="border: 1px solid black;">Description</th>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">&</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Bitwise AND</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">|</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Bitwise OR</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">^</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Bitwise exclusive OR</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;"><<</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Left Shift</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">>></p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Right Shift</p></td>
</tr>
</table>
<h3><span style="color:blue;">Bitwise operator &, |, ^</span></h3>
<table width="100%" class="r10">
<tr style="border: 1px solid black;">
<th style="border: 1px solid black;">p</th>
<th style="border: 1px solid black;">q</th>
<th style="border: 1px solid black;">p & q</th>
<th style="border: 1px solid black;">p | q</th>
<th style="border: 1px solid black;">p ^ q</th>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0</p></td>
</tr>
</table>
<h5><strong>Operation on AND(p&q)</strong></h5>
<pre><div class="r" style="color:green;">
Decimal Value Binary Value
If p = 20, q = 12, then
20 0 0 0 1 0 1 0 0
12 0 0 0 0 1 1 0 0
--------------------------
4 0 0 0 0 0 1 0 0
--------------------------
</div></pre>
<h5><strong>Operation on OR(p|q)</strong></h5>
<pre><div class="r" style="color:green;">
Decimal Value Binary Value
If p = 20, q = 12, then
20 0 0 0 1 0 1 0 0
12 0 0 0 0 1 1 0 0
--------------------------
28 0 0 0 1 1 1 0 0
--------------------------
</div></pre>
<h5><strong>Operation on XOR(a^b)</strong></h5>
<pre><div class="r" style="color:green;">
Decimal Value Binary Value
If a = 20, b = 12, then
20 0 0 0 1 0 1 0 0
12 0 0 0 0 1 1 0 0
--------------------------
24 0 0 0 1 1 0 0 0
--------------------------
</div></pre>
<h3><span style="color:blue;">Binary Left Shift( << ) and Right Shift( >> )</span></h3>
<p style="text-align: justify;text-indent: 30px;">Left Shift (<<) for e.g. a = 20; / * 0001 0100 * / a << Shifts every binary number in binary value of numeric value in 2 with 2 binary numbers left side. For e.g.a = 20; / * 0001 0100 * / So this means 0101 0000 will be 80.</p>
<p style="text-align: justify;text-indent: 30px;">Right Shift (>>) for e.g. a = 20; / * 0001 0100 * / This is completely opposite from Left shift. Right Shift a >> shifts every binary number from the right side to 2 binary numbers in binary value of numeric value in 2. for e.g.a = 20; / * 0001 0100 * / So its 0000 0101 means 5.</p>
<h3><span style="color:blue;">Complement Operator (~)</span></h3>
<p style="text-align: justify;text-indent: 30px;">This operator does all the bit reverse.</p>
<p style="text-align: justify;text-indent: 30px;">This operator reduces 0 to 1 and 0 to 0.</p>
<h5><strong>Operation on Complement( ~ )</strong></h5>
<pre><div class="r" style="color:green;">
Decimal Value Binary Value
~12 0 0 0 0 1 1 0 0
--------------------------
243 1 1 1 1 0 0 1 1
--------------------------
Why did 243 come here instead of Output -13?
</div></pre>
<h3><span style="color:blue;">2's Complement of 243 -(reverse of 243 in binary + 1)</span></h3>
<p style="text-align: justify;text-indent: 30px;">Operation on 2's Complement( ~ )</p>
<p style="text-align: justify;text-indent: 30px;">Decimal Value Binary Value 2's Complement</p>
<pre><div class="r" style="color:green;">
243 1111 0011 -(0000 1100+1)
= -(0000 1101) = -13
</div></pre>
<pre><div class="r">
#include <iostream>
using namespace std;
int main()
{
int number1,number2,result;
cout<<"\n Enter first number:";
cin>>number1;
cout<<"\n Enter second number:";
cin>>number2;
result=number1&number2;
cout<<"value of result(number1&number2) is "<<result<<endl;
result=number1|number2;
cout<<"value of result(number1|number2) is "<<result<<endl;
result=number1^number2;
cout<<"value of result(number1^number2) is "<<result<<endl;
result=number1<<2;
cout<<"value of result(number1<<2) is "<<result<<endl;
result=number1>>2;
cout<<"value of result(number1>>2) is "<<result<<endl;
cout<<"value of result(~number1) is "<<~number1<<endl;
return 0;
}
</div></pre>
<h5><strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter first number:20
Enter second number:12
value of result(number1&number2) is 4
value of result(number1|number2) is 28
value of result(number1^number2) is 24
value of result(number1<<2) is 80
value of result(number1>>2) is 5
value of result(~number1) is -21
Enter first number:31
Enter second number:36
value of result(number1&number2) is 4
value of result(number1|number2) is 63
value of result(number1^number2) is 59
value of result(number1<<2) is 124
value of result(number1>>2) is 7
value of result(~number1) is -32
</div></pre>
<h3><span style="color:blue;">7.Increment / Decrement Operators.</span></h3>
<p style="text-align: justify;text-indent: 30px;">The increment / decrement operator is used to increase and decrease the value of the variable once. For example, if the variable already has a 5 value store, then its value will be reduced to 6 by increment operator and its value will be 4 by decrement operator.</p>
<p style="text-align: justify;text-indent: 30px;">There are two types of increase / decrement operator.</p>
<ol type="1" start="1">
<li><p style="text-align: justify;text-indent: 10px;">Pre increment.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Pre decrement.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Post increment.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Post decrement.</p></li>
</ol><br />
<h3><span style="color:blue;">Pre increment / decrement operator.</span></h3>
<p style="text-align: justify;text-indent: 30px;">In the pre-increment/decrement operator, first, the value increase and decrease occur and then the further calculation is performed.</p>
<h5><strong>Syntax of pre increment / decrement operator.</strong></h5>
<pre><div class="r" style="color:green;">
++ (variable name), – – (variable name)
</div></pre>
<h3><span style="color:blue;">Post increment / decrement operator.</span></h3>
<p style="text-align: justify;text-indent: 30px;">In the post-increment/decrement operator, the calculation is first performed and then the value change occurs. Post means later. There is a value increase and decrease after the calculation is performed.</p>
<h5><strong>Syntax of post increment / decrement operator.</strong></h5>
<pre><div class="r" style="color:green;">
(variable name) ++, (variable name) – –
</div></pre>
<pre><div class="r">
#include <iostream>
using namespace std;
int main() {
int x;
cout<<"\n Enter x value :";
cin>>x;
cout<<"Print Value of Pre-increment : "<<++x<<endl;
cout<<"Value of x : "<<x<<endl;
cout<<"Print Value of Pre-decrement : "<<--x<<endl;
cout<<"Value of x : "<<x<<endl;
cout<<"Print Value of Post increment : "<<x++<<endl;
cout<<"Value of x : "<<x<<endl;
cout<<"Print Value of Post decrement : "<<x--<<endl;
cout<<"Value of x : "<<x<<endl;
return 0;
}
</div></pre>
<h5><strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter x value :31
Print Value of Pre-increment : 32
Value of x : 32
Print Value of Pre-decrement : 31
Value of x : 31
Print Value of Post increment : 31
Value of x : 32
Print Value of Post decrement : 32
Value of x : 31
</div></pre>
<br />
<div><script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div><br />
<br />
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comtag:blogger.com,1999:blog-1379540133641115331.post-41469509473320031212020-08-09T21:03:00.006-07:002020-08-13T19:47:12.591-07:00Reserved Words or Keywords in C++. <div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://www.cprogramcoding.com/en" hreflang="en" />
<link rel="alternate" href="https://www.cprogramcoding.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://www.cprogramcoding.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://www.cprogramcoding.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://www.cprogramcoding.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">C++ Programming Tutorial</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4></li>
<li><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Home</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-difference-between-c-and-c-c-c_4.html"><span style="font-size:100%;color:green;">C vs C++</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/introduction-to-c-c.html"><span style="font-size:100%;color:green;">C++ History</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-features.html"><span style="font-size:100%;color:green;">C++ Features</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/how-to-make-first-program-of-c.html"><span style="font-size:100%;color:green;">C++ Program</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-inputoutput-operation.html"><span style="font-size:100%;color:green;">C++ cout, cin, endl</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-variable.html"><span style="font-size:100%;color:green;">C++ Variable</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/variable-scope-in-c-language.html"><span style="font-size:100%;color:green;">C++ Variable Scope</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/constants-c-programming-language.html"><span style="font-size:100%;color:green;">C++ Constants</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/storage-classes-in-c-language.html"><span style="font-size:100%;color:green;">C++ Storage Classes</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-data-types.html"><span style="font-size:100%;color:green;">C++ Data types</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/reserved-words-or-keywords-in-c.html"><span style="font-size:100%;color:green;">C++ Keywords</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/operators-in-c.html"><span style="font-size:100%;color:green;">C++ Operators</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-identifiers.html"><span style="font-size:100%;color:green;">C++ Identifiers</span></a></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-control-statement-c-control-statement.html"><span style="font-size:100%;color:green;">C++ Control Statement</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Functions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Arrays</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Pointers</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Object Class</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Inheritance</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Polymorphism</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Abstraction</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Namespaces</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Strings</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Exceptions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Templates</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">Signal Handling</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ File & Stream</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Misc</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ STL Tutorial</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Iterators</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4></li>
</ul></div>
<div class="col-6 col-s-9">
<h2><span style="color:blue;">Reserved Words or Keywords in C++.</span></h2><br />
<p style="text-align: justify;text-indent: 30px;">These words have special meaning for C++ Compiler, hence they are called Keyword or Reserve Words. Each Reserve Word has its own special meaning and every Reserve Word is used only to accomplish a particular task in a particular situation. We cannot use a Reserve Word as a common identifier.</p>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<br />
<br />
<p style="text-align: justify;text-indent: 30px;">A list of 32 Keywords in C++ Language which are also available in C language is given below.</p>
<table width="100%" class="r10">
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">auto</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">break</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">case</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">char</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">const</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">continue</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">default</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">do</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">double</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">else</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">enum</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">extern</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">float</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">for</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">goto</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">if</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">int</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">long</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">register</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">return</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">short</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">signed</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">sizeof</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">static</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">struct</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">switch</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">typedef</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">union</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">unsigned</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">void</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">volatile</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">while</p></td>
</tr>
</table>
<p style="text-align: justify;text-indent: 30px;">A list of 30 Keywords in C++ Language which are not available in C language is given below.</p>
<table width="100%" class="r10">
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">asm</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">dynamic_cast</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">namespace</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">reinterpret_cast</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">bool</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">explicit</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">new</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">static_cast</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">false</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">catch</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">operator</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">template</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">friend</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">private</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">class</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">this</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">inline</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">public</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">throw</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">const_cast</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">delete</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">mutable</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">protected</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">true</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">try</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">typeid</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">typename</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">using</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">virtual</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">wchar_t</p></td>
</tr>
</table>
<h3><span style="color:blue;"></span></h3>
<p style="text-align: justify;text-indent: 30px;"></p>
<p style="text-align: justify;text-indent: 30px;"></p>
<h3><span style="color:blue;"></span></h3>
<table width="100%" class="r10">
<tr style="border: 1px solid black;">
<th style="border: 1px solid black;">C++ Keywords</th>
<th style="border: 1px solid black;">Description</th>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">asm</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Used to write assembly language.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">auto</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Storage is a type of class. Which is also used for Local variables?</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">bool</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The Boolean variable is used to declare. For eg. True or False.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">break</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Used to break loops or statements.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">case</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The switch case statement is to be used.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">catch</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Used to handle exceptions from the throw.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">char</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The character variable is used to declare.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">class</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Used to declare classes.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">const</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Const This is used for a constant variable.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">const_cast</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The Constant variable is cast.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">continue</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The loop is iterated.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">default</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The switch is used in case statements.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">delete</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Used for dynamic memory allocation.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">do</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Is a loop type. With which, while loop is used.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">double</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The floating-point is the data-type.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">dynamic_cast</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Used with the pointer.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">else</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The statement with if is used.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">enum</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Enumeration is the 'Keyword' of the data type.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">explicit</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Constructor is used to convert.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">export</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The definition of the template is exported.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">extern</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Storage is a type of class. Whose scope is global?</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">false</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Boolean has a value.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">float</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The floating-point variable is used to declare.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">for</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Is a type of loop?</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">friend</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Non-member function; Used to access private data.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">goto</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">There is a statement that contains a label.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">if</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Is a statement. Which shows whether the condition is true or false?</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">inline</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Is used for the function.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">int</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The integer variable is used to declare.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">long</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The long integer variable is used to declare.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">mutable</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Is the type of storage class?</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">namespace</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The same identifiers (variables, functions, classes) are used to tell differently.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">new</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Used for dynamic memory allocation.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">operator</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Used to declare overloaded operators.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">private</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Used to declare private members of a class.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">protected</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Used to declare protected members of the class.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">public</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Used to declare public members of the class.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">register</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Is the type of storage class.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">reinterpret_cast</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The cast-type Variable is used to change.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">return</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Is used for the function.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">short</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The short integer variable is used to declare.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">signed</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Is a variable modifier.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">sizeof</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The size of the variable is used to return.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">static</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Is the type of storage class?</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">static_cast</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Is a type conversion.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">struct</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The structure is used to define or declare.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">switch</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Is a statement.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">template</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Used to write the Generic Program.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">this</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Brings the pointer to the current object.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">throw</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The exception is used for handling.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">true</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Boolean has value.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">try</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The exception is used for handling.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">typedef</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The data type is used to give alias name.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">typeid</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The object is described.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">typename</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The alternative to the class is.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">union</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">This keyword is assigned to its members at the same memory location.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">unsigned</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The unsigned integer variable is used to declare.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">using</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Used with a namespace.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">virtual</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Runtime is used for polymorphism.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">void</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">It does not return anything.</p></td>
</tr>
</table>
<br />
<div><script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div><br />
<br />
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comUnited States37.09024 -95.712891-14.110697777849886 -166.02539636441804 88.2911777778499 -25.400385635581969tag:blogger.com,1999:blog-1379540133641115331.post-56660754759281038612020-08-09T19:50:00.006-07:002020-08-13T19:47:46.325-07:00C++ Data Types.<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://www.cprogramcoding.com/en" hreflang="en" />
<link rel="alternate" href="https://www.cprogramcoding.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://www.cprogramcoding.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://www.cprogramcoding.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://www.cprogramcoding.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">C++ Programming Tutorial</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4></li>
<li><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Home</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-difference-between-c-and-c-c-c_4.html"><span style="font-size:100%;color:green;">C vs C++</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/introduction-to-c-c.html"><span style="font-size:100%;color:green;">C++ History</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-features.html"><span style="font-size:100%;color:green;">C++ Features</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/how-to-make-first-program-of-c.html"><span style="font-size:100%;color:green;">C++ Program</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-inputoutput-operation.html"><span style="font-size:100%;color:green;">C++ cout, cin, endl</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-variable.html"><span style="font-size:100%;color:green;">C++ Variable</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/variable-scope-in-c-language.html"><span style="font-size:100%;color:green;">C++ Variable Scope</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/constants-c-programming-language.html"><span style="font-size:100%;color:green;">C++ Constants</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/storage-classes-in-c-language.html"><span style="font-size:100%;color:green;">C++ Storage Classes</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-data-types.html"><span style="font-size:100%;color:green;">C++ Data types</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/reserved-words-or-keywords-in-c.html"><span style="font-size:100%;color:green;">C++ Keywords</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/operators-in-c.html"><span style="font-size:100%;color:green;">C++ Operators</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-identifiers.html"><span style="font-size:100%;color:green;">C++ Identifiers</span></a></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-control-statement-c-control-statement.html"><span style="font-size:100%;color:green;">C++ Control Statement</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Functions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Arrays</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Pointers</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Object Class</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Inheritance</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Polymorphism</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Abstraction</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Namespaces</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Strings</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Exceptions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Templates</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">Signal Handling</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ File & Stream</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Misc</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ STL Tutorial</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Iterators</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4></li>
</ul></div>
<div class="col-6 col-s-9">
<h2><span style="color:blue;">C++ Data Types.</span></h2><br />
<h3><span style="color:blue;">Introduction of Data Types</span></h3>
<p style="text-align: justify;text-indent: 30px;">We are creating variables to store data in the C++ language. These data variables are called data types.</p>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<br />
<br />
<table width="100%" class="r10">
<tr style="border: 1px solid black;">
<th style="border: 1px solid black;">Types</th>
<th style="border: 1px solid black;">Data Types</th>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Basic Data Type.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">int, char, float, double, etc.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Derived Data Type.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">array, pointer, etc.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Enumeration Data Type.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">enum.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">User Defined Data Type.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">structure and class.</p></td>
</tr>
</table>
<h3><span style="color:blue;">Basic Data Types.</span></h3>
<p style="text-align: justify;text-indent: 30px;">Basic data types of data types are found in all programming languages. Because these are the basic data types. Which are mandatory to use. They are. </p>
<ol type="1" start="1">
<li><p style="text-align: justify;text-indent: 10px;">Integer data type</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Float data type</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Character data type</p></li>
</ol><br />
<h3><span style="color:blue;">Integer data type.</span></h3>
<p style="text-align: justify;text-indent: 30px;">The integer data type only stores whole numbers. The data type found in the integer data type. </p>
<h3><span style="color:blue;">Float data type.</span></h3>
<p style="text-align: justify;text-indent: 30px;">Which contains a decimal data stored data type is called float data type. </p>
<h3><span style="color:blue;">Character data type.</span></h3>
<p style="text-align: justify;text-indent: 30px;">These data types stores the character in the variables is called a character data type. </p>
<h3><span style="color:blue;">User Defined Data Types.</span></h3>
<p style="text-align: justify;text-indent: 30px;">Structure and union in C language are a user-defined data type. This type of data type is also completely allowed in C ++. And at the same time, C ++ provides us the capabilities to create some new user define data types which are known as object-oriented programming.</p>
<h3><span style="color:blue;">Class.</span></h3>
<p style="text-align: justify;text-indent: 30px;">Class is an object-oriented programming base data type. And Class is a user-defined data type. The class is also like structure.</p>
<pre><div class="r" style="color:green;">
class num { your variables and function };
</div></pre>
<h3><span style="color:blue;">Enum Data Type.</span></h3>
<p style="text-align: justify;text-indent: 30px;">Enum data type is also user define data types. To create an enum data type, we use the enum keyword. And whenever we create Enum data types. So numbers are attached to each of the names. That is, using names like enum keyword automatically assigns names from 0 to values. </p>
<pre><div class="r" style="color:green;">
enum num {values1, values2, values3};
</div></pre>
<h3><span style="color:blue;">Derived Data Types.</span></h3>
<p style="text-align: justify;text-indent: 30px;">Derived data types are derived from basic data types.</p>
<ol type="1" start="1">
<li><p style="text-align: justify;text-indent: 10px;">Arrays.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Functions.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Pointers , etc.</p></li>
</ol><br />
<h3><span style="color:blue;">Basic Data Types.</span></h3>
<p style="text-align: justify;text-indent: 30px;">The basic data types are integer-based, floating-point, and character-based. C++ language supports both signed and unsigned literals.</p>
<p style="text-align: justify;text-indent: 30px;">The memory size of basic data types may change according to a 32 or 64-bit operating system.</p>
<p style="text-align: justify;text-indent: 30px;">Let's see the basic data types. It size is given according to 32 bit OS.</p>
<table width="100%" class="r10">
<tr style="border: 1px solid black;">
<th style="border: 1px solid black;">Data Types</th>
<th style="border: 1px solid black;">Memory Size</th>
<th style="border: 1px solid black;">Range</th>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">char</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1 byte</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">-128 to 127</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">signed char</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1 byte</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">-128 to 127</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">unsigned char</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1 byte</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0 to 127</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">short</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">2 byte</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">-32,768 to 32,767</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">signed short</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">2 byte</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">-32,768 to 32,767</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">unsigned short</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">2 byte</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0 to 32,767</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">int</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">2 byte</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">-32,768 to 32,767</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">signed int</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">2 byte</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">-32,768 to 32,767</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">unsigned int</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">2 byte</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0 to 32,767</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">short int</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">2 byte</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">-32,768 to 32,767</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">signed short int</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">2 byte</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">-32,768 to 32,767</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">unsigned short int</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">2 byte</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0 to 32,767</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">int</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">2</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">-32768 To 32767</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Short int</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">2</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">-31768 To 32767</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Long int</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">4</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">-2147483648 To 2147483647</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">signed int</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">2</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">-31768 To 32767</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">unsigned int</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">2</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0 To 65535</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">float</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">4</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">3.4E-38 to 3.4E+38</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">double</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">8</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1.7E-308 to 1.7E+308</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">long double</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">10</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">3.4E-4932 to 1.1E+4932</p></td>
</tr>
</table>
<br />
<div><script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div><br />
<br />
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comAustralia-25.274398 133.775136-53.249390506741634 98.618883317790988 2.700594506741627 168.93138868220902tag:blogger.com,1999:blog-1379540133641115331.post-31619824732852202982020-08-07T20:07:00.006-07:002020-08-13T19:48:25.786-07:00Storage Classes in the C++ language. <div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">C++ Programming Tutorial</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4></li>
<li><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Home</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-difference-between-c-and-c-c-c_4.html"><span style="font-size:100%;color:green;">C vs C++</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/introduction-to-c-c.html"><span style="font-size:100%;color:green;">C++ History</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-features.html"><span style="font-size:100%;color:green;">C++ Features</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/how-to-make-first-program-of-c.html"><span style="font-size:100%;color:green;">C++ Program</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-inputoutput-operation.html"><span style="font-size:100%;color:green;">C++ cout, cin, endl</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-variable.html"><span style="font-size:100%;color:green;">C++ Variable</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/variable-scope-in-c-language.html"><span style="font-size:100%;color:green;">C++ Variable Scope</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/constants-c-programming-language.html"><span style="font-size:100%;color:green;">C++ Constants</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/storage-classes-in-c-language.html"><span style="font-size:100%;color:green;">C++ Storage Classes</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-data-types.html"><span style="font-size:100%;color:green;">C++ Data types</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/reserved-words-or-keywords-in-c.html"><span style="font-size:100%;color:green;">C++ Keywords</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/operators-in-c.html"><span style="font-size:100%;color:green;">C++ Operators</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-identifiers.html"><span style="font-size:100%;color:green;">C++ Identifiers</span></a></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-control-statement-c-control-statement.html"><span style="font-size:100%;color:green;">C++ Control Statement</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Functions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Arrays</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Pointers</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Object Class</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Inheritance</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Polymorphism</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Abstraction</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Namespaces</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Strings</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Exceptions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Templates</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">Signal Handling</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ File & Stream</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Misc</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ STL Tutorial</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Iterators</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4></li>
</ul></div>
<div class="col-6 col-s-9">
<h2><span style="color:blue;">Storage Classes in the C++ language.</span></h2><br />
<p style="text-align: justify;text-indent: 30px;">This is a concept derived from the "C" language, in which it is decided which data is being stored and how it is being used. By using the Concept of Storage class.</p>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<br />
<br />
<h3><span style="color:blue;">Declarations and Definitions of Storage Classes.</span></h3>
<p style="text-align: justify;text-indent: 30px;">When we give a name to a Variable or Function and decide its Data Type, this process is called Declaration. The declaration is information for Compiler. The compiler does not take any action on a Declaration.</p>
<p style="text-align: justify;text-indent: 30px;">To allocate space in memory for the Compiler Variable. We have tried to note the difference between these two at many places while explaining the functions. </p>
<pre><div class="r" style="color:green;">
void function(); // function declaration
void function() // function definition
{
// statements
}
</div></pre>
<h3><span style="color:blue;">Automatic Variables.</span></h3>
<p style="text-align: justify;text-indent: 30px;">Variables that are declared within a block are useable, they are Automatic Variables.</p>
<pre><div class="r" style="color:green;">
void func()
{
int ivar; // automatic variables
float fvar;
}
</div></pre>
<h3><span style="color:blue;">Register Variables</span></h3>
<p style="text-align: justify;text-indent: 30px;">Register Variable is a special type of Automatic Variable. When we want to declare a register class to a Variable, then we have to use register Keyword. That is, we can declare a Variable of Register Class.</p>
<pre><div class="r" style="color:green;">
register int Total;
</div></pre>
<h3><span style="color:blue;">External Variables</span></h3>
<p style="text-align: justify;text-indent: 30px;">Variables that are declared outside a function or class are called Variables of External Storage Class. These are also called Global Variables.</p>
<h3><span style="color:blue;">Local Static Variables</span></h3>
<p style="text-align: justify;text-indent: 30px;">A variable that is declared with static keyword is called static variable.</p>
<pre><div class="r" style="color:green;">
void function1()
{
int x=10;//local variable
static int y=10;//static variable
x=x+1;
y=y+1;
printf("%d,%d",x,y);
}
</div></pre>
<p style="text-align: justify;text-indent: 30px;">If you call this function many times, local variable will print the same value for each function call e.g, 11,11,11 and so on. But static variable will print the incremented value in each function call e.g. 11, 12, 13 and so on.</p>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4DdKB-k1AiVXDkdEqtFmHBjiqFge4i-vDj_oUDgMddFjAuXMieNiV3LVdrUMz69gkpP-R4GTJW0jcEV5BdT49cTQ6IM212QELm7d5_DzkIMcVVfRdrFVjjiA-IZ6-rUXWOCPEwi8AFdiA/s700/10.jpg" imageanchor="1" style="display: block; margin-left: auto; margin-right: auto; padding: 1em 0px;"><img alt="C++ Storage Classes" border="0" data-original-height="180" data-original-width="700" height="165" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4DdKB-k1AiVXDkdEqtFmHBjiqFge4i-vDj_oUDgMddFjAuXMieNiV3LVdrUMz69gkpP-R4GTJW0jcEV5BdT49cTQ6IM212QELm7d5_DzkIMcVVfRdrFVjjiA-IZ6-rUXWOCPEwi8AFdiA/w640-h165/10.jpg" title="C++ Storage Classes" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Storage Classes</td></tr></tbody></table></p><div style="text-align: center;"><br /></div><p></p>
<br />
<div><script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div><br />
<br />
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.com48026 Russi, Province of Ravenna, Italy44.3720066 12.041361616.061770715197579 -23.114891082209013 72.682242484802416 47.197614282209017tag:blogger.com,1999:blog-1379540133641115331.post-76639227451172576862020-08-07T19:39:00.007-07:002020-08-13T19:49:07.010-07:00Constants c++ programming language. <div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">C++ Programming Tutorial</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4></li>
<li><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Home</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-difference-between-c-and-c-c-c_4.html"><span style="font-size:100%;color:green;">C vs C++</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/introduction-to-c-c.html"><span style="font-size:100%;color:green;">C++ History</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-features.html"><span style="font-size:100%;color:green;">C++ Features</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/how-to-make-first-program-of-c.html"><span style="font-size:100%;color:green;">C++ Program</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-inputoutput-operation.html"><span style="font-size:100%;color:green;">C++ cout, cin, endl</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-variable.html"><span style="font-size:100%;color:green;">C++ Variable</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/variable-scope-in-c-language.html"><span style="font-size:100%;color:green;">C++ Variable Scope</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/constants-c-programming-language.html"><span style="font-size:100%;color:green;">C++ Constants</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/storage-classes-in-c-language.html"><span style="font-size:100%;color:green;">C++ Storage Classes</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-data-types.html"><span style="font-size:100%;color:green;">C++ Data types</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/reserved-words-or-keywords-in-c.html"><span style="font-size:100%;color:green;">C++ Keywords</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/operators-in-c.html"><span style="font-size:100%;color:green;">C++ Operators</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-identifiers.html"><span style="font-size:100%;color:green;">C++ Identifiers</span></a></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-control-statement-c-control-statement.html"><span style="font-size:100%;color:green;">C++ Control Statement</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Functions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Arrays</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Pointers</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Object Class</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Inheritance</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Polymorphism</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Abstraction</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Namespaces</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Strings</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Exceptions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Templates</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">Signal Handling</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ File & Stream</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Misc</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ STL Tutorial</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Iterators</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4></li>
</ul></div>
<div class="col-6 col-s-9">
<h2><span style="color:blue;">Constants c++ programming language.</span></h2><br />
<p style="text-align: justify;text-indent: 30px;">Constant does not change during the execution of the program.Constants refer to fixed values that the program may not modify and they are called literals.</p>
<p style="text-align: justify;text-indent: 30px;">How to declare constant? Let's look at the first of its various methods with examples. In which we will declare constant variable using const keyword.</p>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<br />
<br />
<pre><div class="r">
#include <iostream>
using namespace std;
int main()
{
const float PI = 3.14;
cout<<"Value of PI "<<PI;
return 0;
}
</div></pre>
<h5><strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Value of PI 3.14
</div></pre>
<p style="text-align: justify;text-indent: 30px;">If you talk about constant in the above program, now you can not change the value of PI = 3.14 again anywhere in the program. If you remove the const keyword then the value of the variable will never change the value. Can not change run time and compile time.</p>
<h3><span style="color:blue;">#define constants</span></h3>
<pre><div class="r">
#include <iostream>
using namespace std;
#define PI 3.14
int main()
{
cout<<" Value of PI: "<<PI;
return 0;
}
</div></pre>
<h5><strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Value of PI: 3.14
</div></pre>
<p style="text-align: justify;text-indent: 30px;">Wherever you use PI. Which you understand that where you are writing PI, you are not writing PI value 3.14, that is, when you process your code to compile, the compiler will get constant value instead of PI. </p>
<br />
<div><script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div><br />
<br />
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.com48026 Russi, Province of Ravenna, Italy44.3720066 12.041361616.061770715197579 -23.114891082209013 72.682242484802416 47.197614282209017tag:blogger.com,1999:blog-1379540133641115331.post-78485828722058081922020-08-07T19:23:00.003-07:002020-08-13T19:49:44.097-07:00Variable Scope in C++ language. <div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">C++ Programming Tutorial</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4></li>
<li><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Home</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-difference-between-c-and-c-c-c_4.html"><span style="font-size:100%;color:green;">C vs C++</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/introduction-to-c-c.html"><span style="font-size:100%;color:green;">C++ History</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-features.html"><span style="font-size:100%;color:green;">C++ Features</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/how-to-make-first-program-of-c.html"><span style="font-size:100%;color:green;">C++ Program</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-inputoutput-operation.html"><span style="font-size:100%;color:green;">C++ cout, cin, endl</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-variable.html"><span style="font-size:100%;color:green;">C++ Variable</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/variable-scope-in-c-language.html"><span style="font-size:100%;color:green;">C++ Variable Scope</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/constants-c-programming-language.html"><span style="font-size:100%;color:green;">C++ Constants</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/storage-classes-in-c-language.html"><span style="font-size:100%;color:green;">C++ Storage Classes</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-data-types.html"><span style="font-size:100%;color:green;">C++ Data types</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/reserved-words-or-keywords-in-c.html"><span style="font-size:100%;color:green;">C++ Keywords</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/operators-in-c.html"><span style="font-size:100%;color:green;">C++ Operators</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-identifiers.html"><span style="font-size:100%;color:green;">C++ Identifiers</span></a></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-control-statement-c-control-statement.html"><span style="font-size:100%;color:green;">C++ Control Statement</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Functions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Arrays</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Pointers</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Object Class</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Inheritance</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Polymorphism</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Abstraction</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Namespaces</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Strings</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Exceptions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Templates</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">Signal Handling</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ File & Stream</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Misc</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ STL Tutorial</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Iterators</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4></li>
</ul></div>
<div class="col-6 col-s-9">
<h2><span style="color:blue;">Variable Scope in C++ language. </span></h2><br />
<p style="text-align: justify;text-indent: 30px;">There are three places, where variables can be declared.</p>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<br />
<ol type="1" start="1">
<li><p style="text-align: justify;text-indent: 10px;">Local variables.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Global variables.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Formal parameters.</p></li>
</ol><br />
<h3><span style="color:blue;">1.Local variables.</span></h3>
<p style="text-align: justify;text-indent: 30px;">Variables that are declared inside a function or block are local variables. They are not used outside of a function.</p>
<pre><div class="r" style="color:green;">
void function1()
{
int x=10;//local variable
}
</div></pre>
<h3><span style="color:blue;">2.Global variables</span></h3>
<p style="text-align: justify;text-indent: 30px;">A variable that is declared outside the function or block is called a global variable. Any function can change the value of the global variable. It is available to all the functions.</p>
<pre><div class="r" style="color:green;">
int value=20;//global variable
void function1()
{
int x=10;//local variable
}
</div></pre>
<pre><div class="r">
#include <iostream>
using namespace std;
// Global variable declaration:
int p;
int main () {
// Local variable declaration:
int x, y;
// actual initialization
x = 10;
y = 20;
p = x + y;
cout << p;
return 0;
}
</div></pre>
<h3><span style="color:blue;">Initializing Local and Global Variables</span></h3>
<p style="text-align: justify;text-indent: 30px;">A local variable is not initialized by the system, you must initialize it yourself. Global variables are initialized automatically by the system. They are.</p>
<table width="100%" class="r10">
<tr style="border: 1px solid black;">
<th style="border: 1px solid black;">Data Type</th>
<th style="border: 1px solid black;">Initialize</th>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">int</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">char</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">'\0'</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">float</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">double</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">0</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">pointer</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">NULL</p></td>
</tr>
</table>
<h3><span style="color:blue;">3.Formal parameters.</span></h3>
<p style="text-align: justify;text-indent: 30px;">The identifier used in a method to stand for the value that is passed into the method by a caller.</p>
<br />
<div><script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div><br />
<br />
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comUnited States37.09024 -95.7128918.7800041151975812 -130.86914368220903 65.400475884802418 -60.556638317790984tag:blogger.com,1999:blog-1379540133641115331.post-2838836008307020202020-08-07T19:01:00.006-07:002020-08-13T19:50:27.549-07:00What is Variable? <div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">C++ Programming Tutorial</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4></li>
<li><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Home</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-difference-between-c-and-c-c-c_4.html"><span style="font-size:100%;color:green;">C vs C++</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/introduction-to-c-c.html"><span style="font-size:100%;color:green;">C++ History</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-features.html"><span style="font-size:100%;color:green;">C++ Features</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/how-to-make-first-program-of-c.html"><span style="font-size:100%;color:green;">C++ Program</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-inputoutput-operation.html"><span style="font-size:100%;color:green;">C++ cout, cin, endl</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-variable.html"><span style="font-size:100%;color:green;">C++ Variable</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/variable-scope-in-c-language.html"><span style="font-size:100%;color:green;">C++ Variable Scope</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/constants-c-programming-language.html"><span style="font-size:100%;color:green;">C++ Constants</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/storage-classes-in-c-language.html"><span style="font-size:100%;color:green;">C++ Storage Classes</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-data-types.html"><span style="font-size:100%;color:green;">C++ Data types</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/reserved-words-or-keywords-in-c.html"><span style="font-size:100%;color:green;">C++ Keywords</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/operators-in-c.html"><span style="font-size:100%;color:green;">C++ Operators</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-identifiers.html"><span style="font-size:100%;color:green;">C++ Identifiers</span></a></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-control-statement-c-control-statement.html"><span style="font-size:100%;color:green;">C++ Control Statement</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Functions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Arrays</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Pointers</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Object Class</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Inheritance</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Polymorphism</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Abstraction</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Namespaces</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Strings</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Exceptions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Templates</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">Signal Handling</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ File & Stream</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Misc</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ STL Tutorial</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Iterators</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4></li>
</ul></div>
<div class="col-6 col-s-9">
<h2><span style="color:blue;">What is Variable?</span></h2><br />
<p style="text-align: justify;text-indent: 30px;">The Variable is also the name of a memory location. It stores the values of data types. Its value can be changed and it can be reused many times.</p>
<p style="text-align: justify;text-indent: 30px;"></p>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<br />
<br />
<h3><span style="color:blue;">Rules for the variable name.</span></h3>
<ol type="1" start="1">
<li><p style="text-align: justify;text-indent: 10px;">It is case-sensitive. For eg int 'a' and int 'A' these are different variables.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">A variable starts with any alphabet (a-z, A-Z) or underscore (_). But didn't start with a digit.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">A Variables can be named alphanumeric and '_'. For eg. a1 = 5, var1, var2,_var3.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">The variable does not allow white space.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">The variable name is not any C ++ keywords name.</p></li>
</ol><br />
<h3><span style="color:blue;">The syntax for the Variable Declaration.</span></h3>
<pre><div class="r" style="color:green;">
type variable_list;
</div></pre>
<h3><span style="color:blue;">The declaring a variable is given below.</span></h3>
<pre><div class="r" style="color:green;">
int x;
float y;
char ch;
</div></pre>
<p style="text-align: justify;text-indent: 30px;">Here x, y and ch are variables, and int, float, char are data types.</p>
<h3><span style="color:blue;">For example:</span></h3>
<pre><div class="r" style="color:green;">
int x;
int y;
</div></pre>
<p style="text-align: justify;text-indent: 30px;">Then declare as int x, y; are Same data type variables.</p>
<pre><div class="r" style="color:green;">
int x;
float y;
</div></pre>
<p style="text-align: justify;text-indent: 30px;">The declare as int x and float y. Different data type variables.</p>
<h3><span style="color:blue;">We can also provide values while declaring the variables as given below:</span></h3>
<pre><div class="r" style="color:green;">
int x=10,y=20; //declaring 2 variable of integer type
float ft=30.8; //declaring 1 variable of float type
char ch='P'; //declaring 1 variable of char type
</div></pre>
<h3><span style="color:blue;">Valid variable names:</span></h3>
<pre><div class="r" style="color:green;">
int x;
int _xy;
int p31;
float m;
float _pq;
float r36;
char c;
char _ch;
char c31;
</div></pre>
<h3><span style="color:blue;">Invalid variable names:</span></h3>
<pre><div class="r" style="color:green;">
int 20; // A variable name didn't start with a digit.
int x y; // A variable does not allow white space.
int char; // A variable name is not any C ++ keywords name.
</div></pre>
<h3><span style="color:blue;">Declaration and initialization of C++ Variable.</span></h3>
<p style="text-align: justify;text-indent: 30px;">When Variable declare, then this variable allocates memory according to the data type.After being a variable declare, it takes a Garbage Value inside itself.</p>
<p style="text-align: justify;text-indent: 30px;">Garbage Value: Garbage Value Variable is given by the Compiler.</p>
<pre><div class="r">
#include <iostream>
using namespace std;
int main(){
int number;
cout<<"Value of number : "<<number;
return 0;
}
</div></pre>
<h5><strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Value of number : 4354190
</div></pre>
<p style="text-align: justify;text-indent: 30px;"><mark>Note:</mark> Here 4354190 is a garbage value.</p>
<pre><div class="r">
#include <iostream>
using namespace std;
int main(){
int no1, no2, no3;
cout<<"Value of no1 : "<<no1<<endl;
cout<<"Value of no2 : "<<no2<<endl;
cout<<"Value of no3 : "<<no3<<endl;
return 0;
}
</div></pre>
<h5><strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Value of no1 : 4354318
Value of no2 : 2293652
Value of no3 : 4354224
</div></pre>
<p style="text-align: justify;text-indent: 30px;"><mark>Note:</mark> Here no1,no2 and no3 variables are store garbage value respectively 4354318, 2293652 and 4354224.</p>
<h3><span style="color:blue;">Variable Initialization</span></h3>
<p style="text-align: justify;text-indent: 30px;">When Variable initializes, then this variable allocates memory, according to the data type it is. For eg. int for 2bytes (16-bit) | 4bytes (32-bit) | 8bytes (64-bit).</p>
<p style="text-align: justify;text-indent: 30px;">In variable initialization, a variable takes only one value for eg. int x = 5;</p>
<pre><div class="r">
#include <iostream>
using namespace std;
int main()
{
int number1 = 5, number2 = 6;
cout<<"Value of number1 : "<< number1<<endl;
cout<<"Value of number1 : "<< number2;
return 0;
}
</div></pre>
<h5><strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Value of number1 : 5
Value of number1 : 6
</div></pre>
<br />
<div><script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div><br />
<br />
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-7.7165518848024206 43.806627317790984 48.90391988480242 114.11913268220901tag:blogger.com,1999:blog-1379540133641115331.post-19164584490597093382020-08-06T06:55:00.006-07:002020-08-13T19:51:01.417-07:00C++ Input/Output operation. <div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">C++ Programming Tutorial</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4></li>
<li><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Home</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-difference-between-c-and-c-c-c_4.html"><span style="font-size:100%;color:green;">C vs C++</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/introduction-to-c-c.html"><span style="font-size:100%;color:green;">C++ History</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-features.html"><span style="font-size:100%;color:green;">C++ Features</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/how-to-make-first-program-of-c.html"><span style="font-size:100%;color:green;">C++ Program</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-inputoutput-operation.html"><span style="font-size:100%;color:green;">C++ cout, cin, endl</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-variable.html"><span style="font-size:100%;color:green;">C++ Variable</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/variable-scope-in-c-language.html"><span style="font-size:100%;color:green;">C++ Variable Scope</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/constants-c-programming-language.html"><span style="font-size:100%;color:green;">C++ Constants</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/storage-classes-in-c-language.html"><span style="font-size:100%;color:green;">C++ Storage Classes</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-data-types.html"><span style="font-size:100%;color:green;">C++ Data types</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/reserved-words-or-keywords-in-c.html"><span style="font-size:100%;color:green;">C++ Keywords</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/operators-in-c.html"><span style="font-size:100%;color:green;">C++ Operators</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-identifiers.html"><span style="font-size:100%;color:green;">C++ Identifiers</span></a></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-control-statement-c-control-statement.html"><span style="font-size:100%;color:green;">C++ Control Statement</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Functions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Arrays</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Pointers</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Object Class</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Inheritance</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Polymorphism</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Abstraction</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Namespaces</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Strings</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Exceptions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Templates</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">Signal Handling</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ File & Stream</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Misc</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ STL Tutorial</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Iterators</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4></li>
</ul></div>
<div class="col-6 col-s-9">
<h2><span style="color:blue;">C++ Input/Output operation</span></h2><br />
<p style="text-align: justify;text-indent: 30px;">As in c language use scanf () for input and printf () functions for output.Similarly, we use cin >> for input in c ++ and cout << for output.</p>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<br />
<br />
<h3><span style="color:blue;">Input/Output Library Header Files</span></h3>
<table width="100%" class="r10">
<tr style="border: 1px solid black;">
<th style="border: 1px solid black;width:20%;">Header File</th>
<th style="border: 1px solid black;">Function and Description</th>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;"><iostream></p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">It is used to define the cout, cin and cerr objects, which correspond to the standard output stream, a standard input stream and standard error stream.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;"><iomanip></p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">It is used to declare services useful for performing formatted I/O, such as set precision and set.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;"><fstream></p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">It is used to declare services for user-controlled file processing.</p></td>
</tr>
</table>
<h3><span style="color:blue;">cout (output stream)</span></h3>
<p style="text-align: justify;text-indent: 30px;">cout => cout means console output. This is the object of the iostream class.</p>
<p style="text-align: justify;text-indent: 30px;"><< => This is called output operator, insertion operator.</p>
<pre><div class="r">
#include <iostream>
using namespace std;
int main( )
{
char array[] = "Welcome to C++ programming.";
cout << "Display name : " << array << endl;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Display name : Welcome to C++ programming.
</div></pre>
<h3><span style="color:blue;">cin (input stream)</span></h3>
<p style="text-align: justify;text-indent: 30px;">cin => cin means console input. This is the object of the iostream class.</p>
<p style="text-align: justify;text-indent: 30px;">>> => It is called input operator, extraction operator.</p>
<pre><div class="r">
#include <iostream>
using namespace std;
int main( )
{
char name[31];
cout << "Enter your name: ";
cin >> name;
cout << "Your name is: " << name << endl;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter your name: rama
Your name is: rama
</div></pre>
<h3><span style="color:blue;">endl (End line).</span></h3>
<p style="text-align: justify;text-indent: 30px;">The endl is used to insert a new line characters and flushes the stream.</p>
<pre><div class="r">
#include <iostream>
using namespace std;
int main( )
{
cout << "C++ programming Tutorial";
cout << " cprogramming"<<endl;
cout << "End of line"<<endl;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
C++ programming Tutorial cprogramming
End of line
</div></pre>
<br />
<div><script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div><br />
<br />
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-7.7165518848024206 43.806627317790984 48.90391988480242 114.11913268220901tag:blogger.com,1999:blog-1379540133641115331.post-980826056448568422020-08-06T04:50:00.002-07:002020-08-13T19:51:35.827-07:00How to make the first program of C ++? <div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">C++ Programming Tutorial</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4></li>
<li><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Home</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-difference-between-c-and-c-c-c_4.html"><span style="font-size:100%;color:green;">C vs C++</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/introduction-to-c-c.html"><span style="font-size:100%;color:green;">C++ History</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-features.html"><span style="font-size:100%;color:green;">C++ Features</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/how-to-make-first-program-of-c.html"><span style="font-size:100%;color:green;">C++ Program</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-inputoutput-operation.html"><span style="font-size:100%;color:green;">C++ cout, cin, endl</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-variable.html"><span style="font-size:100%;color:green;">C++ Variable</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/variable-scope-in-c-language.html"><span style="font-size:100%;color:green;">C++ Variable Scope</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/constants-c-programming-language.html"><span style="font-size:100%;color:green;">C++ Constants</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/storage-classes-in-c-language.html"><span style="font-size:100%;color:green;">C++ Storage Classes</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-data-types.html"><span style="font-size:100%;color:green;">C++ Data types</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/reserved-words-or-keywords-in-c.html"><span style="font-size:100%;color:green;">C++ Keywords</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/operators-in-c.html"><span style="font-size:100%;color:green;">C++ Operators</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-identifiers.html"><span style="font-size:100%;color:green;">C++ Identifiers</span></a></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-control-statement-c-control-statement.html"><span style="font-size:100%;color:green;">C++ Control Statement</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Functions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Arrays</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Pointers</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Object Class</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Inheritance</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Polymorphism</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Abstraction</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Namespaces</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Strings</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Exceptions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Templates</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">Signal Handling</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ File & Stream</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Misc</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ STL Tutorial</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Iterators</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4></li>
</ul></div>
<div class="col-6 col-s-9">
<h2><span style="color:blue;">How to make the first program of C ++?</span></h2><br />
<p style="text-align: justify;text-indent: 30px;">The C ++ program is a collection of statements and comments. Let's look at the first C ++ program.</p>
<p style="text-align: justify;text-indent: 30px;">Download Turbo C++ software.</p>
<p style="text-align: justify;text-indent: 30px;">Download turbo C++ from many sites and click here. <a href="https://www.filehorse.com/download-turbo-c/" rel="nofollow" target="_blank">Download Turbo c++</a></p>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<br />
<pre><div class="r">
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
cout<<"Welcome to the C++ program.";
getch();
return 0;
}
</div></pre>
<h5><strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Welcome to the C++ program.
</div></pre>
<h3><span style="color:blue;">#include<iostream.h></span></h3>
<p style="text-align: justify;text-indent: 30px;">The command to include the iostream header, which is used for cin/cout.iostream stands for input/output stream, allowing you to access the output screen or allow the user input.</p>
<h3><span style="color:blue;">#include <conio.h></span></h3>
<p style="text-align: justify;text-indent: 30px;">It allows you to access the user screen, but it's used for specific purposes (getch () to hold the output screen in Turboc++, and clrscr to clear the output screen).</p>
<h3><span style="color:blue;">cout << "Welcome to C++ Programming."</span></h3>
<p style="text-align: justify;text-indent: 30px;">It is used to print the data "Welcome to C++ Programming." on the console. When running the program and display it on the console.</p>
<h3><span style="color:blue;">How to compile and run the C++ program using Turbo C++ software.</span></h3>
<p style="text-align: justify;text-indent: 30px;">There are two ways.</p>
<ol type="1" start="1">
<li><p style="text-align: justify;text-indent: 10px;">By menu.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">By shortcut keys.</p></li>
</ol><br />
<h3><span style="color:blue;">1.By menu.</span></h3>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6XR1fLoBuOmpIb0FK6eZH3lnBMEkkkzXBXHrjUj6fQSg-D-QV6gDribaQZtS-SOjZk1SdMvG-brzEr1hQvWpNBuKY1qD2BsT_U1KeTMKpOpga8ph0uzMJQrwfx4AOIl4n-dHO7fM3utbb/s639/compile.png" imageanchor="1" style="display: block; margin-left: auto; margin-right: auto; padding: 1em 0px;"><img alt="c++ compiler download" border="0" data-original-height="422" data-original-width="639" height="423" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6XR1fLoBuOmpIb0FK6eZH3lnBMEkkkzXBXHrjUj6fQSg-D-QV6gDribaQZtS-SOjZk1SdMvG-brzEr1hQvWpNBuKY1qD2BsT_U1KeTMKpOpga8ph0uzMJQrwfx4AOIl4n-dHO7fM3utbb/w640-h423/compile.png" title="c++ compiler download" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">C++ compile</td></tr></tbody></table><br>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwY7-ypL3CjdxE0jhH4A-bmtdBaz_xxTDE6bU9XApQhA3V-YxxMplIkMDOTbHL9pKePXhKR7GPJRtLjvSQtn5yIBnWSbJTXD2zgdF-mh9EROff1N6neFRPdjKrlSwEihnfe5EDNoIbzF_T/s641/Run.png" imageanchor="1" style="display: block; margin-left: auto; margin-right: auto; padding: 1em 0px;"><img alt="c++ compiler" border="0" data-original-height="418" data-original-width="641" height="416" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwY7-ypL3CjdxE0jhH4A-bmtdBaz_xxTDE6bU9XApQhA3V-YxxMplIkMDOTbHL9pKePXhKR7GPJRtLjvSQtn5yIBnWSbJTXD2zgdF-mh9EROff1N6neFRPdjKrlSwEihnfe5EDNoIbzF_T/w640-h416/Run.png" title="c++ compiler" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Run<br /></td></tr></tbody></table>
<h3><span style="color:blue;">2.By shortcut keys.</span></h3>
<ol type="1" start="1">
<li><p style="text-align: justify;text-indent: 10px;">Alt+F9 -> compile.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">ctrl+f9 -> Run.</p></li>
</ol><br />
<h3><span style="color:blue;">Download code blocks software.</span></h3>
<p style="text-align: justify;text-indent: 30px;">Download code blocks from site, click here. <a href="http://www.codeblocks.org/" rel="nofollow" target="_blank">Download code blocks software</a></p>
<pre><div class="r">
#include<iostream>
using namespace std;
int main()
{
cout<<"Welcome to the C++ program.";
return 0;
}
</div></pre>
<h5><strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Welcome to the C++ program.
</div></pre>
<h3><span style="color:blue;">Let's separate this whole program and know about all its parts.</span></h3>
<h3><span style="color:blue;">1. #include<iostream></span></h3>
<p style="text-align: justify;text-indent: 30px;">C ++ offers a variety of headers, with each header containing relevant information for programs to work properly. This particular program is called the header. And the number sign # that is placed at the beginning of the program is used to target the compiler preprocessor. In this case, #include tells the preprocessor to include the header. Note The header defines the standard stream objects that act to input and output data. The C ++ compiler ignores the free space. In general, you can use the empty space to make the program code readable and its good structure. In the above program.</p>
<h3><span style="color:blue;">2.using namespace std;</span></h3>
<pre><div class="r" style="color:green;">
Must have seen so
using namespace std;
</div></pre>
<p style="text-align: justify;text-indent: 30px;">Tells the compiler to use the standard namespace. The std namespace includes the features of the C ++ Standard Library. The execution of the program starts with main function, int main (), and the entry point of any C ++ program is main () no matter what the program does. Curly brackets {} display the beginning and end of the function, also known as the function body. Information written inside curly brackets {} shows what the function will do when it executes. Next line,</p>
<h3><span style="color:blue;">3.cout<<"Welcome to the C++ program.";</span></h3>
<p style="text-align: justify;text-indent: 30px;">We make it to print in the "Welcome to the C ++ program" display. In C ++, streams are used to perform input and output operations. In most programming environments, the screen is the standard Default output destination. In C ++, cout is the stream object that is used to access it. The cout is used as a combination with the insertion operator. The insertion operator is written as <<. After this, the letters written on the screen are visible to us. Note: In C ++, semicolon (;) is used to terminate the statement. As you saw (cout << "THIS IS MY FIRST C ++ PROGRAM";) here. Each statement ends with a semicolon (;). This represents the end of a logical expression.</p>
<h3><span style="color:blue;">What are Statements?</span></h3>
<p style="text-align: justify;text-indent: 30px;">A block is a set of logically connected staments. Surrounded by opening {and closing} braces. like:</p>
<pre><div class="r" style="color:green;">
{
cout<<"Welcome to the C++ program.";
return 0;
}
</div></pre>
<p style="text-align: justify;text-indent: 30px;"><mark>Note:</mark> You can write multiple statements on a single line. But you have to keep in mind that at the end of each statement you have to terminate it with a semicolon. If you do not put a semi column, the program will be an error.</p>
<h3><span style="color:blue;">4.What is the return or what is the use of return?</span></h3>
<p style="text-align: justify;text-indent: 30px;">Last instruction return statement is in the program. Line return 0; terminates the main () function, and returns the value zero to the calling process. A value other than zero indicates that the program has an abnormal termination. If the return statement is not written then the C ++ compiler implicitly returns 0; Inserts it at the end of the function.</p>
<br />
<div><script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div><br />
<br />
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-7.7165518848024206 43.806627317790984 48.90391988480242 114.11913268220901tag:blogger.com,1999:blog-1379540133641115331.post-35752143392523144722020-08-04T23:15:00.004-07:002020-08-13T19:52:09.587-07:00C++ Features. | सी ++ सुविधाएँ।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">C++ Programming Tutorial</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4></li>
<li><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Home</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-difference-between-c-and-c-c-c_4.html"><span style="font-size:100%;color:green;">C vs C++</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/introduction-to-c-c.html"><span style="font-size:100%;color:green;">C++ History</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-features.html"><span style="font-size:100%;color:green;">C++ Features</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/how-to-make-first-program-of-c.html"><span style="font-size:100%;color:green;">C++ Program</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-inputoutput-operation.html"><span style="font-size:100%;color:green;">C++ cout, cin, endl</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-variable.html"><span style="font-size:100%;color:green;">C++ Variable</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/variable-scope-in-c-language.html"><span style="font-size:100%;color:green;">C++ Variable Scope</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/constants-c-programming-language.html"><span style="font-size:100%;color:green;">C++ Constants</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/storage-classes-in-c-language.html"><span style="font-size:100%;color:green;">C++ Storage Classes</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-data-types.html"><span style="font-size:100%;color:green;">C++ Data types</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/reserved-words-or-keywords-in-c.html"><span style="font-size:100%;color:green;">C++ Keywords</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/operators-in-c.html"><span style="font-size:100%;color:green;">C++ Operators</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-identifiers.html"><span style="font-size:100%;color:green;">C++ Identifiers</span></a></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-control-statement-c-control-statement.html"><span style="font-size:100%;color:green;">C++ Control Statement</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Functions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Arrays</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Pointers</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Object Class</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Inheritance</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Polymorphism</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Abstraction</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Namespaces</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Strings</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Exceptions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Templates</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">Signal Handling</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ File & Stream</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Misc</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ STL Tutorial</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Iterators</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4></li>
</ul></div>
<div class="col-6 col-s-9">
<h2><span style="color:blue;">C++ Features.</span></h2><br />
<p style="text-align: justify;text-indent: 30px;">All programs in C ++ can be written in simple English language. So that it is easy to understand and develop by the programmer.</p>
<p style="text-align: justify;text-indent: 30px;">It is the concept of moving instructions from one system to another. In the C ++ language, the .cpp file contains the source code. We can also edit this code.</p>
<p style="text-align: justify;text-indent: 30px;">When we copy the .exe file to another computer. Which has a window operating system? So it works properly. Because the basic code of the application is similar to an operating system.</p>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<br />
<br />
<h3><span style="color:blue;">C ++ provides many features which are given below.</span></h3>
<ol type="1" start="1">
<li><p style="text-align: justify;text-indent: 10px;">Simple.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Machine Independent or Portable.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Mid-level programming language.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Structured programming language.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Rich Library.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Memory Management.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Fast Speed.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Pointers.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Recursion.</p></li>
<li><p style="text-align: justify;text-indent: 10px;">Object Oriented</p></li>
</ol><br />
<br />
<div><script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div><br />
<br />
<h3><span style="color:blue;">Simple.</span></h3>
<p style="text-align: justify;text-indent: 30px;">C ++ is a simple programming language in the sense that it provides a structured approach, rich set of library functions, data types etc.</p>
<h3><span style="color:blue;">Machine Independent or Portable.</span></h3>
<p style="text-align: justify;text-indent: 30px;">The c ++ program can be executed in multiple machines. But it is not platform-independent.</p>
<h3><span style="color:blue;">Mid-level programming language.</span></h3>
<p style="text-align: justify;text-indent: 30px;">C++ language binds the gap between machine-understandable Machine level language and High-level languages. C++ language can be used to write system programming like an operating system as well as an application program like the spreadsheet, the word processor that’s why it is called middle-level language. C++ combine the elements of high-level languages with the functionality of assembly language.</p>
<h3><span style="color:blue;">Structured programming language.</span></h3>
<p style="text-align: justify;text-indent: 30px;">C++ is a structured programming language that we can break the program divided into parts using functions. So, it is easy to understand and modify any program.</p>
<h3><span style="color:blue;">Rich Library.</span></h3>
<p style="text-align: justify;text-indent: 30px;">There are many functions available through the C ++ Standard Template Library (STL) that help in writing code quickly. For example, there are standard libraries for different containers such assets, maps, hash tables, etc.</p>
<h3><span style="color:blue;">Memory Management.</span></h3>
<p style="text-align: justify;text-indent: 30px;">C ++ allows us to allocate memory of a variable or an array at run time. This is known as dynamic memory allocation. In other programming languages such as Java and Python, the compiler automatically manages memories assigned to variables.</p>
<h3><span style="color:blue;">Fast Speed.</span></h3>
<p style="text-align: justify;text-indent: 30px;">The compilation and execution time of the C++ language is fast.</p>
<h3><span style="color:blue;">Pointers.</span></h3>
<p style="text-align: justify;text-indent: 30px;">The memory address of Variable can be directly accessed through Pointer. The pointer is a data type like the other data type which takes an address for itself in memory. The following are some of the Pointer Value used in C ++.</p>
<h3><span style="color:blue;">Recursion.</span></h3>
<p style="text-align: justify;text-indent: 30px;">The function in which the same function is called recursion. Recursion is a process that works like a loop. Recursion seems to be a satisfying condition so that the recursive function stops working. The Recursive Function keeps calling until its satisfaction is reached. If the recursive function is not satisfied, then there is a possibility of infinite looping.</p>
<h3><span style="color:blue;">Object-Oriented.</span></h3>
<p style="text-align: justify;text-indent: 30px;">C ++ is an object-oriented programming language. This means that the focus on these objects is on "objects" and manipulations. Information about the work of these manipulations is passed on to the consumer of the item.</p>
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-7.7165518848024206 43.806627317790984 48.90391988480242 114.11913268220901tag:blogger.com,1999:blog-1379540133641115331.post-55228483730188617312020-08-04T22:24:00.002-07:002020-08-13T19:52:56.040-07:00Introduction to C++. | C ++ का परिचय।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">C++ Programming Tutorial</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4></li>
<li><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Home</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-difference-between-c-and-c-c-c_4.html"><span style="font-size:100%;color:green;">C vs C++</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/introduction-to-c-c.html"><span style="font-size:100%;color:green;">C++ History</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-features.html"><span style="font-size:100%;color:green;">C++ Features</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/how-to-make-first-program-of-c.html"><span style="font-size:100%;color:green;">C++ Program</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-inputoutput-operation.html"><span style="font-size:100%;color:green;">C++ cout, cin, endl</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-variable.html"><span style="font-size:100%;color:green;">C++ Variable</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/variable-scope-in-c-language.html"><span style="font-size:100%;color:green;">C++ Variable Scope</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/constants-c-programming-language.html"><span style="font-size:100%;color:green;">C++ Constants</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/storage-classes-in-c-language.html"><span style="font-size:100%;color:green;">C++ Storage Classes</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-data-types.html"><span style="font-size:100%;color:green;">C++ Data types</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/reserved-words-or-keywords-in-c.html"><span style="font-size:100%;color:green;">C++ Keywords</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/operators-in-c.html"><span style="font-size:100%;color:green;">C++ Operators</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-identifiers.html"><span style="font-size:100%;color:green;">C++ Identifiers</span></a></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-control-statement-c-control-statement.html"><span style="font-size:100%;color:green;">C++ Control Statement</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Functions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Arrays</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Pointers</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Object Class</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Inheritance</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Polymorphism</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Abstraction</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Namespaces</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Strings</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Exceptions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Templates</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">Signal Handling</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ File & Stream</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Misc</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ STL Tutorial</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Iterators</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4></li>
</ul></div>
<div class="col-6 col-s-9">
<h2><span style="color:blue;">Introduction to C++</span></h2><br />
<p style="text-align: justify;text-indent: 30px;">C ++ It is known as a middle-level language. C ++ was developed by Bjarne stroustrup. Because it is a combination of features of high level and low-level language.</p>
<p style="text-align: justify;text-indent: 30px;">C ++ is an object-oriented programming language. It was started at Bell laboratories of AT&T (American Telephone & Telegraph), located in the U.S.A in 1979 as an enhancement of the C language developed by Jar Sterpop. The original name of this language was Sea with Classes, which was changed to C ++ in 1983.</p>
<p style="text-align: justify;text-indent: 30px;">C ++ has been standardized by the International Organization for Standardization (ISO). C ++ programming language was standardized in 1998. And was later revised by the C ++ 03, C ++ 11 and C ++ 14 Standards.</p>
<p style="text-align: justify;text-indent: 30px;">It was developed to add a feature of OOP (Object Oriented Programming) to C without significant changes to the C component.</p>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<br />
<br />
<h3><span style="color:blue;">Object Oriented Principles in C++</span></h3>
<p style="text-align: justify;text-indent: 30px;">The object-oriented principle to be used in the C ++ language is being described below.</p>
<h3><span style="color:blue;">Class</span></h3>
<p style="text-align: justify;text-indent: 30px;">Class is a user-defined data structure. And class is also like structure. In which we can create variables as well as functions. And later they are accessed by objects.</p>
<h3><span style="color:blue;">Objects</span></h3>
<p style="text-align: justify;text-indent: 30px;">As I told you, Class is a user-defined structure. And the variables of the class are called objects. Through Object, you can access the variables and functions of the class.</p>
<h3><span style="color:blue;">Abstraction</span></h3>
<p style="text-align: justify;text-indent: 30px;">Abstraction is such a part of object-oriented programming. In which the same functionality is given to the user. Which is important. For example, suppose you are driving a car, then you will only pay attention to clutch, gear, and steering, how the engine is working. It makes no sense to you. This functionality is only possible through Abstraction.</p>
<h3><span style="color:blue;">Encapsulation</span></h3>
<p style="text-align: justify;text-indent: 30px;">Encapsulation is an object-oriented programming feature. Data and functions are protected from outside access by encapsulation. The encapsulation provides us the protection of Public, Private, Protected. Whenever we make a class. So our class type is by default private.</p>
<h3><span style="color:blue;">Inheritance</span></h3>
<p style="text-align: justify;text-indent: 30px;">Inheritance is the concept of object-oriented programming. In which a code can be used very easily by Inheritance elsewhere. For example, suppose you created a class. And you want to use the functions in that class in another class. So you can Inherit can do.</p>
<h3><span style="color:blue;">Polymorphism</span></h3>
<p style="text-align: justify;text-indent: 30px;">With polymorphism, you can perform many types of tasks from one function. Polymorphism is implemented by an overloading function in C ++. In which different operations are performed by a function.</p>
<h3><span style="color:blue;">Message Passing</span></h3>
<p style="text-align: justify;text-indent: 30px;">Message passing is a type of communication between procedures. Parallel programming and object-oriented are a form of communication used in programming.</p>
<h3><span style="color:blue;">Programming languages that were developed before the C ++ language.</span></h3>
<table width="100%" class="r10">
<tr style="border: 1px solid black;">
<th style="border: 1px solid black;">Language</th>
<th style="border: 1px solid black;">Year</th>
<th style="border: 1px solid black;">Developed By</th>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Algol</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1960</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">International Group</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">BCPL</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1967</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Martin Richard</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">B</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1970</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Ken Thompson</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Traditional C</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1972</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Dennis Ritchie</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">K & R C</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1978</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Kernighan & Dennis Ritchie</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">C++</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">1980</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Bjarne Stroustrup</p></td>
</tr>
</table>
<br />
<div><script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div><br />
<br />
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-7.7165518848024206 43.806627317790984 48.90391988480242 114.11913268220901tag:blogger.com,1999:blog-1379540133641115331.post-74174648695739918322020-08-04T21:12:00.002-07:002020-08-13T19:53:30.681-07:00What is the difference between C and C ++. | C और C ++ में क्या अंतर है।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">C++ Programming Tutorial</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4></li>
<li><a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Home</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-difference-between-c-and-c-c-c_4.html"><span style="font-size:100%;color:green;">C vs C++</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/introduction-to-c-c.html"><span style="font-size:100%;color:green;">C++ History</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-features.html"><span style="font-size:100%;color:green;">C++ Features</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/how-to-make-first-program-of-c.html"><span style="font-size:100%;color:green;">C++ Program</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-inputoutput-operation.html"><span style="font-size:100%;color:green;">C++ cout, cin, endl</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/what-is-variable.html"><span style="font-size:100%;color:green;">C++ Variable</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/variable-scope-in-c-language.html"><span style="font-size:100%;color:green;">C++ Variable Scope</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/constants-c-programming-language.html"><span style="font-size:100%;color:green;">C++ Constants</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/storage-classes-in-c-language.html"><span style="font-size:100%;color:green;">C++ Storage Classes</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-data-types.html"><span style="font-size:100%;color:green;">C++ Data types</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/reserved-words-or-keywords-in-c.html"><span style="font-size:100%;color:green;">C++ Keywords</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/operators-in-c.html"><span style="font-size:100%;color:green;">C++ Operators</span></a></li>
<li><a href="https://www.cprogramcoding.com/2020/08/c-identifiers.html"><span style="font-size:100%;color:green;">C++ Identifiers</span></a></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-control-statement-c-control-statement.html"><span style="font-size:100%;color:green;">C++ Control Statement</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Functions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Arrays</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-functions-c-arrays-c-pointers-c-arrays.html"><span style="font-size:100%;color:green;">C++ Pointers</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Object Class</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Inheritance</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-object-class-c-inheritance-c.html"><span style="font-size:100%;color:green;">C++ Polymorphism</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Abstraction</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Namespaces</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Strings</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Exceptions</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ Templates</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">Signal Handling</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-abstraction-c-namespaces-c-strings-c.html"><span style="font-size:100%;color:green;">C++ File & Stream</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Misc</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ STL Tutorial</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-misc-c-stl-tutorial.html"><span style="font-size:100%;color:green;">C++ Iterators</span></a></h4></li>
<li><h4><a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4></li>
</ul></div>
<div class="col-6 col-s-9">
<h2><span style="color:blue;">What is the difference between C and C ++.</span></h2><br />
<p style="text-align: justify;text-indent: 30px;">Today we will tell you "What is C and C ++ and what is the difference between them?". With which we hope that you will get answers to your questions.</p>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<br />
<br />
<h3><span style="color:blue;">what is c</span></h3>
<p style="text-align: justify;text-indent: 30px;">C language is a general-purpose programming language known in 1972.</p>
<p style="text-align: justify;text-indent: 30px;">Bell Labs by Dennis Ritchie. Was developed in C Programming Language was created to develop the UNIX operating system.</p>
<p style="text-align: justify;text-indent: 30px;">C programming language was developed to create a system application that directly hardware devices such as kernels, drivers etc. Could easily interact with</p>
<p style="text-align: justify;text-indent: 30px;">C is the basic programming language that can be used for operating programs (such as Windows) to Oracle databases, Git, Python interpreters, and many more complex programs. C programming language can be called the programming language of God as it forms the basis for other programming languages. If we know C language, then we can easily learn other programming languages. The C language was developed by Dennis Ritchie, the great computer scientist at Bell Laboratories. It has some additional features that make it unique from other programming languages.</p>
<h3><span style="color:blue;">what is c++</span></h3>
<h3><span style="color:blue;"></span></h3>
<p style="text-align: justify;text-indent: 30px;">C ++ is a special-purpose programming language developed by Bjarne Stroustrup in 1980 by Bell Labs Circa. The C ++ language is very similar to the C language and is so compatible with C that it can run 99% of C programs without changing any source of the code. C ++ is an object-oriented programming language, so it is a safer and more well-structured programming language than C.</p>
<p style="text-align: justify;text-indent: 30px;">C ++ is a general-purpose programming language. Games, music players, video games, art applications, etc. are made using the C ++ programming language. C ++ is derived from C itself and is largely based on it. C ++ not only remains the programming language of choice for many applications, as new languages ?still do not meet the requirements of many applications, C ++ is regulated by the ANSI standard and developed as a language It happens.</p>
<p style="text-align: justify;text-indent: 30px;"></p>
<p style="text-align: justify;text-indent: 30px;"></p>
<h3><span style="color:blue;">What is the difference between C and C ++</span></h3>
<table width="100%" class="r10">
<tr style="border: 1px solid black;">
<th style="border: 1px solid black;">C</th>
<th style="border: 1px solid black;">C++</th>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Procedure Oriented Programming Language.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Object-oriented Programming language.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Much attention is focused on the procedure.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">More attention is paid to data here than to the procedure.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Here, the program is divided into small groups, which are named as functions.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Here the program is divided into objects.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The function can be shared through global data.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The function can only share the data of the same class.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Data is not safe here, it can be moved here and there through the function.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style=";text-indent: 5px;">The data here are absolutely secure, and it cannot be accessed anywhere through the function.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">In this, the TOP - Bottom Approach is followed.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Here Bottom-Up Approach is followed.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The C function does not support overloading.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">The C ++ function supports overloading.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">In C, you cannot use functions in a structure.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">In C ++, you can use functions in a structure.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">C does not support the reference variance.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">C ++ supports reference variables.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">In C, scanf () and printf () to perform input and output operations.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">C ++ mainly uses Stream Cin and Cout to perform input and output operations.</p></td>
</tr>
<tr>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Operator overloading is not possible in C.</p></td>
<td style="text-align:left;border: 1px solid black;"><p style="text-indent: 5px;">Operator overloading is possible in C++.</p></td>
</tr>
</table>
<br />
<div><script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div><br />
<br />
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-7.7165518848024206 43.806627317790984 48.90391988480242 114.11913268220901tag:blogger.com,1999:blog-1379540133641115331.post-30095433672174603512020-08-02T00:07:00.000-07:002020-08-02T00:07:34.645-07:00C++ Program to calculate the volume and surface of the sphere. | सी + + क्षेत्र की मात्रा और सतह की गणना करने के लिए कार्यक्रम।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">
C++ Exercises</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4>
</li>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4>
</li>
</ul>
</div>
<div class="col-6 col-s-9">
<h2>
<span style="color:blue;">C++ Program to calculate the volume and surface of the sphere.</span></h2>
<p style="text-align: justify;text-indent: 20px;">Let see the program to calculate the volume and surface of the sphere.</p>
<pre><div class="r" style="color:green;">
Example:
<ol type="1">
<li><p style="text-align: justify;text-indent: 0px;">Formula: <br>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh78o2GraTJafRjJ04aD64kqGnQOe0B69LzoxaWDFCkhqbkU_6oQLWpW_ckF5R6iYV1H8H9P6iIeWs1hG1PjfiERCzI5aGXYS6Pxqb_phfnl_NPe0vjXLehc_dNnTiraVMz-hd8MtiSHIvz/s900/sphere.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="surface of sphere and volume of sphere" border="0" data-original-height="205" data-original-width="900" height="145" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh78o2GraTJafRjJ04aD64kqGnQOe0B69LzoxaWDFCkhqbkU_6oQLWpW_ckF5R6iYV1H8H9P6iIeWs1hG1PjfiERCzI5aGXYS6Pxqb_phfnl_NPe0vjXLehc_dNnTiraVMz-hd8MtiSHIvz/w640-h145/sphere.jpg" title="surface of sphere and volume of sphere" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">sphere</td></tr></tbody></table>
</p></li>
</ol>
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins> <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<pre><div class="r">
/* to calculate the volume of the sphere. */
#include <iostream>
using namespace std;
int main()
{
float radius,height,volume;
cout<<"Enter radius of sphere :";
cin>>radius;
volume=(4/3)*(22/7)*radius*radius*radius;
cout<<"volume of sphere = "<<volume<<" units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter radius of sphere :7.5
volume of sphere = 1265.62 units.
</div></pre>
<div>
<script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div>
<pre><div class="r">
/* to calculate the surface of the sphere. */
#include <iostream>
using namespace std;
#include <math.h>
int main()
{
float radius,height,surface;
cout<<"Enter radius of sphere :";
cin>>radius;
surface=4*(22/7)*radius*radius;
cout<<"surface of sphere = "<<surface<<" sq. units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter radius of sphere :2.7
surface of sphere = 87.48 sq. units.
</div></pre>
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comtag:blogger.com,1999:blog-1379540133641115331.post-40828396365650939682020-08-01T22:59:00.005-07:002020-08-01T22:59:47.311-07:00C++ Program to calculate the volume and surface of the Cones. | शंकु की मात्रा और सतह की गणना करने के लिए C ++ प्रोग्राम।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">
C++ Exercises</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4>
</li>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4>
</li>
</ul>
</div>
<div class="col-6 col-s-9">
<h2>
<span style="color:blue;">C++ Program to calculate the volume and surface of the Cones.</span></h2>
<p style="text-align: justify;text-indent: 20px;">Let see the program to calculate the volume and surface of the Cones.</p>
<pre><div class="r" style="color:green;">
Example:
<ol type="1">
<li><p style="text-align: justify;text-indent: 0px;">Formula: <br>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOJlmPZ_iEmgpCMRUPP2yAUtZn1N2EaSJ8HeVClIWVdJPDs2Q-4HpHPDkgejoY4p31qK8VhOt9WTfSFpANGj3aGXTB6759Hr4b_zDVsFysJFpxQrOeFCv1jhvzEvP1aVnIEud8UK1I1V99/s900/Cones.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Surface of Cones and volume of Cones" border="0" data-original-height="287" data-original-width="900" height="204" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOJlmPZ_iEmgpCMRUPP2yAUtZn1N2EaSJ8HeVClIWVdJPDs2Q-4HpHPDkgejoY4p31qK8VhOt9WTfSFpANGj3aGXTB6759Hr4b_zDVsFysJFpxQrOeFCv1jhvzEvP1aVnIEud8UK1I1V99/w640-h204/Cones.jpg" title="Surface of Cones and volume of Cones" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Cones</td></tr></tbody></table>
</p></li>
</ol>
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins> <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<pre><div class="r">
/* to calculate the volume of the Cones. */
#include <iostream>
using namespace std;
int main()
{
float radius,height,volume;
cout<<"Enter radius of Cones :";
cin>>radius;
cout<<"Enter height of Cones :";
cin>>height;
volume=(1/3)*(22/7)*radius*radius*height;
cout<<"volume of Cones = :"<<volume<<" units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter radius of surface :2
Enter height of surface :3
volume of surface = :12.57142857142857 units.
</div></pre>
<div>
<script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div>
<pre><div class="r">
/* to calculate the surface of the Cones. */
#include <iostream>
using namespace std;
#include <math.h>
int main()
{
float radius,height,volume;
cout<<"Enter radius of Cones :";
cin>>radius;
cout<<"Enter height of Cones :";
cin>>height;
volume=(22/7)*radius*radius+(22/7)*radius*(sqrt(radius*radius+height*height));
cout<<"Surface of Cones = :"<<volume<<" sq. units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter radius of Cones :1
Enter height of Cones :2
Surface of Cones = :9.7082 sq. units.
</div></pre>
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comCosta Rica9.7489169999999987 -83.753428-18.561318884802422 -118.90968068220901 38.059152884802415 -48.597175317790985tag:blogger.com,1999:blog-1379540133641115331.post-65826216325197616582020-08-01T20:14:00.005-07:002020-08-01T20:18:08.773-07:00C++ Program to calculate the volume of the Pyramid. | पिरामिड की मात्रा की गणना करने के लिए C ++ प्रोग्राम।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">
C++ Exercises</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4>
</li>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4>
</li>
</ul>
</div>
<div class="col-6 col-s-9">
<h2>
<span style="color:blue;">C++ Program to calculate the volume of the Pyramid.</span></h2>
<p style="text-align: justify;text-indent: 20px;">Let see the program to calculate the volume of the Pyramid.</p>
<pre><div class="r" style="color:green;">
Example:
<ol type="1">
<li><p style="text-align: justify;text-indent: 0px;">Formula: <br>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2-o5jOPh6ftkfRW4FLWa2V8Fnd-2AHOGTwr-Tb0hoSPDGNbgq_uuMdTZDQc-EJVX1uqYk_XnvrgeaJWzXQAgmBnMJ1vsotrvcJWmby7UAB1Rttzx6Jh_XItn-p6UugBd3g5gxtxbKqlDF/s900/Pyramid.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="volume of Pyramid" border="0" data-original-height="270" data-original-width="900" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2-o5jOPh6ftkfRW4FLWa2V8Fnd-2AHOGTwr-Tb0hoSPDGNbgq_uuMdTZDQc-EJVX1uqYk_XnvrgeaJWzXQAgmBnMJ1vsotrvcJWmby7UAB1Rttzx6Jh_XItn-p6UugBd3g5gxtxbKqlDF/w640-h192/Pyramid.jpg" title="volume of Pyramid" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Pyramid</td></tr></tbody></table>
</p></li>
</ol>
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins> <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<pre><div class="r">
/* to calculate the volume of the Pyramid. */
#include <iostream>
using namespace std;
int main()
{
float base,height,volume;
cout<<"Enter base of Pyramid :";
cin>>base;
cout<<"Enter height of Pyramid :";
cin>>height;
volume=(1/3)*base*height;
cout<<"volume of Pyramid = "<<volume<<" units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter base of Pyramid :1
Enter height of Pyramid :1
volume of Pyramid = 0.33333333 units.
</div></pre>
<div>
<script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div>
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-34.990685831119592 8.6503746355819686 76.178053831119584 149.275385364418tag:blogger.com,1999:blog-1379540133641115331.post-6054876921173086312020-08-01T19:54:00.004-07:002020-08-01T19:57:35.686-07:00C++ Program to calculate the volume and surface of the cylinder. | सी ++ प्रोग्राम सिलेंडर की मात्रा और सतह की गणना करने के लिए।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">
C++ Exercises</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4>
</li>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4>
</li>
</ul>
</div>
<div class="col-6 col-s-9">
<h2>
<span style="color:blue;">C++ Program to calculate the volume and surface of the cylinder.</span></h2>
<p style="text-align: justify;text-indent: 20px;">Let see the program to calculate the volume and surface of the cylinder.</p>
<pre><div class="r" style="color:green;">
Example:
<ol type="1">
<li><p style="text-align: justify;text-indent: 0px;">Formula: <br>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjENX4KMByqjecTgWRZEXm8zUFKe_yJYjo1Cx-oCD4jIQ9cnUNvfZO4E87DG1GiLGLT-eqSaOvnqhYo6pa4EMyP2_PX2sD93647GrYjPgEw32mdfM8o6QZg5uxSrBPK7ft1-R6oj8vHvxMP/s900/cylinder.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Volume of cylinder and surface of cylinder" border="0" data-original-height="259" data-original-width="900" height="184" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjENX4KMByqjecTgWRZEXm8zUFKe_yJYjo1Cx-oCD4jIQ9cnUNvfZO4E87DG1GiLGLT-eqSaOvnqhYo6pa4EMyP2_PX2sD93647GrYjPgEw32mdfM8o6QZg5uxSrBPK7ft1-R6oj8vHvxMP/w640-h184/cylinder.jpg" title="Volume of cylinder and surface of cylinder" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Cylinder</td></tr></tbody></table>
</p></li>
</ol>
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins> <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<pre><div class="r">
/* to calculate the volume of the cylinder. */
#include <iostream>
using namespace std;
int main()
{
double radius,height,volume;
cout<<"Enter radius of cylinder :";
cin>>radius;
cout<<"Enter height of cylinder :";
cin>>height;
volume=(22/7)*radius*radius*height;
cout<<"Volume of cylinder = "<<volume<<" units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter radius of cylinder :5.7
Enter height of cylinder :9.3
Volume of cylinder = 906.471 units.
</div></pre>
<div>
<script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div>
<pre><div class="r">
/* to calculate the surface of the cylinder. */
#include <iostream>
using namespace std;
int main()
{
float radius,height,volume;
cout<<"Enter radius of cylinder :";
cin>>radius;
cout<<"Enter height of cylinder :";
cin>>height;
volume=2*(22/7)*radius*height+2*(22/7)*radius*radius;
cout<<"surface of cylinder = "<<volume<<" sq. units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter radius of cylinder :2.4
Enter height of cylinder :5.7
surface of cylinder = 116.64 sq. units.
</div></pre>
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-20.582931661282213 8.6503746355819686 61.770299661282209 149.275385364418tag:blogger.com,1999:blog-1379540133641115331.post-60566909536225226002020-08-01T02:36:00.002-07:002020-08-01T02:36:16.622-07:00C++ Program to calculate the volume and surface of the prisms. | सी ++ प्रोग्राम की मात्रा और प्रिज्म की सतह की गणना करने के लिए।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">
C++ Exercises</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4>
</li>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4>
</li>
</ul>
</div>
<div class="col-6 col-s-9">
<h2>
<span style="color:blue;">C++ Program to calculate the volume and surface of the prisms.</span></h2>
<p style="text-align: justify;text-indent: 20px;">Let see the program to calculate the volume and surface of the prisms.</p>
<pre><div class="r" style="color:green;">
Example:
<ol type="1">
<li><p style="text-align: justify;text-indent: 0px;">Formula: <br>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9e1pbJXcGRCyUA6byG8EgiQ8YYOwo6Mb-vn-hSWK5GMN4FXof6xT_HJinIuy7MEfWJ95JdmvFPuuy9kapw0Q-xUJcPLDRp7IlIq6xlLgVc57h_DqfxfZ3yePYFCljSEE-K8D0EnKUJATX/s900/prisms.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Volume of prisms and surface of prisms" border="0" data-original-height="186" data-original-width="900" height="132" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9e1pbJXcGRCyUA6byG8EgiQ8YYOwo6Mb-vn-hSWK5GMN4FXof6xT_HJinIuy7MEfWJ95JdmvFPuuy9kapw0Q-xUJcPLDRp7IlIq6xlLgVc57h_DqfxfZ3yePYFCljSEE-K8D0EnKUJATX/w640-h132/prisms.jpg" title="Volume of prisms and surface of prisms" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Prisms</td></tr></tbody></table>
</p></li>
</ol>
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins> <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<pre><div class="r">
/* to calculate the volume of the prisms. */
#include <iostream>
using namespace std;
int main()
{
double base,height,volume;
cout<<"Enter base of prisms :";
cin>>base;
cout<<"Enter height of prisms :";
cin>>height;
volume=base*height;
cout<<"Volume of prisms = :"<<volume<<" units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter base of prisms :10
Enter height of prisms :15
Volume of prisms = :150 units.
</div></pre>
<div>
<script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div>
<pre><div class="r">
/* to calculate the surface of the prisms. */
#include <iostream>
using namespace std;
int main()
{
double base,height,base_perimeter,surface;
cout<<"Enter base of prisms :";
cin>>base;
cout<<"Enter height of prisms :";
cin>>height;
cout<<"Enter base perimeter of prisms :";
cin>>base_perimeter;
surface=2*base+base_perimeter*height;
cout<<"surface of prisms = :"<<surface<<" sq. units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter base of prisms :1
Enter height of prisms :2
Enter base perimeter of prisms :3
surface of prisms = :8 sq. units.
</div></pre>
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-10.835813217639252 43.806627317790984 52.023181217639248 114.11913268220901tag:blogger.com,1999:blog-1379540133641115331.post-40259378274415144012020-08-01T02:04:00.002-07:002020-08-01T02:09:26.068-07:00C++ Program to calculate the volume and surface of the Rectangular Solid. | आयताकार ठोस की मात्रा और सतह की गणना करने के लिए C ++ प्रोग्राम।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">
C++ Exercises</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4>
</li>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4>
</li>
</ul>
</div>
<div class="col-6 col-s-9">
<h2>
<span style="color:blue;">C++ Program to calculate the volume and surface of the Rectangular Solid.</span></h2>
<p style="text-align: justify;text-indent: 20px;">Let see the program to calculate the volume and surface of the Rectangular Solid.</p>
<pre><div class="r" style="color:green;">
Example:
<ol type="1">
<li><p style="text-align: justify;text-indent: 0px;">Formula: <br>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_0M55j53zkd3DTTBZFKgeftpS7dzrpkBnKjOBBKrQmBXvRrgpmGb_AmQVhZb6Z81xuAIH7nezi-KGIq5SUWl5Ve6mfHFLNsyZNF0XPXnWea6OUc5q7CPLrvMRhIQWpdrOTldYkcPY-BSu/s900/Rectangular+Solid.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Volume of Rectangular Solid & surface of Rectangular Solid" border="0" data-original-height="201" data-original-width="900" height="143" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_0M55j53zkd3DTTBZFKgeftpS7dzrpkBnKjOBBKrQmBXvRrgpmGb_AmQVhZb6Z81xuAIH7nezi-KGIq5SUWl5Ve6mfHFLNsyZNF0XPXnWea6OUc5q7CPLrvMRhIQWpdrOTldYkcPY-BSu/w640-h143/Rectangular+Solid.jpg" title="Volume of Rectangular Solid & surface of Rectangular Solid" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Rectangular Solid</td></tr></tbody></table>
</p></li>
</ol>
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins> <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<pre><div class="r">
/* to calculate the volume of the Rectangular Solid. */
#include <iostream>
using namespace std;
int main()
{
double length,width,height,volume;
cout<<"Enter length of Rectangular Solid :";
cin>>length;
cout<<"Enter width of Rectangular Solid :";
cin>>width;
cout<<"Enter length of Rectangular Solid :";
cin>>height;
volume=length*width*height;
cout<<"volume of Rectangular Solid = :"<<volume<<" units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter length of Rectangular Solid :1
Enter width of Rectangular Solid :2
Enter length of Rectangular Solid :3
Volume of Rectangular Solid = :6 sq. units.
</div></pre>
<div>
<script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div>
<pre><div class="r">
/* to calculate the surface of the Rectangular Solid. */
#include <iostream>
using namespace std;
int main()
{
double length,width,height,surface;
cout<<"Enter length of Rectangular Solid :";
cin>>length;
cout<<"Enter width of Rectangular Solid :";
cin>>width;
cout<<"Enter length of Rectangular Solid :";
cin>>height;
surface=2*length*width+2*width*height+2*length*height;
cout<<"surface of Rectangular Solid = :"<<surface<<" sq. units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter length of Rectangular Solid :2
Enter width of Rectangular Solid :3
Enter length of Rectangular Solid :4
surface of Rectangular Solid = :52 sq. units.
</div></pre>
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-7.7165518848024206 43.806627317790984 48.90391988480242 114.11913268220901tag:blogger.com,1999:blog-1379540133641115331.post-38299692130968784632020-08-01T00:56:00.003-07:002020-08-01T00:56:39.450-07:00C++ Program to calculate the diameter, area and circumference of the circle. | सर्कल के व्यास, क्षेत्र और परिधि की गणना करने के लिए C ++ प्रोग्राम।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">
C++ Exercises</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4>
</li>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4>
</li>
</ul>
</div>
<div class="col-6 col-s-9">
<h2>
<span style="color:blue;">C++ Program to calculate the diameter,area and circumference of the circle.</span></h2>
<p style="text-align: justify;text-indent: 20px;">Let see the program to calculate the diameter,area and circumference of the circle.</p>
<pre><div class="r" style="color:green;">
Example:
<ol type="1">
<li><p style="text-align: justify;text-indent: 0px;">Formula: <br>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4xHSnwEm3og15PjyWRBA_dVFu-Ozt4-vvXpoMYaGIG8dIZWcHHQF1TOgpsY5OwiUponBGuf4IukqqUGIzgKip5Qs34UnlsWrKf1HxS6WMgoXYqZ8B2FJVCESmu8cklBX2kv7HVDofrIIU/s900/circle.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="diameter,area and circumference of the circle" border="0" data-original-height="347" data-original-width="900" height="246" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4xHSnwEm3og15PjyWRBA_dVFu-Ozt4-vvXpoMYaGIG8dIZWcHHQF1TOgpsY5OwiUponBGuf4IukqqUGIzgKip5Qs34UnlsWrKf1HxS6WMgoXYqZ8B2FJVCESmu8cklBX2kv7HVDofrIIU/w640-h246/circle.jpg" title="diameter,area and circumference of the circle" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"> circle</td></tr></tbody></table>
</p></li>
</ol>
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins> <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<pre><div class="r">
/* to calculate the diameter of the circle. */
#include <iostream>
using namespace std;
int main()
{
double radius,diameter;
cout<<"Enter radius of circle :";
cin>>radius;
diameter=2*radius;
cout<<"diameter of circle = :"<<diameter<<" units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter radius of circle :5
diameter of circle = :10 units.
</div></pre>
<div>
<script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div>
<pre><div class="r">
/* to calculate the circumference of the circle. */
#include <iostream>
using namespace std;
int main()
{
double radius,circumference;
cout<<"Enter radius of circle :";
cin>>radius;
circumference=2* (22/7) *radius;
cout<<"circumference of circle = "<<circumference<<" units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter radius of circle :5
circumference of circle = = 30 units.
</div></pre>
<pre><div class="r">
/* to calculate the area of the circle. */
#include <iostream>
using namespace std;
int main()
{
double radius,area;
cout<<"Enter radius of circle :";
cin>>radius;
area=(22/7) *radius*radius;
cout<<"area of circle = :"<<area<<" sq. units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter radius of circle :5
area of circle = :75 sq. units.
</div></pre>
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-10.835813217639252 43.806627317790984 52.023181217639248 114.11913268220901tag:blogger.com,1999:blog-1379540133641115331.post-57726798212007542732020-07-31T23:33:00.002-07:002020-07-31T23:33:29.335-07:00C++ Program to calculate the perimeter of the Trapezoid. | सी ++ प्रोग्राम ट्रेपेज़ॉइड की परिधि की गणना करने के लिए।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">
C++ Exercises</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4>
</li>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4>
</li>
</ul>
</div>
<div class="col-6 col-s-9">
<h2>
<span style="color:blue;">C++ Program to calculate the perimeter of the Trapezoid.</span></h2>
<p style="text-align: justify;text-indent: 20px;">Let see the program to calculate the perimeter of the Trapezoid.</p>
<pre><div class="r" style="color:green;">
Example:
<ol type="1">
<li><p style="text-align: justify;text-indent: 0px;">Formula: <br>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZBF1_manT5LLXIYOEN-43S-O_aVAh0R7ny3aKpD7IdeN40lr_cr7f9UyJHgpPQBVbiopjUIza-GmngjPITFGE-20MkrE5nX8brUJCUPM-2jIXXMVsP1huGPWzyRCBpbLNDHb04i1Wht4Q/s900/Trapezoid.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="perimeter of Trapezoid" border="0" data-original-height="150" data-original-width="900" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZBF1_manT5LLXIYOEN-43S-O_aVAh0R7ny3aKpD7IdeN40lr_cr7f9UyJHgpPQBVbiopjUIza-GmngjPITFGE-20MkrE5nX8brUJCUPM-2jIXXMVsP1huGPWzyRCBpbLNDHb04i1Wht4Q/w640-h106/Trapezoid.jpg" title="perimeter of Trapezoid" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Trapezoid</td></tr></tbody></table>
</p></li>
</ol>
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins> <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<pre><div class="r">
#include <iostream>
using namespace std;
int main()
{
double base1,base2,side1,side2,perimeter;
cout<<"Enter base1 of Trapezoid :";
cin>>base1;
cout<<"Enter base2 of Trapezoid :";
cin>>base2;
cout<<"Enter side1 of Trapezoid :";
cin>>side1;
cout<<"Enter side2 of Trapezoid :";
cin>>side2;
perimeter= base1+base2+side1+side2;
cout<<"perimeter of Trapezoid = :"<<perimeter<<" units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter base1 of Trapezoid :10
Enter base2 of Trapezoid :12
Enter side1 of Trapezoid :9
Enter side2 of Trapezoid :8
perimeter of Trapezoid = :39 units.
</div></pre>
<div>
<script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div>
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-7.7165518848024206 43.806627317790984 48.90391988480242 114.11913268220901tag:blogger.com,1999:blog-1379540133641115331.post-76317469517179046592020-07-31T23:19:00.004-07:002020-07-31T23:22:44.043-07:00C++ Program to calculate the area of the Trapezoid. | सी ++ प्रोग्राम ट्रेपेज़ॉइड के क्षेत्र की गणना करने के लिए।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">
C++ Exercises</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4>
</li>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4>
</li>
</ul>
</div>
<div class="col-6 col-s-9">
<h2>
<span style="color:blue;">C++ Program to calculate the area of the Trapezoid.</span></h2>
<p style="text-align: justify;text-indent: 20px;">Let see the program to calculate the area of the Trapezoid.</p>
<pre><div class="r" style="color:green;">
Example:
<ol type="1">
<li><p style="text-align: justify;text-indent: 0px;">Formula: <br>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZBF1_manT5LLXIYOEN-43S-O_aVAh0R7ny3aKpD7IdeN40lr_cr7f9UyJHgpPQBVbiopjUIza-GmngjPITFGE-20MkrE5nX8brUJCUPM-2jIXXMVsP1huGPWzyRCBpbLNDHb04i1Wht4Q/s900/Trapezoid.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Area of Trapezoid" border="0" data-original-height="150" data-original-width="900" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZBF1_manT5LLXIYOEN-43S-O_aVAh0R7ny3aKpD7IdeN40lr_cr7f9UyJHgpPQBVbiopjUIza-GmngjPITFGE-20MkrE5nX8brUJCUPM-2jIXXMVsP1huGPWzyRCBpbLNDHb04i1Wht4Q/w640-h106/Trapezoid.jpg" title="Area of Trapezoid" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Trapezoid</td></tr></tbody></table>
</p></li>
</ol>
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins> <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<pre><div class="r">
#include <iostream>
using namespace std;
int main()
{
double base1,base2,height,area;
cout<<"Enter height of Trapezoid :";
cin>>height;
cout<<"Enter base of Trapezoid :";
cin>>base1;
cout<<"Enter base2 of Trapezoid :";
cin>>base2;
area= (0.5*(base1+base2))*height;
cout<<"Area of Trapezoid = :"<<area<<" sq. units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter height of Trapezoid :10
Enter base of Trapezoid :5
Enter base2 of Trapezoid :7
Area of Trapezoid = :60 sq. units.
</div></pre>
<div>
<script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div>
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-10.835813217639252 43.806627317790984 52.023181217639248 114.11913268220901tag:blogger.com,1999:blog-1379540133641115331.post-18943654148775087232020-07-31T23:05:00.002-07:002020-07-31T23:05:34.088-07:00C++ Program to calculate the area and perimeter of the triangle. | त्रिकोण के क्षेत्र और परिधि की गणना करने के लिए C ++ प्रोग्राम।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">
C++ Exercises</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4>
</li>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4>
</li>
</ul>
</div>
<div class="col-6 col-s-9">
<h2>
<span style="color:blue;">C++ Program to calculate the area and perimeter of the triangle.</span></h2>
<p style="text-align: justify;text-indent: 20px;">Let see the program to calculate the area and perimeter of the triangle.</p>
<pre><div class="r" style="color:green;">
Example:
<ol type="1">
<li><p style="text-align: justify;text-indent: 0px;">Formula: <br>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwoQclUn3rnaKKriYG1bzXEjxuKzudq7V8MDEMYcIxMngKITDs_pfTEUQQ9YuTWxf-woV3jwTGvp7nen-1uQlTX32FFgf-jwtBH3YyMc8zAvnzYQAqfy0NgpNmOZHcne-zZZQ4OYvHXQXC/s900/triangle.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Area of triangle & Perimeter of triangle" border="0" data-original-height="150" data-original-width="900" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwoQclUn3rnaKKriYG1bzXEjxuKzudq7V8MDEMYcIxMngKITDs_pfTEUQQ9YuTWxf-woV3jwTGvp7nen-1uQlTX32FFgf-jwtBH3YyMc8zAvnzYQAqfy0NgpNmOZHcne-zZZQ4OYvHXQXC/w640-h106/triangle.jpg" title="Area of triangle & Perimeter of triangle" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">triangle</td></tr></tbody></table>
</p></li>
</ol>
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins> <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<pre><div class="r">
#include <iostream>
using namespace std;
int main()
{
int height,base,side2,side3,area,perimeter;
cout<<"Enter height of triangle :";
cin>>height;
cout<<"Enter base of triangle :";
cin>>base;
cout<<"Enter side2 of triangle :";
cin>>side2;
cout<<"Enter side3 of triangle :";
cin>>side3;
area= 0.5*base*height;
perimeter= base+side2+side3;
cout<<"Area of triangle = :"<<area<<" sq. units."<<endl;
cout<<"Perimeter of triangle = :"<<perimeter<<" units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter height of triangle :9
Enter base of triangle :9
Enter side2 of triangle :7
Enter side3 of triangle :5
Area of triangle = :40 sq. units.
Perimeter of triangle = :21 units.
</div></pre>
<div>
<script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div>
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-10.835813217639252 43.806627317790984 52.023181217639248 114.11913268220901tag:blogger.com,1999:blog-1379540133641115331.post-80278776659123131002020-07-31T22:43:00.002-07:002020-07-31T22:50:04.448-07:00C++ Program to calculate the area and perimeter of the parallelogram. | C ++ प्रोग्राम, समांतर चतुर्भुज के क्षेत्रफल और परिधि की गणना करने के लिए।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">
C++ Exercises</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4>
</li>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4>
</li>
</ul>
</div>
<div class="col-6 col-s-9">
<h2>
<span style="color:blue;">C++ Program to calculate the area and perimeter of the parallelogram.</span></h2>
<p style="text-align: justify;text-indent: 20px;">Let see the program to calculate the area and perimeter of the parallelogram.</p>
<pre><div class="r" style="color:green;">
Example:
<ol type="1">
<li><p style="text-align: justify;text-indent: 0px;">Formula: <br>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlI2zfzu1kAE7-2YihwL3XtX_84aSA9mZfv6XHOzw1exA9nlwVFkQlVsYfAprZyppXlhyphenhyphenwIGktPIN4T5d-gqR7wYBmUtZ05b1oKWRaq7Wp6F_74yaqo4QaOVsZPMIa6O12GKOUpby4ne_Z/s900/parallelogram.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Area of parallelogram & Perimeter of parallelogram" border="0" data-original-height="150" data-original-width="900" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlI2zfzu1kAE7-2YihwL3XtX_84aSA9mZfv6XHOzw1exA9nlwVFkQlVsYfAprZyppXlhyphenhyphenwIGktPIN4T5d-gqR7wYBmUtZ05b1oKWRaq7Wp6F_74yaqo4QaOVsZPMIa6O12GKOUpby4ne_Z/w640-h106/parallelogram.jpg" title="Area of parallelogram & Perimeter of parallelogram" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">parallelogram</td></tr></tbody></table>
</p></li>
</ol>
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins> <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<pre><div class="r">
#include <iostream>
using namespace std;
int main()
{
int base,height,width,area,perimeter;
cout<<"Enter base of parallelogram :";
cin>>base;
cout<<"Enter height of parallelogram :";
cin>>height;
cout<<"Enter width of parallelogram :";
cin>>width;
area= base*height;
perimeter= 2*(base+width);
cout<<"Area of parallelogram = :"<<area<<" sq. units."<<endl;
cout<<"Perimeter of parallelogram = :"<<perimeter<<" units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter base of parallelogram :10
Enter height of parallelogram :4
Enter width of parallelogram :5
Area of parallelogram = :40 sq. units.
Perimeter of parallelogram = :30 units.
</div></pre>
<div>
<script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div>
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.comIndia20.593684 78.96288-7.7165518848024206 43.806627317790984 48.90391988480242 114.11913268220901tag:blogger.com,1999:blog-1379540133641115331.post-89747047606100712732020-07-31T22:15:00.001-07:002020-07-31T22:25:58.685-07:00C++ Program to calculate the area and perimeter of the rectangle. | आयत के क्षेत्रफल और परिधि की गणना करने के लिए C ++ प्रोग्राम।<div dir="ltr" style="text-align: left;" trbidi="on">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Cpp | c++, Tutorial, Overview, language basics, Environment Setup, Program Structure, cpp | c++ Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, Strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments,object and class, exception, static, structs, inheritance, aggregation etc.">
<meta name="description" content="Learn C++ programming in simple and easy steps starting from basic to advanced concepts with examples including C Overview, language basics, Environment Setup, Program Structure, Basic Syntax, literals, data types, Variables, Constants, Storage Classes, Operators, Decision Making, functions, Scope Rules, loops, arrays, pointers, strings, structures, Unions, Bit Fields, Typedef, input and output, Header Files, Type Casting, Error Handling, Recursion, Variable Arguments, memory management, pre-processors, directives, Command Line Arguments, etc.">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" media="(min-width:500px)" href="min-500px.css"/>
<meta name="author" content=""> <meta name="revisit" content="1 days" />
<meta name="robots" content="index, follow" />
<meta name="GOOGLEBOT" content="INDEX, FOLLOW" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en" hreflang="en" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ie" hreflang="en-ie" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-ca" hreflang="en-ca" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/en-au" hreflang="en-au" />
<link rel="alternate" href="https://cprogrammingcoding.blogspot.com/" hreflang="x-default" />
<link rel="alternate" hreflang="en-US" href="hidden link"> <link rel="alternate" hreflang="es-ES" href="hidden link">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
}
html {
font-family: "Lucida Sans", sans-serif;
}
.header1 {
background-color: #9933cc;
color: #ffffff;
padding: 15px;
}
.menu ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
padding: 8px;
margin-bottom: 7px;
background-color:;
color: #ffffff;
}
.menu li:hover {
background-color: #0099cc;
}
.aside {
background-color: #33b5e5;
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 14px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.footer {
background-color: #0099cc;
color: #ffffff;
text-align: center;
font-size: 12px;
padding: 15px;
}
/* For mobile phones: */
[class*="col-"] {
width: 100%;
}
@media only screen and (min-width: 600px) {
/* For tablets: */
.col-s-1 {width: 8.33%;}
.col-s-2 {width: 16.66%;}
.col-s-3 {width: 25%;}
.col-s-4 {width: 33.33%;}
.col-s-5 {width: 41.66%;}
.col-s-6 {width: 50%;}
.col-s-7 {width: 58.33%;}
.col-s-8 {width: 66.66%;}
.col-s-9 {width: 75%;}
.col-s-10 {width: 83.33%;}
.col-s-11 {width: 91.66%;}
.col-s-12 {width: 100%;}
}
@media only screen and (min-width: 768px) {
/* For desktop: */
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
}
<!-- dropdown menu start-->
.navbar {
overflow: hidden;
background-color: #333;
font-family: Arial, Helvetica, sans-serif;
}
.navbar a {
float: left;
font-size: 16px;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
<!--drop down menu end-->
h3,h4
{
color:blue;
}
div.r
{
width:700px;
padding:10px;
border:10px green;
border-left-style: solid;
font-size-adjust: 0.58;
font-weight: bold;
box-shadow: 3px 7px #888888;
color:black;
border-top: 3px solid yellow;
border-radius: 20px;
height: auto;
}
h5
{
color:green;
}
</style> </head> <body>
<div class="header1">
<h1 style="text-align:center;font-size:100%;">
C++ Exercises</h1>
<table width="100%">
<tr> <td> <div class="navbar">
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html" target="_blank">C++ Programming Tutorial</a> <div class="dropdown">
<button class="dropbtn">C++ Exercises <i class="fa fa-caret-down"></i> </button> <div class="dropdown-content">
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html" target="_blank">C++ Exercises</a>
</div>
</div>
<a href="https://www.cprogramcoding.com/2020/07/data-structures.html" target="_blank">Data Structures</a> </div>
</td> </tr>
</table>
</div>
<div class="row">
<div class="col-3 col-s-3 menu">
<ul>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-programming-tutorial-c.html"><span style="font-size:100%;color:green;">C++ Tutorial</span></a></h4>
</li>
<li><h4>
<a href="https://www.cprogramcoding.com/2020/07/c-exercises.html"><span style="font-size:100%;color:green;">C++ Programs</span></a></h4>
</li>
</ul>
</div>
<div class="col-6 col-s-9">
<h2>
<span style="color:blue;">C++ Program to calculate the area and perimeter of the rectangle.</span></h2>
<p style="text-align: justify;text-indent: 20px;">Let see the program to calculate the area and perimeter of the rectangle.</p>
<pre><div class="r" style="color:green;">
Example:
<ol type="1">
<li><p style="text-align: justify;text-indent: 0px;">Formula: <br>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJyhiAqELntX-O507ff0RquMNv9ev1sDljUXjmspr2gWeArg_sQafaVzVmvUZCIJHzE_02bFKKrnHYDZ9tgpV12_Wzdyp9A9seOL5vClRI2ybbovSj7_gpGfwR3Swpy6Idvs1vA7b89Xnt/s900/rectangle.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Area of rectangle & Perimeter of rectangle" border="0" data-original-height="150" data-original-width="900" height="105" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJyhiAqELntX-O507ff0RquMNv9ev1sDljUXjmspr2gWeArg_sQafaVzVmvUZCIJHzE_02bFKKrnHYDZ9tgpV12_Wzdyp9A9seOL5vClRI2ybbovSj7_gpGfwR3Swpy6Idvs1vA7b89Xnt/w640-h105/rectangle.jpg" title="Area of rectangle & Perimeter of rectangle" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Area of rectangle & Perimeter of rectangle</td></tr></tbody></table>
</p></li>
</ol>
</div></pre>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
style="display:block"
data-ad-format="fluid"
data-ad-layout-key="-fb+5w+4e-db+86"
data-ad-client="ca-pub-4210224895146903"
data-ad-slot="9047739563"></ins> <script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<pre><div class="r">
#include <iostream>
using namespace std;
int main()
{
int length,width,area,perimeter;
cout<<"Enter length of rectangle :";
cin>>length;
cout<<"Enter width of rectangle :";
cin>>width;
area=length*width;
perimeter=2*(length+width);
cout<<"Area of rectangle = :"<<area<<" sq. units."<<endl;
cout<<"Perimeter of rectangle = :"<<perimeter<<" units."<<endl;
return 0;
}
</div></pre>
<h5>
<strong>Output:</strong></h5>
<pre><div class="r" style="color:green;">
Enter length of rectangle :5
Enter width of rectangle :8
Area of rectangle = :40 sq. units.
Perimeter of rectangle = :26 units.
</div></pre>
<div>
<script type="text/javascript">
google_ad_client = "ca-pub-4210224895146903";
google_ad_slot = "9738715889";
google_ad_width = 336;
google_ad_height = 280;
</script> <!-- cprogam1 --> <script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </div>
</div>
<div class="col-3 col-s-12">
</div>
</div>
<div class="footer">
<p>
Cpp Programming</p>
</div>
</body> </html> </div>
Educationhttp://www.blogger.com/profile/17360685569347324985noreply@blogger.com