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

<channel>
	<title>declaration | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/declaration/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 10 Dec 2022 04:46:39 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>C++ Variables</title>
		<link>https://studentprojects.in/software-development/cpp/c-tutorials-cpp/c-variables/</link>
					<comments>https://studentprojects.in/software-development/cpp/c-tutorials-cpp/c-variables/#respond</comments>
		
		<dc:creator><![CDATA[Shubhajna Rai]]></dc:creator>
		<pubDate>Thu, 08 Dec 2022 07:37:00 +0000</pubDate>
				<category><![CDATA[C++ Tutorials]]></category>
		<category><![CDATA[declaration]]></category>
		<category><![CDATA[c++ variable]]></category>
		<category><![CDATA[identifying variable]]></category>
		<category><![CDATA[variable scope]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=9823</guid>

					<description><![CDATA[<p>Data values are kept in variables as storage. There are various sorts of variables in C++. Here are a few of them: Integers (whole numbers) without decimals, such as 63 or -1, are stored in integer variables specified with the keyword int. Floating point numbers with decimals, such as 79.97 or -13.26, are stored in</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/c-tutorials-cpp/c-variables/">C++ Variables</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Data values are kept in variables as storage.</p>



<p>There are various sorts of variables in C++.</p>



<p>Here are a few of them:</p>



<ul><li>Integers (whole numbers) without decimals, such as 63 or -1, are stored in integer variables specified with the keyword int.</li><li>Floating point numbers with decimals, such as 79.97 or -13.26, are stored in floating point variables specified using the keyword float.</li><li>Single characters, such &#8220;A&#8221; or &#8220;z,&#8221; are stored in character variables specified with the keyword char. Char values must be enclosed in single quotation marks.</li><li>When the bool keyword is used to define a boolean variable, it stores a single value that represents either false or true, 0 or 1.</li></ul>



<p><strong>Declaration</strong></p>



<p>A variable cannot be declared without its data type being mentioned. What we want to store in the variable and how much space we need it to hold will determine the data type of the variable. Declaring a variable has the following simple syntax:</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">data_type&nbsp; variable_name;</code></pre>



<p><strong>Identifying a Variable</strong></p>



<p>Anything can be referred to as a variable. However, there are several guidelines we must adhere to while naming a variable:</p>



<ul><li>In C++, variable names can have any length between 1 and 255 characters.</li><li>Only alphabetic characters, numbers, and underscores (_) are permitted in variable names.</li><li>A digit cannot begin a variable.</li><li>A variable&#8217;s name cannot contain any white space.</li><li>Names of variables are case-sensitive.</li><li>No special characters or reserved keywords should be present in the name.</li></ul>



<p><strong>Variable Scope</strong></p>



<p>A variable&#8217;s scope refers to the area of a programme where its presence is permitted. Variables can be divided into two categories according to their scope:</p>



<p><strong>Local variables:</strong></p>



<p>Local variables can only be evaluated from the specific function they are declared inside the braces of.</p>



<p><strong>Global variables:</strong></p>



<p>Global variables can be accessed from anywhere and are declared outside of any function.</p>



<p>Example:</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">#include &lt;iostream&gt;
using namespace std;
 
int a = 5; //global variable
 
void func()
{
    cout &lt;&lt; a &lt;&lt; endl;
}
 
int main()
{
    int a = 10; //local variable
    cout &lt;&lt; a &lt;&lt; endl;
    func();
    return 0;
}
</code></pre>



<p>Output:</p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">10
5</code></pre><p>The post <a href="https://studentprojects.in/software-development/cpp/c-tutorials-cpp/c-variables/">C++ Variables</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/c-tutorials-cpp/c-variables/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>variable in C</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/variable-in-c/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/variable-in-c/#respond</comments>
		
		<dc:creator><![CDATA[Shubhajna Rai]]></dc:creator>
		<pubDate>Tue, 25 Oct 2022 06:50:35 +0000</pubDate>
				<category><![CDATA[C Tutorials]]></category>
		<category><![CDATA[Variables in c]]></category>
		<category><![CDATA[identifying a variable]]></category>
		<category><![CDATA[declaration]]></category>
		<guid isPermaLink="false">https://studentprojects.in/?p=9644</guid>

					<description><![CDATA[<p>Data values are kept in variables as storage.There are various sorts of variables in C. For instance Integers (whole numbers) without decimals, such as 91 or -13, are stored in integer variables specified with the keyword int. Floating point numbers with decimals, such as 99.98 or -1.23, are stored in floating point variables specified using</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/variable-in-c/">variable in C</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Data values are kept in variables as storage.There are various sorts of variables in C.</p>



<p><strong>For instance</strong></p>



<ul><li>Integers (whole numbers) without decimals, such as 91 or -13, are stored in integer variables specified with the keyword int.</li><li>Floating point numbers with decimals, such as 99.98 or -1.23, are stored in floating point variables specified using the keyword float.</li><li>Single characters, such &#8220;A&#8221; or &#8220;z,&#8221; are stored in character variables specified with the keyword char. Char values must be enclosed in single quotation marks.</li></ul>



<p><strong>Declaration</strong></p>



<ul><li>A variable cannot be declared without its data type being mentioned. What we want to put in the variable and how much space we need it to hold will determine the data type of the variable. Declaring a variable has the following basic syntax:</li></ul>



<p>data_type&nbsp; variable_name;</p>



<p><strong>Identifying a Variable</strong></p>



<ul><li>Anything can be referred to as a variable. However, there are several guidelines we must adhere to while naming a variable:</li><li>Only alphabetic characters, numbers, and underscores (_) are permitted in variable names.</li><li>A digit cannot begin a variable.</li><li>A variable&#8217;s name cannot contain any white space.</li><li>No special characters or reserved keywords should be present in the name.</li></ul>



<p>Variables can have their names changed or their values modified, but their types cannot be changed in the same ways. If a variable is of the integer type, then a programme can only store integer values in it. An integer variable cannot take a value of the character type. Even a decimal value cannot be stored in an integer variable.</p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/variable-in-c/">variable in C</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/variable-in-c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
