{"id":2762,"date":"2025-06-07T05:23:52","date_gmt":"2025-06-07T05:23:52","guid":{"rendered":"https:\/\/diznr.com\/?p=2762"},"modified":"2025-06-07T05:23:52","modified_gmt":"2025-06-07T05:23:52","slug":"what-is-c-2-part","status":"publish","type":"post","link":"https:\/\/www.reilsolar.com\/pdf\/what-is-c-2-part\/","title":{"rendered":"What is C &#8211; part 2"},"content":{"rendered":"<p>What is C &#8211; part 2<\/p>\n<p>[fvplayer id=&#8221;101&#8243;]<\/p>\n<h3 class=\"\" data-start=\"0\" data-end=\"53\">\ud83d\udcbb <strong data-start=\"7\" data-end=\"53\">What is C? \u2013 Part 2: Intermediate Concepts<\/strong><\/h3>\n<p class=\"\" data-start=\"55\" data-end=\"202\">In <strong data-start=\"58\" data-end=\"68\">Part 1<\/strong>, you likely learned the basics of the <strong data-start=\"107\" data-end=\"133\">C programming language<\/strong> \u2014 such as data types, variables, operators, and simple input\/output.<\/p>\n<p class=\"\" data-start=\"204\" data-end=\"317\">Now, in <strong data-start=\"212\" data-end=\"222\">Part 2<\/strong>, we will explore <strong data-start=\"240\" data-end=\"265\">intermediate concepts<\/strong> of C that are essential for building real programs.<\/p>\n<hr class=\"\" data-start=\"319\" data-end=\"322\" \/>\n<h2 class=\"\" data-start=\"324\" data-end=\"365\">\ud83d\udd39 Part 2: Key Topics in C Programming<\/h2>\n<h3 class=\"\" data-start=\"367\" data-end=\"416\">1\ufe0f\u20e3 <strong data-start=\"375\" data-end=\"416\">Control Statements (if, else, switch)<\/strong><\/h3>\n<p class=\"\" data-start=\"417\" data-end=\"491\">These are used to <strong data-start=\"435\" data-end=\"455\">control the flow<\/strong> of the program based on conditions.<\/p>\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-keyword\">if<\/span> (marks &gt;= <span class=\"hljs-number\">40<\/span>) {<br \/>\n    <span class=\"hljs-built_in\">printf<\/span>(<span class=\"hljs-string\">\"Pass\"<\/span>);<br \/>\n} <span class=\"hljs-keyword\">else<\/span> {<br \/>\n    <span class=\"hljs-built_in\">printf<\/span>(<span class=\"hljs-string\">\"Fail\"<\/span>);<br \/>\n}<br \/>\n<\/code><\/div>\n<\/div>\n<h3 class=\"\" data-start=\"573\" data-end=\"613\">2\ufe0f\u20e3 <strong data-start=\"581\" data-end=\"613\">Loops (for, while, do-while)<\/strong><\/h3>\n<p class=\"\" data-start=\"614\" data-end=\"660\">Loops allow repeated execution of code blocks.<\/p>\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-keyword\">for<\/span> (<span class=\"hljs-type\">int<\/span> i = <span class=\"hljs-number\">1<\/span>; i &lt;= <span class=\"hljs-number\">5<\/span>; i++) {<br \/>\n    <span class=\"hljs-built_in\">printf<\/span>(<span class=\"hljs-string\">\"%d \"<\/span>, i);<br \/>\n}<br \/>\n<\/code><\/div>\n<\/div>\n<h3 class=\"\" data-start=\"727\" data-end=\"748\">3\ufe0f\u20e3 <strong data-start=\"735\" data-end=\"748\">Functions<\/strong><\/h3>\n<p class=\"\" data-start=\"749\" data-end=\"817\">Functions are <strong data-start=\"763\" data-end=\"781\">blocks of code<\/strong> designed to perform specific tasks.<\/p>\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-title function_\">add<\/span><span class=\"hljs-params\">(<span class=\"hljs-type\">int<\/span><\/span> a, <span class=\"hljs-type\">int<\/span> b) {<br \/>\n    <span class=\"hljs-keyword\">return<\/span> a + b;<br \/>\n}<br \/>\n<\/code><\/div>\n<\/div>\n<h3 class=\"\" data-start=\"873\" data-end=\"891\">4\ufe0f\u20e3 <strong data-start=\"881\" data-end=\"891\">Arrays<\/strong><\/h3>\n<p class=\"\" data-start=\"892\" data-end=\"954\">Arrays are used to <strong data-start=\"911\" data-end=\"936\">store multiple values<\/strong> of the same type.<\/p>\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\">5<\/span>] = {<span class=\"hljs-number\">90<\/span>, <span class=\"hljs-number\">85<\/span>, <span class=\"hljs-number\">88<\/span>, <span class=\"hljs-number\">75<\/span>, <span class=\"hljs-number\">95<\/span>};<br \/>\n<\/code><\/div>\n<\/div>\n<h3 class=\"\" data-start=\"1003\" data-end=\"1038\">5\ufe0f\u20e3 <strong data-start=\"1011\" data-end=\"1038\">Pointers (Introduction)<\/strong><\/h3>\n<p class=\"\" data-start=\"1039\" data-end=\"1117\">Pointers store the <strong data-start=\"1058\" data-end=\"1083\">address of a variable<\/strong>. This is a powerful concept in C.<\/p>\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> x = <span class=\"hljs-number\">10<\/span>;<br \/>\n<span class=\"hljs-type\">int<\/span> *ptr = &amp;x;<br \/>\n<span class=\"hljs-built_in\">printf<\/span>(<span class=\"hljs-string\">\"%d\"<\/span>, *ptr);  <span class=\"hljs-comment\">\/\/ Outputs 10<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<hr class=\"\" data-start=\"1191\" data-end=\"1194\" \/>\n<h2 class=\"\" data-start=\"1196\" data-end=\"1226\">\ud83d\udccc Other Important Concepts<\/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=\"1228\" data-end=\"1543\">\n<thead data-start=\"1228\" data-end=\"1264\">\n<tr data-start=\"1228\" data-end=\"1264\">\n<th data-start=\"1228\" data-end=\"1249\" data-col-size=\"sm\">Concept<\/th>\n<th data-start=\"1249\" data-end=\"1264\" data-col-size=\"md\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody data-start=\"1302\" data-end=\"1543\">\n<tr data-start=\"1302\" data-end=\"1369\">\n<td data-start=\"1302\" data-end=\"1323\" data-col-size=\"sm\"><strong data-start=\"1304\" data-end=\"1318\">Structures<\/strong><\/td>\n<td data-start=\"1323\" data-end=\"1369\" data-col-size=\"md\">Used to group different types of variables<\/td>\n<\/tr>\n<tr data-start=\"1370\" data-end=\"1422\">\n<td data-start=\"1370\" data-end=\"1391\" data-col-size=\"sm\"><strong data-start=\"1372\" data-end=\"1389\">File Handling<\/strong><\/td>\n<td data-start=\"1391\" data-end=\"1422\" data-col-size=\"md\">To read\/write from\/to files<\/td>\n<\/tr>\n<tr data-start=\"1423\" data-end=\"1473\">\n<td data-start=\"1423\" data-end=\"1444\" data-col-size=\"sm\"><strong data-start=\"1425\" data-end=\"1438\">Recursion<\/strong><\/td>\n<td data-col-size=\"md\" data-start=\"1444\" data-end=\"1473\">A function calling itself<\/td>\n<\/tr>\n<tr data-start=\"1474\" data-end=\"1543\">\n<td data-start=\"1474\" data-end=\"1504\" data-col-size=\"sm\"><strong data-start=\"1476\" data-end=\"1503\">Preprocessor Directives<\/strong><\/td>\n<td data-col-size=\"md\" data-start=\"1504\" data-end=\"1543\">Commands like <code data-start=\"1520\" data-end=\"1530\">#include<\/code>, <code data-start=\"1532\" data-end=\"1541\">#define<\/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 class=\"\" data-start=\"1545\" data-end=\"1548\" \/>\n<h2 class=\"\" data-start=\"1550\" data-end=\"1588\">\u2705 Example Program \u2013 Function &amp; Loop<\/h2>\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-meta\">#<span class=\"hljs-keyword\">include<\/span><\/span> <span class=\"hljs-string\">&lt;stdio.h&gt;<\/span><\/p>\n<p><span class=\"hljs-type\">int<\/span> <span class=\"hljs-title function_\">multiply<\/span><span class=\"hljs-params\">(<span class=\"hljs-type\">int<\/span><\/span> a, <span class=\"hljs-type\">int<\/span> b) {<br \/>\n    <span class=\"hljs-keyword\">return<\/span> a * b;<br \/>\n}<\/p>\n<p><span class=\"hljs-type\">int<\/span> <span class=\"hljs-title function_\">main<\/span><span class=\"hljs-params\">()<\/span> {<br \/>\n    <span class=\"hljs-keyword\">for<\/span> (<span class=\"hljs-type\">int<\/span> i = <span class=\"hljs-number\">1<\/span>; i &lt;= <span class=\"hljs-number\">5<\/span>; i++) {<br \/>\n        <span class=\"hljs-built_in\">printf<\/span>(<span class=\"hljs-string\">\"2 x %d = %d\\n\"<\/span>, i, multiply(<span class=\"hljs-number\">2<\/span>, i));<br \/>\n    }<br \/>\n    <span class=\"hljs-keyword\">return<\/span> <span class=\"hljs-number\">0<\/span>;<br \/>\n}<br \/>\n<\/code><\/div>\n<\/div>\n<hr class=\"\" data-start=\"1791\" data-end=\"1794\" \/>\n<h2 class=\"\" data-start=\"1796\" data-end=\"1819\">\ud83e\udde0 Tip for Learners:<\/h2>\n<ul data-start=\"1820\" data-end=\"2006\">\n<li class=\"\" data-start=\"1820\" data-end=\"1906\">\n<p class=\"\" data-start=\"1822\" data-end=\"1906\">Practice writing small programs like calculator, table printing, and sorting arrays.<\/p>\n<\/li>\n<li class=\"\" data-start=\"1907\" data-end=\"2006\">\n<p class=\"\" data-start=\"1909\" data-end=\"2006\">Use an online compiler like replit.com or ideone.com.<\/p>\n<\/li>\n<\/ul>\n<hr class=\"\" data-start=\"2008\" data-end=\"2011\" \/>\n<p class=\"\" data-start=\"2013\" data-end=\"2134\">Would you like a <strong data-start=\"2030\" data-end=\"2040\">Part 3<\/strong> covering advanced topics like <strong data-start=\"2071\" data-end=\"2096\">pointers to functions<\/strong>, <strong data-start=\"2098\" data-end=\"2116\">dynamic memory<\/strong>, or <strong data-start=\"2121\" data-end=\"2133\">file I\/O<\/strong>?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is C &#8211; part 2 [fvplayer id=&#8221;101&#8243;] \ud83d\udcbb What is C? \u2013 Part 2: Intermediate Concepts In Part 1, you likely learned the basics of the C programming language \u2014 such as data types, variables, operators, and simple input\/output. Now, in Part 2, we will explore intermediate concepts of C that are essential for [&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-2762","post","type-post","status-publish","format-standard","hentry","category-c-programming"],"_links":{"self":[{"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/posts\/2762","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=2762"}],"version-history":[{"count":0,"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/posts\/2762\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/media?parent=2762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/categories?post=2762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.reilsolar.com\/pdf\/wp-json\/wp\/v2\/tags?post=2762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}