{"id":2755,"date":"2025-06-06T15:36:18","date_gmt":"2025-06-06T15:36:18","guid":{"rendered":"https:\/\/diznr.com\/?p=2755"},"modified":"2025-06-06T15:36:18","modified_gmt":"2025-06-06T15:36:18","slug":"constants-variables-and-keywords-5-part","status":"publish","type":"post","link":"https:\/\/www.reilsolar.com\/pdf\/constants-variables-and-keywords-5-part\/","title":{"rendered":"Constants, Variables and Keywords- part 5."},"content":{"rendered":"<p>Constants, Variables and Keywords- part 5.<\/p>\n<p>[fvplayer id=&#8221;98&#8243;]<\/p>\n<h3 data-start=\"0\" data-end=\"54\"><strong data-start=\"7\" data-end=\"54\">Constants, Variables, and Keywords &#8211; Part 5<\/strong><\/h3>\n<h3 data-start=\"61\" data-end=\"86\"><strong data-start=\"64\" data-end=\"84\">\u00a01. Constants:<\/strong><\/h3>\n<p data-start=\"87\" data-end=\"292\">Constants are fixed values that do not change during the execution of a program. They can be of various types, like integer constants, floating-point constants, character constants, and string constants.<\/p>\n<h3 data-start=\"294\" data-end=\"313\"><strong data-start=\"298\" data-end=\"311\">Examples:<\/strong><\/h3>\n<ul data-start=\"314\" data-end=\"481\">\n<li data-start=\"314\" data-end=\"349\">Integer Constant: <code data-start=\"334\" data-end=\"347\">5, -10, 100<\/code><\/li>\n<li data-start=\"350\" data-end=\"399\">Floating-point Constant: <code data-start=\"377\" data-end=\"397\">3.14, -0.99, 2.5e3<\/code><\/li>\n<li data-start=\"400\" data-end=\"439\">Character Constant: <code data-start=\"422\" data-end=\"437\">'A', 'b', '$'<\/code><\/li>\n<li data-start=\"440\" data-end=\"481\">String Constant: <code data-start=\"459\" data-end=\"468\">\"Hello\"<\/code>, <code data-start=\"470\" data-end=\"479\">\"12345\"<\/code><\/li>\n<\/ul>\n<h3 data-start=\"488\" data-end=\"513\"><strong data-start=\"491\" data-end=\"511\">\u00a02. Variables:<\/strong><\/h3>\n<p data-start=\"514\" data-end=\"614\">Variables are memory locations that hold data and whose value can change during program execution.<\/p>\n<ul data-start=\"615\" data-end=\"704\">\n<li data-start=\"615\" data-end=\"653\">They should have meaningful names.<\/li>\n<li data-start=\"654\" data-end=\"704\">The value stored in a variable can be updated.<\/li>\n<\/ul>\n<h3 data-start=\"706\" data-end=\"747\"><strong data-start=\"710\" data-end=\"745\">Declaration and Initialization:<\/strong><\/h3>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre language-python\"><span class=\"hljs-comment\"># Python example<\/span><br \/>\nage = <span class=\"hljs-number\">25<\/span>  <span class=\"hljs-comment\"># Variable 'age' holding an integer value<\/span><br \/>\nname = <span class=\"hljs-string\">\"Alice\"<\/span>  <span class=\"hljs-comment\"># Variable 'name' holding a string value<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">c<\/div>\n<div class=\"sticky top-9\">\n<div class=\"absolute bottom-0 right-0 flex h-9 items-center pr-2\"><\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre language-c\"><span class=\"hljs-comment\">\/\/ C example<\/span><br \/>\n<span class=\"hljs-type\">int<\/span> age = <span class=\"hljs-number\">25<\/span>;  <span class=\"hljs-comment\">\/\/ Variable 'age' holding an integer value<\/span><br \/>\n<span class=\"hljs-type\">char<\/span> name[] = <span class=\"hljs-string\">\"Alice\"<\/span>;  <span class=\"hljs-comment\">\/\/ Variable 'name' holding a string value<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<h3 data-start=\"1040\" data-end=\"1064\"><strong data-start=\"1043\" data-end=\"1062\">\u00a03. Keywords:<\/strong><\/h3>\n<p data-start=\"1065\" data-end=\"1186\">Keywords are reserved words that have special meanings in programming languages. They cannot be used as variable names.<\/p>\n<h3 data-start=\"1188\" data-end=\"1219\"><strong data-start=\"1192\" data-end=\"1217\">Examples of Keywords:<\/strong><\/h3>\n<ul data-start=\"1220\" data-end=\"1451\">\n<li data-start=\"1220\" data-end=\"1293\">In <strong data-start=\"1225\" data-end=\"1236\">Python:<\/strong> <code data-start=\"1237\" data-end=\"1241\">if<\/code>, <code data-start=\"1243\" data-end=\"1249\">else<\/code>, <code data-start=\"1251\" data-end=\"1258\">while<\/code>, <code data-start=\"1260\" data-end=\"1265\">for<\/code>, <code data-start=\"1267\" data-end=\"1272\">def<\/code>, <code data-start=\"1274\" data-end=\"1282\">return<\/code>, <code data-start=\"1284\" data-end=\"1291\">break<\/code><\/li>\n<li data-start=\"1294\" data-end=\"1375\">In <strong data-start=\"1299\" data-end=\"1309\">C\/C++:<\/strong> <code data-start=\"1310\" data-end=\"1315\">int<\/code>, <code data-start=\"1317\" data-end=\"1324\">float<\/code>, <code data-start=\"1326\" data-end=\"1332\">char<\/code>, <code data-start=\"1334\" data-end=\"1338\">if<\/code>, <code data-start=\"1340\" data-end=\"1346\">else<\/code>, <code data-start=\"1348\" data-end=\"1355\">while<\/code>, <code data-start=\"1357\" data-end=\"1365\">return<\/code>, <code data-start=\"1367\" data-end=\"1373\">void<\/code><\/li>\n<li data-start=\"1376\" data-end=\"1451\">In <strong data-start=\"1381\" data-end=\"1390\">Java:<\/strong> <code data-start=\"1391\" data-end=\"1398\">class<\/code>, <code data-start=\"1400\" data-end=\"1408\">static<\/code>, <code data-start=\"1410\" data-end=\"1418\">public<\/code>, <code data-start=\"1420\" data-end=\"1426\">void<\/code>, <code data-start=\"1428\" data-end=\"1433\">new<\/code>, <code data-start=\"1435\" data-end=\"1440\">try<\/code>, <code data-start=\"1442\" data-end=\"1449\">catch<\/code><\/li>\n<\/ul>\n<h3 data-start=\"1458\" data-end=\"1490\"><strong data-start=\"1461\" data-end=\"1488\">\u00a0Differences Summary:<\/strong><\/h3>\n<div class=\"overflow-x-auto contain-inline-size\">\n<table data-start=\"1491\" data-end=\"1944\">\n<thead data-start=\"1491\" data-end=\"1577\">\n<tr data-start=\"1491\" data-end=\"1577\">\n<th data-start=\"1491\" data-end=\"1508\">Feature<\/th>\n<th data-start=\"1508\" data-end=\"1531\">Constants<\/th>\n<th data-start=\"1531\" data-end=\"1553\">Variables<\/th>\n<th data-start=\"1553\" data-end=\"1577\">Keywords<\/th>\n<\/tr>\n<\/thead>\n<tbody data-start=\"1668\" data-end=\"1944\">\n<tr data-start=\"1668\" data-end=\"1757\">\n<td>Definition<\/td>\n<td>Fixed values<\/td>\n<td>Changeable data<\/td>\n<td>Reserved words<\/td>\n<\/tr>\n<tr data-start=\"1758\" data-end=\"1847\">\n<td>Changeable<\/td>\n<td>No<\/td>\n<td>Yes<\/td>\n<td>No<\/td>\n<\/tr>\n<tr data-start=\"1848\" data-end=\"1944\">\n<td>Example<\/td>\n<td><code data-start=\"1867\" data-end=\"1873\">3.14<\/code>, <code data-start=\"1875\" data-end=\"1884\">\"Hello\"<\/code><\/td>\n<td><code data-start=\"1891\" data-end=\"1901\">age = 25<\/code>, <code data-start=\"1903\" data-end=\"1917\">name = \"Bob\"<\/code><\/td>\n<td><code data-start=\"1920\" data-end=\"1925\">int<\/code>, <code data-start=\"1927\" data-end=\"1932\">for<\/code>, <code data-start=\"1934\" data-end=\"1941\">while<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3 data-start=\"1951\" data-end=\"1978\"><strong data-start=\"1954\" data-end=\"1976\">\u00a0Quick Exercise:<\/strong><\/h3>\n<ol data-start=\"1979\" data-end=\"2185\">\n<li data-start=\"1979\" data-end=\"2144\">Identify constants, variables, and keywords in the following line:\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-9\"><\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre language-python\">count = <span class=\"hljs-number\">10<\/span><br \/>\n<span class=\"hljs-keyword\">while<\/span> count &gt; <span class=\"hljs-number\">0<\/span>:<br \/>\n<span class=\"hljs-built_in\">print<\/span>(<span class=\"hljs-string\">\"Hello\"<\/span>)<br \/>\ncount -= <span class=\"hljs-number\">1<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<\/li>\n<li data-start=\"2145\" data-end=\"2185\">Write any 3 keywords of C language.<\/li>\n<\/ol>\n<p data-start=\"2192\" data-end=\"2271\" data-is-last-node=\"\" data-is-only-node=\"\">\u0905\u0917\u0930 \u0906\u092a\u0915\u094b \u0915\u093f\u0938\u0940 \u0914\u0930 \u091f\u0949\u092a\u093f\u0915 \u092a\u0930 \u091c\u093e\u0928\u0915\u093e\u0930\u0940 \u091a\u093e\u0939\u093f\u090f \u092f\u093e \u0914\u0930 \u092a\u094d\u0930\u0948\u0915\u094d\u091f\u093f\u0938 \u0915\u0930\u0928\u0940 \u0939\u0948, \u0924\u094b \u092c\u0924\u093e\u090f\u0902!<\/p>\n<h3 data-start=\"2192\" data-end=\"2271\"><a href=\"https:\/\/newhorizon-nhcollegkasturinagar.s3.ap-south-1.amazonaws.com\/nhc_kasturinagar\/wp-content\/uploads\/2020\/06\/12115728\/CONSTANT_VARIABLES_CHAPTER-4.pdf\" target=\"_blank\" rel=\"noopener\">Constants, Variables and Keywords- part 5.<\/a><\/h3>\n<h3 class=\"LC20lb MBeuO DKV0Md\"><a href=\"https:\/\/maqtanim.wordpress.com\/wp-content\/uploads\/2018\/05\/05_variables_and_constants.pdf\" target=\"_blank\" rel=\"noopener\">5. Variables and Constants<\/a><\/h3>\n<h3 class=\"LC20lb MBeuO DKV0Md\"><a href=\"https:\/\/www.unisoftindia.org\/media\/media-2017062420173928504.pdf\" target=\"_blank\" rel=\"noopener\">Introduction to C<\/a><\/h3>\n<p data-start=\"0\" data-end=\"87\">Here is <strong data-start=\"8\" data-end=\"18\">Part 5<\/strong> of the <strong data-start=\"26\" data-end=\"66\">&#8220;Getting Started with C Programming&#8221;<\/strong> series, focusing on:<\/p>\n<h1 data-start=\"89\" data-end=\"136\">\u2705 <strong data-start=\"93\" data-end=\"136\">Constants, Variables, and Keywords in C<\/strong><\/h1>\n<hr data-start=\"138\" data-end=\"141\" \/>\n<h2 data-start=\"143\" data-end=\"180\">\ud83d\udd39 1. What are <strong data-start=\"161\" data-end=\"174\">Constants<\/strong> in C?<\/h2>\n<p data-start=\"182\" data-end=\"274\"><strong data-start=\"182\" data-end=\"195\">Constants<\/strong> are <strong data-start=\"200\" data-end=\"216\">fixed values<\/strong> that <strong data-start=\"222\" data-end=\"239\">do not change<\/strong> during the execution of a program.<\/p>\n<h3 data-start=\"276\" data-end=\"302\">\ud83e\uddf1 Types of Constants:<\/h3>\n<div class=\"_tableContainer_16hzy_1\">\n<div class=\"_tableWrapper_16hzy_14 group flex w-fit flex-col-reverse\">\n<table class=\"w-fit min-w-(--thread-content-width)\" data-start=\"303\" data-end=\"782\">\n<thead data-start=\"303\" data-end=\"382\">\n<tr data-start=\"303\" data-end=\"382\">\n<th data-start=\"303\" data-end=\"323\" data-col-size=\"sm\">Type<\/th>\n<th data-start=\"323\" data-end=\"340\" data-col-size=\"sm\">Example<\/th>\n<th data-start=\"340\" data-end=\"382\" data-col-size=\"sm\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody data-start=\"463\" data-end=\"782\">\n<tr data-start=\"463\" data-end=\"542\">\n<td data-start=\"463\" data-end=\"483\" data-col-size=\"sm\">Integer Constant<\/td>\n<td data-col-size=\"sm\" data-start=\"483\" data-end=\"500\"><code data-start=\"485\" data-end=\"490\">100<\/code>, <code data-start=\"492\" data-end=\"497\">-25<\/code><\/td>\n<td data-col-size=\"sm\" data-start=\"500\" data-end=\"542\">Whole numbers<\/td>\n<\/tr>\n<tr data-start=\"543\" data-end=\"622\">\n<td data-start=\"543\" data-end=\"563\" data-col-size=\"sm\">Floating Constant<\/td>\n<td data-col-size=\"sm\" data-start=\"563\" data-end=\"580\"><code data-start=\"565\" data-end=\"571\">3.14<\/code>, <code data-start=\"573\" data-end=\"579\">-0.5<\/code><\/td>\n<td data-col-size=\"sm\" data-start=\"580\" data-end=\"622\">Decimal numbers<\/td>\n<\/tr>\n<tr data-start=\"623\" data-end=\"702\">\n<td data-start=\"623\" data-end=\"643\" data-col-size=\"sm\">Character Constant<\/td>\n<td data-start=\"643\" data-end=\"660\" data-col-size=\"sm\"><code data-start=\"645\" data-end=\"650\">'A'<\/code>, <code data-start=\"652\" data-end=\"657\">'9'<\/code><\/td>\n<td data-start=\"660\" data-end=\"702\" data-col-size=\"sm\">Single characters in single quotes<\/td>\n<\/tr>\n<tr data-start=\"703\" data-end=\"782\">\n<td data-start=\"703\" data-end=\"723\" data-col-size=\"sm\">String Constant<\/td>\n<td data-start=\"723\" data-end=\"740\" data-col-size=\"sm\"><code data-start=\"725\" data-end=\"734\">\"Hello\"<\/code><\/td>\n<td data-start=\"740\" data-end=\"782\" data-col-size=\"sm\">Group of characters in double quotes<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"sticky end-(--thread-content-margin) h-0 self-end select-none\">\n<div class=\"absolute end-0 flex items-end\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3 data-start=\"784\" data-end=\"798\">\u2705 Example:<\/h3>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">c<\/div>\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-sidebar-surface-primary text-token-text-secondary dark:bg-token-main-surface-secondary flex items-center rounded-sm px-2 font-sans text-xs\"><button class=\"flex gap-1 items-center select-none px-4 py-1\" aria-label=\"Copy\">Copy<\/button><span class=\"\" data-state=\"closed\"><button class=\"flex items-center gap-1 px-4 py-1 select-none\">Edit<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-c\"><span class=\"hljs-type\">const<\/span> <span class=\"hljs-type\">int<\/span> age = <span class=\"hljs-number\">18<\/span>;<br \/>\n<span class=\"hljs-built_in\">printf<\/span>(<span class=\"hljs-string\">\"Age = %d\"<\/span>, age); <span class=\"hljs-comment\">\/\/ Age = 18<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<p data-start=\"866\" data-end=\"943\">\ud83d\udcdd <code data-start=\"869\" data-end=\"876\">const<\/code> keyword makes a variable <strong data-start=\"902\" data-end=\"915\">read-only<\/strong> (cannot be modified later).<\/p>\n<hr data-start=\"945\" data-end=\"948\" \/>\n<h2 data-start=\"950\" data-end=\"987\">\ud83d\udd39 2. What are <strong data-start=\"968\" data-end=\"981\">Variables<\/strong> in C?<\/h2>\n<p data-start=\"989\" data-end=\"1069\">A <strong data-start=\"991\" data-end=\"1003\">variable<\/strong> is a <strong data-start=\"1009\" data-end=\"1027\">named location<\/strong> in memory used to store data temporarily.<\/p>\n<h3 data-start=\"1071\" data-end=\"1085\">\ud83d\udca1 Syntax:<\/h3>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">c<\/div>\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-sidebar-surface-primary text-token-text-secondary dark:bg-token-main-surface-secondary flex items-center rounded-sm px-2 font-sans text-xs\"><button class=\"flex gap-1 items-center select-none px-4 py-1\" aria-label=\"Copy\">Copy<\/button><span class=\"\" data-state=\"closed\"><button class=\"flex items-center gap-1 px-4 py-1 select-none\">Edit<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-c\">data_type variable_name;<br \/>\n<\/code><\/div>\n<\/div>\n<h3 data-start=\"1121\" data-end=\"1136\">\ud83e\uddea Example:<\/h3>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">c<\/div>\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-sidebar-surface-primary text-token-text-secondary dark:bg-token-main-surface-secondary flex items-center rounded-sm px-2 font-sans text-xs\"><button class=\"flex gap-1 items-center select-none px-4 py-1\" aria-label=\"Copy\">Copy<\/button><span class=\"\" data-state=\"closed\"><button class=\"flex items-center gap-1 px-4 py-1 select-none\">Edit<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-c\"><span class=\"hljs-type\">int<\/span> marks = <span class=\"hljs-number\">95<\/span>;<br \/>\n<span class=\"hljs-type\">float<\/span> pi = <span class=\"hljs-number\">3.14<\/span>;<br \/>\n<span class=\"hljs-type\">char<\/span> grade = <span class=\"hljs-string\">'A'<\/span>;<br \/>\n<\/code><\/div>\n<\/div>\n<h3 data-start=\"1198\" data-end=\"1232\">\ud83d\udccc Rules for Naming Variables:<\/h3>\n<ul data-start=\"1233\" data-end=\"1422\">\n<li data-start=\"1233\" data-end=\"1299\">\n<p data-start=\"1235\" data-end=\"1299\">Must begin with a <strong data-start=\"1253\" data-end=\"1276\">letter (A\u2013Z or a\u2013z)<\/strong> or <strong data-start=\"1280\" data-end=\"1298\">underscore (_)<\/strong>.<\/p>\n<\/li>\n<li data-start=\"1300\" data-end=\"1338\">\n<p data-start=\"1302\" data-end=\"1338\"><strong data-start=\"1302\" data-end=\"1315\">No spaces<\/strong> or special characters.<\/p>\n<\/li>\n<li data-start=\"1339\" data-end=\"1376\">\n<p data-start=\"1341\" data-end=\"1376\">Case-sensitive (<code data-start=\"1357\" data-end=\"1364\">Total<\/code> \u2260 <code data-start=\"1367\" data-end=\"1374\">total<\/code>).<\/p>\n<\/li>\n<li data-start=\"1377\" data-end=\"1422\">\n<p data-start=\"1379\" data-end=\"1422\">Avoid using <strong data-start=\"1391\" data-end=\"1403\">keywords<\/strong> as variable names.<\/p>\n<\/li>\n<\/ul>\n<hr data-start=\"1424\" data-end=\"1427\" \/>\n<h2 data-start=\"1429\" data-end=\"1465\">\ud83d\udd39 3. What are <strong data-start=\"1447\" data-end=\"1459\">Keywords<\/strong> in C?<\/h2>\n<p data-start=\"1467\" data-end=\"1567\"><strong data-start=\"1467\" data-end=\"1479\">Keywords<\/strong> are <strong data-start=\"1484\" data-end=\"1502\">reserved words<\/strong> with special meaning. They <strong data-start=\"1530\" data-end=\"1566\">cannot be used as variable names<\/strong>.<\/p>\n<h3 data-start=\"1569\" data-end=\"1602\">\ud83d\udcd8 Examples of Keywords in C:<\/h3>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">cpp<\/div>\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-sidebar-surface-primary text-token-text-secondary dark:bg-token-main-surface-secondary flex items-center rounded-sm px-2 font-sans text-xs\"><button class=\"flex gap-1 items-center select-none px-4 py-1\" aria-label=\"Copy\">Copy<\/button><span class=\"\" data-state=\"closed\"><button class=\"flex items-center gap-1 px-4 py-1 select-none\">Edit<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre!\"><span class=\"hljs-type\">int<\/span>, <span class=\"hljs-type\">float<\/span>, <span class=\"hljs-keyword\">return<\/span>, <span class=\"hljs-keyword\">if<\/span>, <span class=\"hljs-keyword\">else<\/span>, <span class=\"hljs-keyword\">while<\/span>, <span class=\"hljs-keyword\">for<\/span>, <span class=\"hljs-keyword\">break<\/span>, <span class=\"hljs-keyword\">continue<\/span>, <span class=\"hljs-type\">const<\/span>, <span class=\"hljs-type\">void<\/span>, <span class=\"hljs-type\">char<\/span>, <span class=\"hljs-type\">double<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<h3 data-start=\"1697\" data-end=\"1712\">\ud83d\udeab Example:<\/h3>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none rounded-t-[5px]\">c<\/div>\n<div class=\"sticky top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-sidebar-surface-primary text-token-text-secondary dark:bg-token-main-surface-secondary flex items-center rounded-sm px-2 font-sans text-xs\"><button class=\"flex gap-1 items-center select-none px-4 py-1\" aria-label=\"Copy\">Copy<\/button><span class=\"\" data-state=\"closed\"><button class=\"flex items-center gap-1 px-4 py-1 select-none\">Edit<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"whitespace-pre! language-c\"><span class=\"hljs-type\">int<\/span> <span class=\"hljs-keyword\">return<\/span> = <span class=\"hljs-number\">5<\/span>; <span class=\"hljs-comment\">\/\/ \u274c Error! \"return\" is a keyword<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<hr data-start=\"1773\" data-end=\"1776\" \/>\n<h2 data-start=\"1778\" data-end=\"1796\">\ud83e\udde0 Quick Recap:<\/h2>\n<div class=\"_tableContainer_16hzy_1\">\n<div class=\"_tableWrapper_16hzy_14 group flex w-fit flex-col-reverse\">\n<table class=\"w-fit min-w-(--thread-content-width)\" data-start=\"1798\" data-end=\"2170\">\n<thead data-start=\"1798\" data-end=\"1871\">\n<tr data-start=\"1798\" data-end=\"1871\">\n<th data-start=\"1798\" data-end=\"1812\" data-col-size=\"sm\">Concept<\/th>\n<th data-start=\"1812\" data-end=\"1848\" data-col-size=\"sm\">Purpose<\/th>\n<th data-start=\"1848\" data-end=\"1871\" data-col-size=\"sm\">Example<\/th>\n<\/tr>\n<\/thead>\n<tbody data-start=\"1946\" data-end=\"2170\">\n<tr data-start=\"1946\" data-end=\"2019\">\n<td data-start=\"1946\" data-end=\"1960\" data-col-size=\"sm\">Constant<\/td>\n<td data-start=\"1960\" data-end=\"1996\" data-col-size=\"sm\">Fixed value<\/td>\n<td data-start=\"1996\" data-end=\"2019\" data-col-size=\"sm\"><code data-start=\"1998\" data-end=\"2017\">const int a = 10;<\/code><\/td>\n<\/tr>\n<tr data-start=\"2020\" data-end=\"2095\">\n<td data-start=\"2020\" data-end=\"2034\" data-col-size=\"sm\">Variable<\/td>\n<td data-start=\"2034\" data-end=\"2070\" data-col-size=\"sm\">Storage for changing data<\/td>\n<td data-start=\"2070\" data-end=\"2095\" data-col-size=\"sm\"><code data-start=\"2072\" data-end=\"2093\">float height = 5.7;<\/code><\/td>\n<\/tr>\n<tr data-start=\"2096\" data-end=\"2170\">\n<td data-start=\"2096\" data-end=\"2110\" data-col-size=\"sm\">Keyword<\/td>\n<td data-start=\"2110\" data-end=\"2146\" data-col-size=\"sm\">Reserved words in C language<\/td>\n<td data-start=\"2146\" data-end=\"2170\" data-col-size=\"sm\"><code data-start=\"2148\" data-end=\"2152\">if<\/code>, <code data-start=\"2154\" data-end=\"2159\">int<\/code>, <code data-start=\"2161\" data-end=\"2168\">while<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"sticky end-(--thread-content-margin) h-0 self-end select-none\">\n<div class=\"absolute end-0 flex items-end\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<hr data-start=\"2172\" data-end=\"2175\" \/>\n<h2 data-start=\"2177\" data-end=\"2202\">\ud83d\udccc Practice Questions:<\/h2>\n<ol data-start=\"2204\" data-end=\"2322\">\n<li data-start=\"2204\" data-end=\"2322\">\n<p data-start=\"2207\" data-end=\"2322\">Which of the following is a valid variable name?<br data-start=\"2255\" data-end=\"2258\" \/>a) <code data-start=\"2264\" data-end=\"2272\">1value<\/code><br data-start=\"2272\" data-end=\"2275\" \/>b) <code data-start=\"2281\" data-end=\"2289\">value1<\/code><br data-start=\"2289\" data-end=\"2292\" \/>c) <code data-start=\"2298\" data-end=\"2305\">float<\/code><br data-start=\"2305\" data-end=\"2308\" \/>d) <code data-start=\"2314\" data-end=\"2322\">value#<\/code><\/p>\n<\/li>\n<\/ol>\n<p data-start=\"2324\" data-end=\"2355\">\u2705 Correct Answer: <strong data-start=\"2342\" data-end=\"2355\">b) value1<\/strong><\/p>\n<ol start=\"2\" data-start=\"2357\" data-end=\"2430\">\n<li data-start=\"2357\" data-end=\"2430\">\n<p data-start=\"2360\" data-end=\"2430\">What will happen if you try to change the value of a <code data-start=\"2413\" data-end=\"2420\">const<\/code> variable?<\/p>\n<\/li>\n<\/ol>\n<p data-start=\"2432\" data-end=\"2472\">\u2705 It will give a <strong data-start=\"2449\" data-end=\"2471\">compile-time error<\/strong>.<\/p>\n<hr data-start=\"2474\" data-end=\"2477\" \/>\n<p data-start=\"2479\" data-end=\"2557\" data-is-last-node=\"\" data-is-only-node=\"\">Would you like a <strong data-start=\"2496\" data-end=\"2504\">quiz<\/strong>, <strong data-start=\"2506\" data-end=\"2519\">worksheet<\/strong>, or <strong data-start=\"2524\" data-end=\"2551\">Part 6: Data Types in C<\/strong> next?<\/p>\n<h3 class=\"LC20lb MBeuO DKV0Md\"><a href=\"https:\/\/vpmpce.wordpress.com\/wp-content\/uploads\/2018\/07\/3310701-unit-2.pdf\" target=\"_blank\" rel=\"noopener\">unit-2 &#8211; constant,variable &amp; data types<\/a><\/h3>\n<h3 data-start=\"2479\" data-end=\"2557\"><a href=\"http:\/\/gdcbeerwah.edu.in\/Files\/4506570f-d508-4426-9ccc-012bcbb608c5\/Custom\/8.0%20C%20tokens%20-%20keywords,%20identifiers,%20constants.pdf\" target=\"_blank\" rel=\"noopener\">Constants, Variables and Keywords- part 5.<\/a><\/h3>\n<h3 class=\"LC20lb MBeuO DKV0Md\"><a href=\"https:\/\/www.pearsonhighered.com\/assets\/samplechapter\/0\/6\/7\/2\/067232072X.pdf\" target=\"_blank\" rel=\"noopener\">Variables and Constants &#8211; Pearson Higher Education<\/a><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>Constants, Variables and Keywords- part 5. [fvplayer id=&#8221;98&#8243;] Constants, Variables, and Keywords &#8211; Part 5 \u00a01. Constants: Constants are fixed values that do not change during the execution of a program. They can be of various types, like integer constants, floating-point constants, character constants, and string constants. Examples: Integer Constant: 5, -10, 100 Floating-point Constant: [&hellip;]<\/p>\n","protected":false},"author":71,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[97],"tags":[],"class_list":["post-2755","post","type-post","status-publish","format-standard","hentry","category-c-programming"],"_links":{"self":[{"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/posts\/2755","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/users\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/comments?post=2755"}],"version-history":[{"count":0,"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/posts\/2755\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/media?parent=2755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/categories?post=2755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/tags?post=2755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}