

{"id":54964,"date":"2019-04-23T15:26:44","date_gmt":"2019-04-23T09:56:44","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=54964"},"modified":"2019-07-03T17:38:56","modified_gmt":"2019-07-03T12:08:56","slug":"basic-structure-of-c-program","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/","title":{"rendered":"Learn the Basic Structure of C Program in 7 Mins"},"content":{"rendered":"<p>Programming in C is a difficult task for someone who is completely oblivious to the basic structure of a C program. After completing this tutorial, you would learn how the Structure of C Program looks like and soon you would be comfortable writing your own programs with ease!<\/p>\n<p>So, what are you waiting for? Let&#8217;s start the Basic Structure of the C program.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-Structure-in-C-Programming.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-55013\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-Structure-in-C-Programming.jpg\" alt=\"Structure of C programs\" width=\"802\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-Structure-in-C-Programming.jpg 802w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-Structure-in-C-Programming-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-Structure-in-C-Programming-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-Structure-in-C-Programming-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-Structure-in-C-Programming-520x272.jpg 520w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/a><\/p>\n<h2>Anatomy of a C Program<\/h2>\n<p>C language has a bundle of protocols that define its programming activities.<\/p>\n<p>The C programming language came into existence when its developers were working on the development of the Unix operating system using the B language, out of which C evolved. The B language lacked certain features that led to the <em><strong><a href=\"https:\/\/data-flair.training\/blogs\/c-tutorial\/\">introduction of C<\/a>.<\/strong><\/em> These features constituted the part of the C program upon which it was is built.<\/p>\n<h4>Parts of C program-<\/h4>\n<ol>\n<li><strong># include &lt;stdio.h&gt; &#8211;\u00a0<\/strong>This command is a <em><strong><a href=\"https:\/\/data-flair.training\/blogs\/preprocessors-in-c\/\">preprocessor directive\u00a0in C<\/a><\/strong><\/em>\u00a0that includes all standard input-output files before compiling any C program so as to make use of all those functions in our C program.<\/li>\n<li>\u00a0<strong>int main() &#8211;<\/strong> This is the line from where the<em> execution of the program starts<\/em>. The main() function starts the execution of any C program.<\/li>\n<li><strong>{ (Opening bracket) &#8211;<\/strong> This indicates the <em>beginning of any function<\/em> in the program (Here it indicates the beginning of the main function).<\/li>\n<li><strong>\/* some comments *\/ &#8211;\u00a0<\/strong>Whatever is inside \/*&#8212;&#8212;-*\/ are <em>not compiled and executed<\/em>; they are only written for user understanding or for making the program interactive by inserting a comment line.\u00a0These are known as multiline comments. Single line comments are represented with the help of 2 forward slashes \u201c\/\/\u2014\u2014\u201d.<\/li>\n<li><strong>printf(\u201cHello World\u201d) &#8211;<\/strong>The printf() command is included in the C stdio.h library, which helps to <em>display the message on the output screen<\/em>.<\/li>\n<li><strong>getch() &#8211;\u00a0<\/strong>This command helps to <em>hold the screen<\/em>.<\/li>\n<li><strong>return 0 &#8211;<\/strong>This command terminates the C program and returns a null value, that is, 0.<\/li>\n<li><strong>} (Closing brackets)-\u00a0<\/strong> This indicates the <em>end of the function<\/em>.\u00a0(Here it indicates the end of the main function)<\/li>\n<\/ol>\n<p><em><strong>Before we move towards an example, you should revise the <a href=\"https:\/\/data-flair.training\/blogs\/c-basic-syntax-rules\/\">Syntax of C<\/a>.<\/strong><\/em><\/p>\n<h2>Example of C Program Structure<\/h2>\n<p>The \u201cHello World!\u201d example is the most popular and basic program that will help you get started with programming. This program helps you display the output \u201cHello World\u201d on the output screen.<\/p>\n<p>With the help of this example, we can easily understand the basic structure of a C program.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">#include &lt;stdio.h&gt;\r\nint main()\r\n{\r\n\/\/ Our first basic program in C \r\nprintf(\"Hello World!\\n\\n\");\r\nreturn 0;\r\n}<\/pre>\n<p><strong>Code on Screen-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Hello-World-Example-of-C.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-57394\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Hello-World-Example-of-C.jpg\" alt=\"Example of C Program Structure\" width=\"1304\" height=\"648\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Hello-World-Example-of-C.jpg 1304w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Hello-World-Example-of-C-150x75.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Hello-World-Example-of-C-300x149.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Hello-World-Example-of-C-768x382.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Hello-World-Example-of-C-1024x509.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Hello-World-Example-of-C-520x258.jpg 520w\" sizes=\"auto, (max-width: 1304px) 100vw, 1304px\" \/><\/a><\/p>\n<p><strong>Output-\u00a0<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-C-program.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-59501\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-C-program.jpg\" alt=\"Output of C program\" width=\"1302\" height=\"691\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-C-program.jpg 1302w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-C-program-150x80.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-C-program-300x159.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-C-program-768x408.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-C-program-1024x543.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-C-program-520x276.jpg 520w\" sizes=\"auto, (max-width: 1302px) 100vw, 1302px\" \/><\/a><\/p>\n<p>You can practice the code explained above and compile it on your machine to get an essence of C programming.<\/p>\n<p><strong>Key takeaway:<\/strong> \\n is used to move the cursor to the new line.<\/p>\n<h3>Steps involved to get the desired output<\/h3>\n<p>Well, when you run a C program and get the output on your screen, there is a series of steps that come in the way. To get the desired output, you need to follow all the steps. These are the steps involved while writing a program in C.<\/p>\n<ol>\n<li>Create<\/li>\n<li>Compile<\/li>\n<li>Execute or run<\/li>\n<li>Desired output<\/li>\n<\/ol>\n<p>First of all, try to code the program in the most precise manner following the protocols of <a href=\"https:\/\/en.wikipedia.org\/wiki\/C_(programming_language)\">C <\/a>programming like,<\/p>\n<ul>\n<li>C is a case-sensitive programming language.<\/li>\n<li>Each line of code in C ends with a semicolon(;), except the function definition.<\/li>\n<\/ul>\n<p>You can compile the code on your system once you <em><strong><a href=\"https:\/\/data-flair.training\/blogs\/install-c-on-linux\/\">install the compiler<\/a><\/strong><\/em>.<\/p>\n<p>Also, if you don\u2019t want to install the compilers on your system, you can also use the online compilers available to run your code and get the output.<\/p>\n<p>Once, your code gets executed you will surely get the desired output on your output screen.<\/p>\n<h2>Basic Structure of C Program<\/h2>\n<p>The components of the basic structure of a C program consists of 7 parts<\/p>\n<ol>\n<li>Document section<\/li>\n<li>Preprocessor\/link Section<\/li>\n<li>Definition section<\/li>\n<li>Global declaration section<\/li>\n<li>Function declaration section<\/li>\n<li>Main function<\/li>\n<li>User-defined function section<\/li>\n<\/ol>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-structure-of-C-with-Example.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-55018\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-structure-of-C-with-Example.jpg\" alt=\"Structure of C program with example\" width=\"802\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-structure-of-C-with-Example.jpg 802w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-structure-of-C-with-Example-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-structure-of-C-with-Example-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-structure-of-C-with-Example-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-structure-of-C-with-Example-520x272.jpg 520w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/a><\/p>\n<p>Still, not getting? Let\u2019s discuss every basic component of the C program with the help of an example.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\/*\r\nDocumentation section\r\nC programming structure\r\nAuthor: DataFlair\r\n*\/\r\n#include &lt;stdio.h&gt; \/* Link section *\/\r\nint subtract = 0; \/* Global declaration, definition section *\/\r\nint all (int, int); \/* Function declaration section *\/\r\nint main () \/* Main function *\/\r\n{\r\n\r\nprintf(\"Welcome to DataFlair tutorials!\\n\\n\");\r\n\r\nprintf (\"This is a C program \\n\");\r\nsubtract= all (25,10);\r\nprintf (\"Subtraction of the two numbers : %d \\n\", subtract);\r\nreturn 0;\r\n}\r\nint all (int x, int y) \/* User defined function *\/\r\n{ \r\nreturn x-y; \/* definition section *\/\r\n}<\/pre>\n<p><strong>Code on Screen-<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/basic-structure-of-C-program-with-example.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-57396\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/basic-structure-of-C-program-with-example.jpg\" alt=\"basic structure of C program with example\" width=\"1299\" height=\"678\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/basic-structure-of-C-program-with-example.jpg 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/basic-structure-of-C-program-with-example-150x78.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/basic-structure-of-C-program-with-example-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/basic-structure-of-C-program-with-example-768x401.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/basic-structure-of-C-program-with-example-1024x534.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/basic-structure-of-C-program-with-example-520x271.jpg 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><strong>Output<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-Basic-Strcuture-of-C.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-57397\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-Basic-Strcuture-of-C.jpg\" alt=\"Output of Basic Strcuture of C\" width=\"1301\" height=\"671\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-Basic-Strcuture-of-C.jpg 1301w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-Basic-Strcuture-of-C-150x77.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-Basic-Strcuture-of-C-300x155.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-Basic-Strcuture-of-C-768x396.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-Basic-Strcuture-of-C-1024x528.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Output-of-Basic-Strcuture-of-C-520x268.jpg 520w\" sizes=\"auto, (max-width: 1301px) 100vw, 1301px\" \/><\/a><\/p>\n<h5>1. Documentation Section<\/h5>\n<p>It is the section in which you can give comments to make the program more interactive. The compiler won&#8217;t compile this and hence this portion would not be displyed on the output screen.<\/p>\n<h5>2. Preprocessor directives Section<\/h5>\n<p>This section involves the use of header files that are to included necessarily program.<\/p>\n<h5>3. Definition section<\/h5>\n<p>This section involves the <a href=\"https:\/\/data-flair.training\/blogs\/variables-in-c\/\"><em><strong>variable definition and declaration in C<\/strong><\/em><\/a>.<\/p>\n<h5>4. Global declaration Section<\/h5>\n<p>This section is used to define the global variables to be used in the programs, that means you can use these variables throughout the program.<\/p>\n<h5>5. Function prototype declaration section<\/h5>\n<p>This section gives the information about a function that includes, the data type or the return type, the parameters passed or the arguments.<\/p>\n<h5>6. Main function<\/h5>\n<p>It is the major section from where the execution of the program begins. The main section involves the declaration and executable section.<\/p>\n<h5>7. User-defined function section<\/h5>\n<p>When you want to define your function that fulfills a particular requirement, you can define them in this section.<\/p>\n<h2>Summary<\/h2>\n<p>We learned about the basic structure of a C program and also the commands necessary to build a C program. Every C program involves many sections that complete the program; we have gone through all these sections with the help of some examples.<\/p>\n<p>Hopefully, you have learned well from this tutorial, made with extreme simplicity to help you learn the basics of programming in C. You may also enjoy the <em><b><a href=\"https:\/\/data-flair.training\/blogs\/data-types-in-c\/\">Data Types in C language<\/a>.<\/b><\/em><\/p>\n<p>Did you like the article? Share your experience in the comment section.<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:1483,&quot;href&quot;:&quot;https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/C_(programming_language)&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251205115343\\\/https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/C_(programming_language)&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-09 08:48:42&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-12 09:01:03&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-15 12:27:27&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-18 15:58:44&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-22 04:52:39&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-25 07:47:58&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-28 07:49:34&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-31 10:04:18&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-03 13:16:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-06 16:33:59&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-09 23:54:15&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-13 00:12:02&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-16 01:20:51&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-19 06:06:53&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-22 08:41:46&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-25 09:05:11&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-28 10:37:00&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-31 14:56:39&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-03 20:18:29&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-07 03:00:19&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-10 05:16:45&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-13 09:34:33&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-17 04:05:39&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-20 05:05:34&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-23 08:37:49&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-26 11:07:05&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-01 15:45:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-05 05:56:05&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-08 10:59:07&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-11 11:01:49&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-14 11:45:46&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-17 15:31:09&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-20 16:41:07&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-23 18:46:11&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-27 02:31:24&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-30 05:51:05&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-02 13:02:50&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-06 04:44:34&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-09 06:24:20&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-12 07:15:52&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-15 07:33:00&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-18 07:48:49&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-21 11:15:50&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-25 02:39:47&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-28 03:27:40&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-01 14:16:09&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-04 16:27:01&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-07 20:44:30&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-11 12:34:03&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-14 16:12:28&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-17 18:26:13&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-20 18:34:35&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-24 14:09:17&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-27 18:14:38&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-31 08:27:44&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-03 08:40:08&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-06 13:07:55&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-09 14:05:01&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-06-12 17:06:40&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-12 17:06:40&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Programming in C is a difficult task for someone who is completely oblivious to the basic structure of a C program. After completing this tutorial, you would learn how the Structure of C Program&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":55013,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19488],"tags":[19577,19578,19576],"class_list":["post-54964","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","tag-basic-c-program","tag-c-program-structure","tag-c-programming-structure"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Learn the Basic Structure of C Program in 7 Mins - DataFlair<\/title>\n<meta name=\"description\" content=\"Want to learn Basic structure of C program with example? how c program runs? what are the parts of C progam, we will teach you all aspects of C Programming\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learn the Basic Structure of C Program in 7 Mins - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Want to learn Basic structure of C program with example? how c program runs? what are the parts of C progam, we will teach you all aspects of C Programming\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-23T09:56:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-03T12:08:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-Structure-in-C-Programming.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Learn the Basic Structure of C Program in 7 Mins - DataFlair","description":"Want to learn Basic structure of C program with example? how c program runs? what are the parts of C progam, we will teach you all aspects of C Programming","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/","og_locale":"en_US","og_type":"article","og_title":"Learn the Basic Structure of C Program in 7 Mins - DataFlair","og_description":"Want to learn Basic structure of C program with example? how c program runs? what are the parts of C progam, we will teach you all aspects of C Programming","og_url":"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2019-04-23T09:56:44+00:00","article_modified_time":"2019-07-03T12:08:56+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-Structure-in-C-Programming.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Learn the Basic Structure of C Program in 7 Mins","datePublished":"2019-04-23T09:56:44+00:00","dateModified":"2019-07-03T12:08:56+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/"},"wordCount":926,"commentCount":10,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-Structure-in-C-Programming.jpg","keywords":["Basic C Program","C program Structure","C Programming Structure"],"articleSection":["C Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/","url":"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/","name":"Learn the Basic Structure of C Program in 7 Mins - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-Structure-in-C-Programming.jpg","datePublished":"2019-04-23T09:56:44+00:00","dateModified":"2019-07-03T12:08:56+00:00","description":"Want to learn Basic structure of C program with example? how c program runs? what are the parts of C progam, we will teach you all aspects of C Programming","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-Structure-in-C-Programming.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2019\/04\/Basic-Structure-in-C-Programming.jpg","width":802,"height":420,"caption":"Structure of C programs"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/basic-structure-of-c-program\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"C Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/c-programming\/"},{"@type":"ListItem","position":3,"name":"Learn the Basic Structure of C Program in 7 Mins"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/54964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=54964"}],"version-history":[{"count":16,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/54964\/revisions"}],"predecessor-version":[{"id":61985,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/54964\/revisions\/61985"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/55013"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=54964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=54964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=54964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}