{"id":1390,"date":"2020-10-20T16:29:38","date_gmt":"2020-10-20T16:29:38","guid":{"rendered":"http:\/\/themindpalace.in\/?p=1390"},"modified":"2021-08-26T05:31:55","modified_gmt":"2021-08-26T05:31:55","slug":"basic-concepts-of-computer-programming-languages","status":"publish","type":"post","link":"https:\/\/themindpalace.in\/index.php\/2020\/10\/20\/basic-concepts-of-computer-programming-languages\/","title":{"rendered":"Basic concepts of Computer Programming Languages"},"content":{"rendered":"\n<p><a href=\"#summary\">Summary of basic concepts of computer programming languages<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"631\" src=\"http:\/\/themindpalace.in\/wp-content\/uploads\/2020\/10\/programming-languages-1024x631.png\" alt=\"Programming Languages\" class=\"wp-image-1391\" srcset=\"https:\/\/themindpalace.in\/wp-content\/uploads\/2020\/10\/programming-languages-1024x631.png 1024w, https:\/\/themindpalace.in\/wp-content\/uploads\/2020\/10\/programming-languages-300x185.png 300w, https:\/\/themindpalace.in\/wp-content\/uploads\/2020\/10\/programming-languages-768x473.png 768w, https:\/\/themindpalace.in\/wp-content\/uploads\/2020\/10\/programming-languages.png 1280w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Programming Languages<\/figcaption><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"summary\">Summary<\/h1>\n\n\n\n<p>A\u00a0<strong><em>computer program<\/em><\/strong>\u00a0is a set of instructions that can be executed by a\u00a0<strong><em>computer<\/em><\/strong>\u00a0to perform a specific task.\u00a0<\/p>\n\n\n\n<p>We write programs in a language a computer can understand. Usually, those languages are called programming languages.<\/p>\n\n\n\n<p>Programming languages help us to write the code\/program in almost English like language, converts that into a machine level language. Executes them, brings back the result again in a format that we can understand.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Algorithm \/ Flowcharts<\/h2>\n\n\n\n<p>A program always starts with an&nbsp;<strong>algorithm<\/strong>. An algorithm is a procedure or steps we follow to solve a problem, where a problem can be mathematical or logical.<\/p>\n\n\n\n<p>Most of the time, we use&nbsp;<strong>a flowchart<\/strong>&nbsp;to represent an algorithm. A flow chart is a type of diagram that presents the steps to be followed to solve any given problem. It is easy to read and understand.<\/p>\n\n\n\n<p>A flowchart shows the steps to be followed with different kinds of boxes and arrows to indicate the flow of the process.<\/p>\n\n\n\n<p>The most common blocks used in any flow chart are:<\/p>\n\n\n\n<ul><li>Terminal block &#8211; Strat \/ End blocks of the program<\/li><li>Process blocks &#8211; Set of operations<\/li><li>Decision block &#8211; which checks the conditions and decides the further path of the process<\/li><li>Input \/ Output blocks<\/li><\/ul>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<p>Check whether any given number A is positive or negative<\/p>\n\n\n\n<ol><li><code>Start<\/code><\/li><li><code>Input the value for A<\/code><\/li><li><code>If A&gt;=0<\/code><\/li><li><code>If yes, the result is Positive<\/code><\/li><li><code>If not, the result value is Negative<\/code><\/li><li><code>Print the output\/result<\/code><\/li><li><code>End<\/code><\/li><\/ol>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/themindpalace.in\/wp-content\/uploads\/2020\/10\/flow-chart-1024x827.png\" alt=\"Flowchart\" class=\"wp-image-1392\" width=\"551\" height=\"445\" srcset=\"https:\/\/themindpalace.in\/wp-content\/uploads\/2020\/10\/flow-chart-1024x827.png 1024w, https:\/\/themindpalace.in\/wp-content\/uploads\/2020\/10\/flow-chart-300x242.png 300w, https:\/\/themindpalace.in\/wp-content\/uploads\/2020\/10\/flow-chart-768x620.png 768w, https:\/\/themindpalace.in\/wp-content\/uploads\/2020\/10\/flow-chart.png 1090w\" sizes=\"(max-width: 551px) 100vw, 551px\" \/><figcaption>Flowchart<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Syntax of programming languages<\/h2>\n\n\n\n<p>Just like we humans have hundreds of thousands of languages to speak or write, there are thousands of programming languages to interact with a computer.<\/p>\n\n\n\n<p>Syntax in any programming language is the set of rules to be followed to write a program in that language. The syntax is the grammar of programming languages.<\/p>\n\n\n\n<p>To display &#8220;Hello world&#8221; in some of the common programming languages, we use different syntaxes, as shown below:<\/p>\n\n\n\n<p><strong>HTML<\/strong><\/p>\n\n\n\n<p><code>Hello World!<\/code><\/p>\n\n\n\n<p><strong>Basic<\/strong><\/p>\n\n\n\n<p><code>PRINT \"Hello, world!\"\u200b<\/code><\/p>\n\n\n\n<p><strong>C<\/strong><\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<pre class=\"wp-block-code\"><code>#include \n \nint main(void)\n{\n  \tputs(\"Hello, world!\");\n}<\/code><\/pre>\n<\/div><\/div>\n\n\n\n<p><strong>C++<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include \n\nint main()\n{\n  \tstd::cout &lt;&lt; \"Hello, world!\";\n  \treturn 0;\n}<\/code><\/pre>\n\n\n\n<p><strong>C#<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>using System;\nclass Program\n{\n    public static void Main(string&#91;] args)\n    {\n        Console.WriteLine(\"Hello, world!\");\n    }\n}<\/code><\/pre>\n\n\n\n<p><strong>Java<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import javax.swing.JFrame;  \/\/Importing class JFrame\nimport javax.swing.JLabel;  \/\/Importing class JLabel\npublic class HelloWorld {\n    public static void main(String&#91;] args) {\n        JFrame frame = new JFrame();           \/\/Creating frame\n        frame.setTitle(\"Hi!\");                 \/\/Setting title frame\n        frame.add(new JLabel(\"Hello, world!\"));\/\/Adding text to frame\n        frame.pack();                          \/\/Setting size to smallest\n        frame.setLocationRelativeTo(null);     \/\/Centering frame\n        frame.setVisible(true);                \/\/Showing frame\n    }\n}<\/code><\/pre>\n\n\n\n<p><strong>JavaScript<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>document.write('Hello, world!');<\/code><\/pre>\n\n\n\n<p><strong>jQuery<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$(\"body\").append(\"Hello world!\");<\/code><\/pre>\n\n\n\n<p>The syntax may be different in different languages. But the basic flow of logic used to solve any problem are similar. If you know to write programs in any one language, it&#8217;s easy to learn others.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Functions<\/h2>\n\n\n\n<p>We can call a function as a mini-program, a set of instructions meant to do a particular task. Functions are named depending on their job.<\/p>\n\n\n\n<p>Example :<\/p>\n\n\n\n<p><strong>Sum(a,b);<\/strong><\/p>\n\n\n\n<p><strong>Max(a,b,c);<\/strong><\/p>\n\n\n\n<p>Here Sum and Max are the function names.<\/p>\n\n\n\n<p>Sum(a,b) adds a to be and returns the sum of them as a result.<\/p>\n\n\n\n<p>Similarly Max(a,b,c) retuns the maximum number among a,b and c.<\/p>\n\n\n\n<ul><li>Functions reduce the repetition of codes within the program<\/li><li>Increases the readability and understanding of the code<\/li><li>Easy to modify any program<\/li><\/ul>\n\n\n\n<p><strong>There are two main types of functions &#8211;<\/strong><\/p>\n\n\n\n<ul><li><em>Standard library functions<\/em>, in-built in the programming languages<\/li><li><em>User-defined functions<\/em>, users create them if they need to run the same task multiple times.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Debugging<\/h2>\n\n\n\n<p>Debugging is a process of finding and removing any errors in the code, which are causing the program to behave differently than expected.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A computer program is a set of instructions that can be executed by a computer to perform a specific task<\/p>\n","protected":false},"author":2,"featured_media":1391,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[475,2],"tags":[167],"cp_meta_data":{"_edit_lock":["1629955915:2"],"_thumbnail_id":["1391"],"_edit_last":["2"],"_layout":["inherit"],"_heateor_sss_meta":["a:2:{s:7:\"sharing\";i:0;s:16:\"vertical_sharing\";i:0;}"],"_oembed_95287caaddeb112cd4edfcbd8e525566":["<iframe title=\"Introduction of Computers  Part1\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/SzIGR3gp_F4?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_95287caaddeb112cd4edfcbd8e525566":["1603211064"],"_jetpack_related_posts_cache":["a:1:{s:32:\"8f6677c9d6b0f903e98ad32ec61f8deb\";a:2:{s:7:\"expires\";i:1776603485;s:7:\"payload\";a:3:{i:0;a:1:{s:2:\"id\";i:6317;}i:1;a:1:{s:2:\"id\";i:6280;}i:2;a:1:{s:2:\"id\";i:2321;}}}}"],"_last_editor_used_jetpack":["block-editor"]},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/themindpalace.in\/wp-content\/uploads\/2020\/10\/programming-languages.png","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/themindpalace.in\/index.php\/wp-json\/wp\/v2\/posts\/1390"}],"collection":[{"href":"https:\/\/themindpalace.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/themindpalace.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/themindpalace.in\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/themindpalace.in\/index.php\/wp-json\/wp\/v2\/comments?post=1390"}],"version-history":[{"count":6,"href":"https:\/\/themindpalace.in\/index.php\/wp-json\/wp\/v2\/posts\/1390\/revisions"}],"predecessor-version":[{"id":2548,"href":"https:\/\/themindpalace.in\/index.php\/wp-json\/wp\/v2\/posts\/1390\/revisions\/2548"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/themindpalace.in\/index.php\/wp-json\/wp\/v2\/media\/1391"}],"wp:attachment":[{"href":"https:\/\/themindpalace.in\/index.php\/wp-json\/wp\/v2\/media?parent=1390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/themindpalace.in\/index.php\/wp-json\/wp\/v2\/categories?post=1390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/themindpalace.in\/index.php\/wp-json\/wp\/v2\/tags?post=1390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}