{"id":8403,"date":"2022-04-14T11:49:20","date_gmt":"2022-04-14T11:49:20","guid":{"rendered":"https:\/\/www.prepbytes.com\/blog\/?p=8403"},"modified":"2023-06-14T09:16:03","modified_gmt":"2023-06-14T09:16:03","slug":"10-simple-c-programs-for-beginners","status":"publish","type":"post","link":"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/","title":{"rendered":"10 Simple C++ Programs for Beginners"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1648682853565-B_297-10-c%2B%2B.png\" alt=\"\" \/><\/p>\n<p>C++ is one the most popular language in the programming world. In this article we will be looking towards 10 basic C++ programs for beginners in CPP. C++ is a powerful general-purpose programming language that was developed in the early 1980s as an extension of the C programming language. It is widely used for developing a wide range of applications, including system software, game development, embedded systems, high-performance applications, and more.<\/p>\n<p>C++ combines both high-level and low-level programming features, offering a balance between performance and abstraction. It supports procedural, object-oriented, and generic programming paradigms, giving developers flexibility in designing and implementing their solutions.<\/p>\n<h2>10 Simple C++ Programs for Beginners<\/h2>\n<p>Below are the top 10 simple C++ programs for beginners:<\/p>\n<ol>\n<li><strong>Wrtie a program for Adding two numbers in C++.<\/strong><br \/>\nTo Add two numbers in C++ we will read two numbers a and b from the user then perform add operation to add a and b together to print the addition of two numbers in C++.<\/p>\n<pre><code>#include &lt;iostream&gt;\nusing namespace std;\nint main() {\nint a ;\nint b ;\ncin&gt;&gt;a&gt;&gt;b;\ncout&lt;&lt;a+b;\nreturn 0;\n}\nInput: 2 5\nOutput: 7<\/code><\/pre>\n<\/li>\n<li><strong>C++ program to Check if a number is even or odd.<\/strong><br \/>\nTO Check if a given number is even or odd in C++, we simply divide the given number by 2, if the remainder is 0 then it is even otherwise odd.<\/p>\n<pre><code>#include &lt;iostream&gt;\nusing namespace std;\nint main() {\nint a ;\ncin&gt;&gt;a;\nif(a%2 == 0)  \/\/ if remainder is zero then even number\n    cout&lt;&lt;\u201deven\u201d;\nelse       \n    cout&lt;&lt;\u201dodd\u201d;\nreturn 0;\n}\nInput: 8\nOutput: even<\/code><\/pre>\n<\/li>\n<li><strong>Write a program to swap two numbers in C++.<\/strong><br \/>\nWe will use a temporary variable to store one of the numbers to perform the swap operation.<\/p>\n<pre><code>#include &lt;iostream&gt;\nusing namespace std;\nint main() {\nint a = 10;\nint b = 20;\ncout&lt;&lt;a&lt;&lt;&quot; &quot;&lt;&lt;b&lt;&lt;endl;\nint temp = a;\na = b;\nb = temp;\ncout&lt;&lt;a&lt;&lt;&quot; &quot;&lt;&lt;b&lt;&lt;endl;\nreturn 0;\n}\nOutput: 10 20\n20 10<\/code><\/pre>\n<\/li>\n<li><strong>Write a C++ program to find the largest number among three numbers.<\/strong><br \/>\nA number will be largest if number is greater than both the other numbers.<\/p>\n<pre><code>#include &lt;iostream&gt;\nusing namespace std;\nint main() {\nfloat a, b, c;\ncin &gt;&gt; a &gt;&gt; b &gt;&gt; c;\nif(a &gt;= b &amp;&amp; a &gt;= c)\n    cout &lt;&lt; &quot;Largest number: &quot; &lt;&lt; a;\nif(b &gt;= a &amp;&amp; b &gt;= c)\n    cout &lt;&lt; &quot;Largest number: &quot; &lt;&lt; b;\nif(c &gt;= a &amp;&amp; c &gt;= b)\n    cout &lt;&lt; &quot;Largest number: &quot; &lt;&lt; c;\nreturn 0;\n}\nInput: 1 2 3\nLargest number: 3<\/code><\/pre>\n<\/li>\n<li><strong>Write a C++ Program to Find the sum of all the natural numbers from 1 to n.<\/strong><br \/>\nTo find the sum of all the natural number from 1 to n in C++, We have two methods, one is by iterating from 1 to n and adding them up while the other way is using the summation formula &#8211;<\/p>\n<pre><code>summation of i from 1 to n=n(n+1)\/2=1+2+3+4+..+(n-1)+n\n#include &lt;iostream&gt;\nusing namespace std;\nint main()\n{\nint n, sum = 0;\ncin &gt;&gt; n;\nfor (int i = 1; i &lt;= n; ++i) {\n    sum += i;\n}\n\/\/ or sum = n*(n+1)\/2;\ncout &lt;&lt; sum;\nreturn 0;\n}\nInput: 5\nOutput: 15<\/code><\/pre>\n<\/li>\n<li><strong>Write a program in C++ to check whether a number is prime or not.<\/strong><br \/>\nA prime number is not divisible by any number smaller than it except 1. Basically, it has only two factors 1 and itself.<\/p>\n<pre><code>#include &lt;iostream&gt;\nusing namespace std;\nint main() {\nint a ;\ncin&gt;&gt;a;\nint b = 2;\n\/\/start from b as 1 can divide any number\nbool prime = true;\nwhile(b!=a){\n    if(a%b == 0)\n        {\n            prime = false;\n            break;\n        }\n    b++;\n}\nif(prime)\n    cout&lt;&lt;&quot;prime&quot;;\nelse \n    cout&lt;&lt;&quot;not prime&quot;;\nreturn 0;\n}\nOutput: prime<\/code><\/pre>\n<\/li>\n<li><strong>Write a C++ program to Compute the power a given number to a given power.<\/strong><br \/>\nTo compute the power of a given number in C++, We initialize a variable result to 1. Then, we&#8217;ll use a while loop to multiply the result by base for power number of times.<\/p>\n<pre><code>3^3=3*3*3=27\n#include &lt;iostream&gt;\nusing namespace std;\nint main() \n{\nint power;\nfloat base, result = 1;\ncin &gt;&gt; base &gt;&gt;power;\nwhile (power != 0) {\n    result *= base;\n    power--;\n}\ncout &lt;&lt; result;\nreturn 0;\n}\nInput: 3 3\nOutput: 27<\/code><\/pre>\n<\/li>\n<li><strong>Write a C++ program to Calculate the average of all the elements present in an array.<\/strong><br \/>\nWe iterate over each element of the array and calculate the sum of all the elements. Then, we divide the sum by the size of the array to get the average. The average is stored in a variable of type float and returned.<\/p>\n<pre><code>average= summation\u3016arr[i]\u3017\/n\n#include &lt;iostream&gt;\nusing namespace std;\nint main()\n{\nint n;\ncin&gt;&gt;n;\nint arr[n];\nfloat sum = 0.0;\nfor(int i = 0;i&lt;n;i++)\n    cin&gt;&gt;arr[i];\nfor(int i = 0;i&lt;n;i++)\n    sum += arr[i];\ncout&lt;&lt;(float)(sum\/(float)n);\nreturn 0;\n}\nInput: 3\n1 4 5\nOutput: 3.33333<\/code><\/pre>\n<\/li>\n<li><strong>Write a program to find the GCD of two numbers in C++.<\/strong><br \/>\nGCD is the greatest common divisor of the two numbers.<\/p>\n<pre><code>#include &lt;iostream&gt;\nusing namespace std;\nint gcd(int a,int b){\nif(b == 0)\n    return a;\nreturn gcd(b,a%b);\n}\nint main() {\nint a ,b ;\ncin&gt;&gt;a&gt;&gt;b;\ncout&lt;&lt;gcd(a,b);\nreturn 0;\n}\nInput: 35 25\nOutput: 5<\/code><\/pre>\n<\/li>\n<li><strong>Write a function to find the length of a string in C++.<\/strong><br \/>\nTo find the length of a string in C++, we will Iterate through the string and increase count by 1 till we reach the end of the string.<\/p>\n<pre><code>#include &lt;iostream&gt;\nusing namespace std;\nint main() \n{\nstring str;\ncin&gt;&gt;str;\nint count = 0;\nfor(int i = 0;str[i];i++) \/\/ till the string character is null\n    count++;\ncout&lt;&lt;count;\n}\nInput: abcde\nOutput: 5<\/code><\/pre>\n<\/li>\n<\/ol>\n<p><strong>Summary<\/strong><\/p>\n<ul>\n<li>Building Basic C++ programs is a great way for beginners to learn the basics of the language and gain confidence in programming.<\/li>\n<li>By working on these programs, beginners can practice fundamental concepts like variables, data types, control structures, and functions.<\/li>\n<li>The 10 simple C++ programs cover a range of topics, including arithmetic operations, input\/output, conditionals, loops, and arrays.<\/li>\n<li>Working through these programs allows beginners to apply their knowledge and develop problem-solving skills.<\/li>\n<li>It is important to understand and analyze the code of these programs to grasp the underlying concepts fully.<\/li>\n<li>As beginners progress, they can modify and expand upon these programs to create more complex applications.<\/li>\n<\/ul>\n<h2>FAQs related to 10 simple C++ programs for beginners:<\/h2>\n<p>Some FAQs related to Basic C++ programs for Beginners are listed below:<br \/>\n<strong>Q1. What are some recommended programs for beginners in C++?<\/strong><br \/>\nSome recommended programs for beginners include calculating the area of a triangle, finding the factorial of a number, generating Fibonacci series, converting temperature units, and implementing a simple calculator.<\/p>\n<p><strong>Q2. How do I compile and run these programs?<\/strong><br \/>\nTo compile and run C++ programs, you need a C++ compiler installed on your system. Popular compilers include GCC (GNU Compiler Collection) and Microsoft Visual C++. You can use a command-line interface or an Integrated Development Environment (IDE) like Code::Blocks, Dev-C++, or Visual Studio Code to write, compile, and run your programs.<\/p>\n<p><strong>Q3. What are some common errors beginners may encounter?<\/strong><br \/>\nBeginners may encounter errors such as syntax errors (e.g., missing semicolons or parentheses), logical errors (e.g., incorrect conditions or loop structures), or runtime errors (e.g., dividing by zero or accessing invalid memory locations). These errors can be resolved by carefully analyzing the code and using debugging techniques.<\/p>\n<p><strong>Q4. How can I improve my programming skills beyond these simple programs?<\/strong><br \/>\nTo improve your programming skills, you can challenge yourself by tackling more complex programs and projects. Explore advanced topics like object-oriented programming, file handling, data structures, and algorithms. Additionally, participate in coding competitions, join programming communities, and practice regularly to enhance your skills.<\/p>\n<p><strong>Q5. Are there any additional resources to learn C++ for beginners?<\/strong><br \/>\nYes, there are numerous resources available for beginners to learn C++. Some recommended resources include online tutorials, video courses, interactive coding platforms and C++ programming books. These resources often provide step-by-step guidance and exercises to reinforce learning.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C++ is one the most popular language in the programming world. In this article we will be looking towards 10 basic C++ programs for beginners in CPP. C++ is a powerful general-purpose programming language that was developed in the early 1980s as an extension of the C programming language. It is widely used for developing [&hellip;]<\/p>\n","protected":false},"author":52,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-8403","post","type-post","status-publish","format-standard","hentry","category-c-programming"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>10 Simple C++ Programs for Beginners<\/title>\n<meta name=\"description\" content=\"C++ is one the most popular languages in the programming world. In this article we will be looking towards 10 simple programs for beginners.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"10 Simple C++ Programs for Beginners\" \/>\n<meta property=\"og:description\" content=\"C++ is one the most popular languages in the programming world. In this article we will be looking towards 10 simple programs for beginners.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/\" \/>\n<meta property=\"og:site_name\" content=\"PrepBytes Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prepbytes0211\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-14T11:49:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-14T09:16:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1648682853565-B_297-10-c%2B%2B.png\" \/>\n<meta name=\"author\" content=\"Prepbytes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prepbytes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/\"},\"author\":{\"name\":\"Prepbytes\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e\"},\"headline\":\"10 Simple C++ Programs for Beginners\",\"datePublished\":\"2022-04-14T11:49:20+00:00\",\"dateModified\":\"2023-06-14T09:16:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/\"},\"wordCount\":907,\"commentCount\":1,\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1648682853565-B_297-10-c%2B%2B.png\",\"articleSection\":[\"C Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/\",\"url\":\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/\",\"name\":\"10 Simple C++ Programs for Beginners\",\"isPartOf\":{\"@id\":\"http:\/\/43.205.93.38\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1648682853565-B_297-10-c%2B%2B.png\",\"datePublished\":\"2022-04-14T11:49:20+00:00\",\"dateModified\":\"2023-06-14T09:16:03+00:00\",\"description\":\"C++ is one the most popular languages in the programming world. In this article we will be looking towards 10 simple programs for beginners.\",\"breadcrumb\":{\"@id\":\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#primaryimage\",\"url\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1648682853565-B_297-10-c%2B%2B.png\",\"contentUrl\":\"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1648682853565-B_297-10-c%2B%2B.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/43.205.93.38\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C Programming\",\"item\":\"https:\/\/prepbytes.com\/blog\/category\/c-programming\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"10 Simple C++ Programs for Beginners\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/43.205.93.38\/#website\",\"url\":\"http:\/\/43.205.93.38\/\",\"name\":\"PrepBytes Blog\",\"description\":\"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING\",\"publisher\":{\"@id\":\"http:\/\/43.205.93.38\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/43.205.93.38\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/43.205.93.38\/#organization\",\"name\":\"Prepbytes\",\"url\":\"http:\/\/43.205.93.38\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"contentUrl\":\"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp\",\"width\":160,\"height\":160,\"caption\":\"Prepbytes\"},\"image\":{\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/prepbytes0211\/\",\"https:\/\/www.instagram.com\/prepbytes\/\",\"https:\/\/www.linkedin.com\/company\/prepbytes\/\",\"https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e\",\"name\":\"Prepbytes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/43.205.93.38\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g\",\"caption\":\"Prepbytes\"},\"url\":\"https:\/\/prepbytes.com\/blog\/author\/gourav-jaincollegedekho-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"10 Simple C++ Programs for Beginners","description":"C++ is one the most popular languages in the programming world. In this article we will be looking towards 10 simple programs for beginners.","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:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/","og_locale":"en_US","og_type":"article","og_title":"10 Simple C++ Programs for Beginners","og_description":"C++ is one the most popular languages in the programming world. In this article we will be looking towards 10 simple programs for beginners.","og_url":"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/","og_site_name":"PrepBytes Blog","article_publisher":"https:\/\/www.facebook.com\/prepbytes0211\/","article_published_time":"2022-04-14T11:49:20+00:00","article_modified_time":"2023-06-14T09:16:03+00:00","og_image":[{"url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1648682853565-B_297-10-c%2B%2B.png","type":"","width":"","height":""}],"author":"Prepbytes","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Prepbytes","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#article","isPartOf":{"@id":"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/"},"author":{"name":"Prepbytes","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e"},"headline":"10 Simple C++ Programs for Beginners","datePublished":"2022-04-14T11:49:20+00:00","dateModified":"2023-06-14T09:16:03+00:00","mainEntityOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/"},"wordCount":907,"commentCount":1,"publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1648682853565-B_297-10-c%2B%2B.png","articleSection":["C Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/","url":"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/","name":"10 Simple C++ Programs for Beginners","isPartOf":{"@id":"http:\/\/43.205.93.38\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#primaryimage"},"image":{"@id":"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1648682853565-B_297-10-c%2B%2B.png","datePublished":"2022-04-14T11:49:20+00:00","dateModified":"2023-06-14T09:16:03+00:00","description":"C++ is one the most popular languages in the programming world. In this article we will be looking towards 10 simple programs for beginners.","breadcrumb":{"@id":"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#primaryimage","url":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1648682853565-B_297-10-c%2B%2B.png","contentUrl":"https:\/\/prepbytes-misc-images.s3.ap-south-1.amazonaws.com\/assets\/1648682853565-B_297-10-c%2B%2B.png"},{"@type":"BreadcrumbList","@id":"https:\/\/prepbytes.com\/blog\/10-simple-c-programs-for-beginners\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/43.205.93.38\/"},{"@type":"ListItem","position":2,"name":"C Programming","item":"https:\/\/prepbytes.com\/blog\/category\/c-programming\/"},{"@type":"ListItem","position":3,"name":"10 Simple C++ Programs for Beginners"}]},{"@type":"WebSite","@id":"http:\/\/43.205.93.38\/#website","url":"http:\/\/43.205.93.38\/","name":"PrepBytes Blog","description":"ONE-STOP RESOURCE FOR EVERYTHING RELATED TO CODING","publisher":{"@id":"http:\/\/43.205.93.38\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/43.205.93.38\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/43.205.93.38\/#organization","name":"Prepbytes","url":"http:\/\/43.205.93.38\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/","url":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","contentUrl":"https:\/\/blog.prepbytes.com\/wp-content\/uploads\/2025\/07\/uzxxllgloialmn9mhwfe.webp","width":160,"height":160,"caption":"Prepbytes"},"image":{"@id":"http:\/\/43.205.93.38\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/prepbytes0211\/","https:\/\/www.instagram.com\/prepbytes\/","https:\/\/www.linkedin.com\/company\/prepbytes\/","https:\/\/www.youtube.com\/channel\/UC0xGnHDrjUM1pDEK2Ka5imA"]},{"@type":"Person","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/3f7dc4ae851791d5947a7f99df363d5e","name":"Prepbytes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/43.205.93.38\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/232042cd1a1ea0e982c96d2a2ec93fb70a8e864e00784491231e7bfe5a9e06b5?s=96&d=mm&r=g","caption":"Prepbytes"},"url":"https:\/\/prepbytes.com\/blog\/author\/gourav-jaincollegedekho-com\/"}]}},"_links":{"self":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/8403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/comments?post=8403"}],"version-history":[{"count":8,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/8403\/revisions"}],"predecessor-version":[{"id":16794,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/posts\/8403\/revisions\/16794"}],"wp:attachment":[{"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/media?parent=8403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/categories?post=8403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prepbytes.com\/blog\/wp-json\/wp\/v2\/tags?post=8403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}