gdata.io.handleScriptLoaded({"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$georss":"http://www.georss.org/georss","xmlns$thr":"http://purl.org/syndication/thread/1.0","xmlns$blogger":"http://schemas.google.com/blogger/2008","id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268"},"updated":{"$t":"2023-07-30T02:11:08.392-07:00"},"category":[{"term":"C Programs"},{"term":"Pointers"},{"term":"string"},{"term":"Array"},{"term":"Learn C"},{"term":"Fundamental"},{"term":"Pattern"},{"term":"control sturctures"},{"term":"searching and sorting"},{"term":"recursion"},{"term":"List of C Programs"},{"term":"Structures"},{"term":"C Turbo Compiler"},{"term":"File Handling"},{"term":"Contents"},{"term":"Common Programming Error"},{"term":"functions"},{"term":"Dynamic memory allcation"}],"title":{"type":"text","$t":"C Programming Tutorial"},"subtitle":{"type":"html","$t":"It is a blog about c programming. Here we provide c programs and tutorials to enhance your skills."},"link":[{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/-/Fundamental?alt\u003djson-in-script\u0026max-results\u003d50"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/-/Fundamental?alt\u003djson-in-script\u0026max-results\u003d50"},{"rel":"alternate","type":"text/html","href":"http://www.comp-psyche.com/search/label/Fundamental"},{"rel":"hub","href":"http://pubsubhubbub.appspot.com/"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"generator":{"version":"7.00","uri":"https://www.blogger.com","$t":"Blogger"},"openSearch$totalResults":{"$t":"6"},"openSearch$startIndex":{"$t":"1"},"openSearch$itemsPerPage":{"$t":"50"},"entry":[{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-132005681766684109"},"published":{"$t":"2014-01-29T02:05:00.000-08:00"},"updated":{"$t":"2014-04-16T01:08:17.405-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Fundamental"},{"scheme":"http://www.blogger.com/atom/ns#","term":"C Programs"}],"title":{"type":"text","$t":" C PROGRAMS : FUNDAMENTALS"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eC PROGRAMS : FUNDAMENTALS\u003c/title\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals2.html#p11\" name\u003d\"p11\"\u003e11. Program to input a number and find whether it is even or odd\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\nint main()\n{\n // Declaring variale \"n\" to store input number\n int n,r;\n \n // Inputting number\n printf(\"Enter a number : \");\n scanf(\"%d\", \u0026amp;n);\n \n // Checking if input number is ever or odd\n if(n%2\u003d\u003d0)\n printf(\"Entered number is even\");\n else\n printf(\"Entered number is odd\");\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals2.html#p12\" name\u003d\"p12\"\u003e12. Program to find biggest of four no by using ternary numbers\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\nint main()\n{\n // Declaring variable a, b, c, d to store 4 numbers input by user\n int a,b,c,d;\n \n // Declaring variable big to store the biggest value\n int big;\n\n // Inputting number\n printf(\"Enter first number : \");\n scanf(\"%d\",\u0026amp;a);\n printf(\"Enter second number : \");\n scanf(\"%d\",\u0026amp;b);\n printf(\"Enter thirda number : \");\n scanf(\"%d\",\u0026amp;c);\n printf(\"Enter fourth number : \");\n scanf(\"%d\",\u0026amp;d);\n \n // Determining biggest number\n big\u003d(a\u0026gt;b)?(a\u0026gt;c)?(a\u0026gt;d)?a:d:(c\u0026gt;d)?c:d:(b\u0026gt;c)?(b\u0026gt;d)?b:d:(c\u0026gt;d)?c:d;\n\n \n // Printing smallest number\n printf(\"Biggest of four number \u003d %d\",big);\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals2.html#p13\" name\u003d\"p13\"\u003e13. Program to print smallest of four no by using ternary operators\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\n\u003c/span\u003e\u003cspan 0\u003d\"\" a:d:\u003d\"\" a\u003d\"\" b:d:\u003d\"\" b\u003d\"\" c:d:\u003d\"\" c:d\u003d\"\" c\u003d\"\" d\u003d\"\" four\u003d\"\" getch\u003d\"\" mallest\u003d\"\" number\u003d\"%d\" of\u003d\"\" pre\u003d\"\" printf\u003d\"\" printing\u003d\"\" return\u003d\"\" small\u003d\"\" smallest\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003eint main()\n{\n // Declaring variable a, b, c, d to store 4 numbers input by user\n int a,b,c,d;\n \n // Declaring variable small to store the smallest value\n int small;\n\n // Inputting number\n printf(\"Enter first number : \");\n scanf(\"%d\",\u0026amp;a);\n printf(\"Enter second number : \");\n scanf(\"%d\",\u0026amp;b);\n printf(\"Enter thirda number : \");\n scanf(\"%d\",\u0026amp;c);\n printf(\"Enter fourth number : \");\n scanf(\"%d\",\u0026amp;d);\n \n // Determining smallest number\n small\u003d(a\u0026lt;b)?(a\u0026lt;c)?(a\u0026lt;d)?a:d:(c\u0026lt;d)?c:d:(b\u0026lt;c)?(b\u0026lt;d)?b:d:(c\u0026lt;d)?c:d;\n \n // Printing smallest number\n printf(\"Smallest of four number \u003d %d\",small);\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003cb\u003e\n\u003c/b\u003e\u003c/span\u003e\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals2.html#p14\" name\u003d\"p14\"\u003e14. Program to accept a year and check the given year is leap or not by using ternary \u003c/a\u003e \u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\nint main()\n{\n // Declaring variable \"y\" to input year and \"leap\" to determine leap year\n int y,leap;\n \n // Inputting year\n printf(\"Enter any year : \");\n scanf(\"%d\",\u0026amp;y);\n \n // Checking if leaf year or not\n leap\u003d(y%400\u003d\u003d0)?:(y%100!\u003d0)?(y%4\u003d\u003d0)?1:0:0;\n\n if(leap\u003d\u003d1)\n printf(\"The given year is leap year\");\n else\n printf(\"The given year is not leap year\");\n\n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals2.html#p15\" name\u003d\"p15\"\u003e15. Program to find area of a triangle when there sides are given\u003c/a\u003e \u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cstdio .h\u003d\"\"\u003e\u003cconio .h\u003d\"\"\u003e\u003cc 0\u003d\"\" a\u003d\"\" area\u003d\"\" b\u003d\"\" c\u003d\"\" calculating\u003d\"\" else\u003d\"\" getch\u003d\"\" inding\u003d\"\" is\u003d\"\" not\u003d\"\" possible\u003d\"\" pre\u003d\"\" printf\u003d\"\" printing\u003d\"\" rea\u003d\"%.2f\" return\u003d\"\" s\u003d\"(a+b+c)/2;\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e# include \u0026lt;stdio.h\u0026gt;\n# include \u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\nint main( )\n {\n // Declaring variable a, b, c \u003d to store three sides of triangle\n int a,b,c;\n \n // Declaring variable s \u003d mid value\n float s, area;\n\n // Inputing sides of triangle\n printf(\"Enter there sides of the triangle : \");\n scanf(\"%d%d%d\",\u0026amp;a,\u0026amp;b,\u0026amp;c);\n \n // Checking if finding area is possible or not\n if((a+b)\u0026lt;c||(b+c)\u0026lt;a||(a+c)\u0026lt;b)\n printf(\"Finding area is not possible\");\n \n // Calculating area\n else\n {\n s\u003d(a+b+c)/2;\n area\u003dsqrt(s*(s-a)*(s-b)*(s-c));\n }\n \n // Printing area\n printf(\"Area\u003d%.2f\",area);\n \n getch( ); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/c\u003e\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/132005681766684109/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-fundamentals2.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/132005681766684109"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/132005681766684109"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-fundamentals2.html","title":" C PROGRAMS : FUNDAMENTALS"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-792147153293143781"},"published":{"$t":"2014-01-29T01:28:00.000-08:00"},"updated":{"$t":"2014-04-16T01:08:21.293-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Fundamental"},{"scheme":"http://www.blogger.com/atom/ns#","term":"C Programs"}],"title":{"type":"text","$t":"C PROGRAMS : FUNDAMENTALS"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eC PROGRAMS : FUNDAMENTALS\u003c/title\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals1.html#p6\" name\u003d\"p6\"\u003e6. Program to find the average of three numbers with input values as integer and output value (avg) as float\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n    int a, b, c;\n    float avg;\n    \n    printf(\"Enter any three numbers \");\n    scanf(\"%d %d %d\", \u0026amp;a, \u0026amp;b, \u0026amp;c);\n    avg \u003d ( (float)a + (float)b + (float)c ) / 3; \n    /* we have type casted integer to float as a, b, c, 3 all are integer type and\u003c/span\u003e\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003cpre\u003e\u003cstdio .h\u003d\"\"\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\u0026nbsp;    \u003c/span\u003e\u003c/conio\u003e\u003c/stdio\u003e\u003cspan style\u003d\"color: blue;\"\u003einteger / integer gives the result integer. */\u003c/span\u003e\u003c/pre\u003e\u003cpre\u003e\u003cstdio .h\u003d\"\"\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e    printf(\"Average\u003d%f\", avg);\n    getch();\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n    return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals1.html#p7\" name\u003d\"p7\"\u003e7. Program to find the area of a right angled triangle based on base and height values\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n    float h, b, area;\n    \n    printf(\"Enter base \");\n    scanf(\"%f\",\u0026amp;b);\n    printf(\"Enter height \");\n    scanf(\"%f\", \u0026amp;h);\n    area\u003d(0.5)*b*h;\n    printf(\"Area of right angled triangle\u003d %f\", area);\n    getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n    return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals1.html#p8\" name\u003d\"p8\"\u003e8. Program to find or obtain the sum of square of two floating point numbers\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n    float a, b, sum;\n    \n    printf(\"Enter first number \");\n    scanf(\"%f\", \u0026amp;a);\n    printf(\"Enter second number \");\n    scanf(\"%f\", \u0026amp;b);\n    printf(\"Square of first number \u003d %f\", a*a);\n    printf(\"\\n Square of second number \u003d %f\", b*b);\n    sum \u003d (a*a + b*b); \n    printf(\"\\n Sum of square \u003d %f\", sum);\n    getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n    return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals1.html#p9\" name\u003d\"p9\"\u003e9. Program to find the simple interest and total amount based on interest\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n /* Variables for principal amount, rate of interest, time duration,\n  simple interest and total amount */\n int pa, ri, t, si,ta;\n \n // Inputting values\n printf(\"Enter principal amount:\");\n scanf(\"%d\", \u0026amp;pa);\n printf(\"Enter rate of interest:\");\n scanf(\"%d\", \u0026amp;ri);\n printf(\"Enter time duration:\");\n scanf(\"%d\", \u0026amp;t);\n \n // calculating simple interest and total amount\n si \u003d (pa*ri*t)/100;\n ta \u003d si + pa;\n \n // displaying simple interest and total amount\n printf(\"Simple interest: %d and total amount: %d\", si,ta);\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003cpre\u003e\u003cstdio .h\u003d\"\"\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals1.html#p10\" name\u003d\"p10\"\u003e 10. Program to enter 10 digit number and displaying it in the given format where first 3 digit refer to area code, next three digit to exchange code and remaining to number.Program to enter 10 digit number and displaying it in the given format where first 3 digit refer to area code, next three digit to exchange code and remaining to number.\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e/*\u003c/span\u003e\u003c/pre\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003eInput/output:\nEnter 10 digit number: 9876543210\nYou entered: 9876543210\nArea code: 987\nExchange code: 654\nNumber: 3210\nThe complete telephone number: (987)654-3210\n\n*/\u003c/span\u003e\n\u003c/pre\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n int a,b,c;\n \n // Inputting Telephone number\n printf(\"Enter ten digit telephone no.\");\n scanf(\"%3d %3d %4d\",\u0026amp;a,\u0026amp;b,\u0026amp;c);\n \n // Displaying telephone number in given format\n printf(\"You entered:%d%d%d\\n\",a,b,c);\n printf(\"Area code:%d\\n\",a);\n printf(\"Exchange code:%d\\n\",b);\n printf(\"Number:%d\\n\",c);\n printf(\"The complete telephone number:(%d)%d-%d\",a,b,c);\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/792147153293143781/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-fundamentals1.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/792147153293143781"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/792147153293143781"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-fundamentals1.html","title":"C PROGRAMS : FUNDAMENTALS"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-2154845741511983930"},"published":{"$t":"2014-01-28T06:25:00.000-08:00"},"updated":{"$t":"2014-04-16T01:09:09.696-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Fundamental"},{"scheme":"http://www.blogger.com/atom/ns#","term":"C Programs"}],"title":{"type":"text","$t":"C PROGRAMS : FUNDAMENTALS"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eC PROGRAMS : FUNDAMENTALS\u003c/title\u003e\u003cbr /\u003e\n\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals.html#p1\" name\u003d\"p1\"\u003e1. A simple program for printing a line of text\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; // Linux user - Remove this\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n printf(\"Hello this is my first C program\");\n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals.html#p2\" name\u003d\"p2\"\u003e2. Program to input integer number and display it\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n    // variable to take input\n    int n;\n    \n    printf(\"Enter any number \");\n    scanf(\"%d\",\u0026amp;n);\n    printf(\"Input number\u003d%d\",n);\u003c/span\u003e\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003cpre\u003e\u003cstdio .h\u003d\"\"\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e   \u0026nbsp;\u003c/span\u003e\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003cpre\u003e\u003cstdio .h\u003d\"\"\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e    // holds the output screen defined in header file conio.h\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e    getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n    return 0;\n    \n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals.html#p3\" name\u003d\"p3\"\u003e3. Program to add, subtract, multiply and divide two numbers\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n    int a, b;\n    \n    printf(\"Enter any two number \");\n    scanf(\"%d\",\u0026amp;a);\n    scanf(\"%d\",\u0026amp;b);\n    printf(\"Sum\u003d%d\",a+b);\n    printf(\"\\nSubtracted value\u003d%d\",a-b);\n    printf(\"\\nMultiplied value\u003d%d\",a*b);\n    printf(\"\\n Division value\u003d%d\",a/b);\n    getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n    return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals.html#p4\" name\u003d\"p4\"\u003e4. Program to subtract two numbers without using arithmetic operators ( - )\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n    int a, b, r;\n    \n    printf(\"Enter any two number \");\n    scanf(\"%d\",\u0026amp;a);\n    scanf(\"%d\",\u0026amp;b);\n    r\u003da+(~b)+1;\n    printf(\"Subtracted value\u003d%d\", r);\n    getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e    return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-fundamentals.html#p5\" name\u003d\"p5\"\u003e5. Program to find the greatest between 3 integers( numbers ) using ternary or conditional operator\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n // Variable for 3 integers and for storing greatest integer\n int a, b, c, g;\n \n // Inputting integers\n printf(\"Enter three integers:\");\n scanf(\"%d %d %d\",\u0026amp;a,\u0026amp;b,\u0026amp;c);\n \n // Determining the greatest integer using ternary or conditional operator\n g\u003d(a\u0026gt;b \u0026amp;\u0026amp; b\u0026gt;c) ? a : (b\u0026gt;c \u0026amp;\u0026amp; b\u0026gt;a) ? b : (c\u0026gt;a \u0026amp;\u0026amp; c\u0026gt;b) ? c : 0;\n \n // displaying greatest value\n if(g!\u003d0)\n printf(\"Greagest integer: %d\",g);\n else\n printf(\"None is greatest: Two integers have same value\" );\n \n getch();\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/2154845741511983930/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-fundamentals.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/2154845741511983930"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/2154845741511983930"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-fundamentals.html","title":"C PROGRAMS : FUNDAMENTALS"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-439574701836045459"},"published":{"$t":"2013-11-18T06:20:00.000-08:00"},"updated":{"$t":"2016-05-17T09:55:03.513-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Fundamental"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"BASIC COMPONENT OF A C PROGRAM"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003cdiv style\u003d\"text-align: left;\"\u003e\nNow lets begin exploring the C programming language. Before we start executing programs in C Turbo C/C++ Compiler we must know some basic component of a C program.\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n#include - The #include is known as a preprocessor directive and is used to tell the C preprocessor to find the stdio file with extension .h. \u0026lt;stdio.h\u0026gt; stand for standard input output stream header file and contains information for printf, scanf etc.\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cb\u003emain()\u003c/b\u003e - Exectuion of a a program starts from a main() function. It defines the point from where the execution of the program starts. Anything written between opening curly brace and ending curly brace of main is executed.\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cb\u003eprintf()\u003c/b\u003e - This is the standard way of producing output. The functionality of printf() is referenced in stdio.h by the C compiler, thus it always work in the same way.\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cb\u003escanf()\u003c/b\u003e - This is the standard way of taking input from user. The functionality of scanf() is also referenced in stdio.h by the C compiler.\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cb\u003ecomments:\u003c/b\u003e Comments are information given by the program to make a\u0026nbsp;program readable and easy to understand. It reduces the complexity of a program. Anything written as comments is ignored by the compiler.\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nThere are two ways of writing comments:\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n1. Single line comment\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nSyntax:\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n//Your comments here\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nexample:\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u0026nbsp;// Hello this is my first C program\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n2. Multiline comment \u0026nbsp;\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nSyntax:\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n/* Your comment\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nYour comment*/\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nexample:\u0026nbsp;\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n/* This is my first C program\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nand i am very excited about it */\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cspan style\u003d\"color: yellow;\"\u003eSYNTAX:\u003c/span\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\n\u003cspan style\u003d\"color: lime;\"\u003eNote : It should be noted that some compiler does not include header file \"conio.h\". It is also not included in compiler of Linux or any other Unix based operating system. So in case using it displays an error remove this and the function associated with it i.e getch().\u003c/span\u003e\u003cbr /\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n#include\u0026lt;stdio.h\u0026gt; //This tells the compiler about the input/output functions such as printf(), scanf()\u0026nbsp;\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n#include\u0026lt;conio.h\u0026gt; //It is used for getch() function\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nint \u0026nbsp;main() // It is the entry point of a program\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n{ // Progam begins with this curly braces\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nprintf(\"Congratulation you successfully run your \u0026nbsp;first program\"); // to print in the output screen\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cdiv style\u003d\"-webkit-text-stroke-width: 0px; color: black; font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;\"\u003e\n\u003cdiv style\u003d\"margin: 0px;\"\u003e\ngetch(); // to hold the output screen\u003cbr /\u003e\nreturn 0; // tell the OS that the program exited without error\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003c/div\u003e\n} // Program end with this curly braces\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cspan style\u003d\"color: yellow;\"\u003eOUTPUT:\u003c/span\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nCongratulation you successfully run your \u0026nbsp;first program\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cspan style\u003d\"color: yellow;\"\u003eEXPLANATION:\u003c/span\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nWhen we execute this program (press Ctrl+F9 to execute in Turbo C or F9 in Dev C++).\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nNOTE: If you want to execute this program in Dev C++ then there is a minor change. Replace \u003ci\u003evoid main() \u003c/i\u003ewith \u003ci\u003eint main()\u003c/i\u003e as Dev C++ compiler does not support void as return type for main(). Also replace \u003ci\u003egetch() \u003c/i\u003ewith\u003ci\u003e return 0.\u003c/i\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003ci\u003ereturn 0\u003c/i\u003e means that the program is terminated successfully and the compiler is returning back the control to the computer\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nNow on execution the program will display \"Congratulation you successfully run your \u0026nbsp;first program\" (without double quotes) as output on monitor. Any string you pass within double quotes through \u003ci\u003eprintf\u003c/i\u003e is sent to console output (monitor) i.e it is displayed as it is on the monitor.\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cspan style\u003d\"color: yellow;\"\u003ePROGRAM EXAMPLE:\u003c/span\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cb\u003e\u003cbr /\u003e\n\u003c/b\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cb\u003e#\u003c/b\u003einclude\u0026lt;stdio.h\u0026gt;\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nint main()\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n{\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nprintf(\"%d\", 5+6); // %d is conversion character for integer\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nreturn 0;\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n}\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cspan style\u003d\"color: yellow;\"\u003eOUTPUT:\u003c/span\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n11\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cspan style\u003d\"color: yellow;\"\u003eEXPLANATION:\u003c/span\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cb\u003e\u003cbr /\u003e\n\u003c/b\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nThe above program contains only one statement to be executed within main() function. As this statement contains 5+6 without quotes, it will add these two numbers and pass the result in integer ( as indicated by conversion character %d ) to console window i.e 11 is sent to the monitor. So in this case the output is 11.\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\nSo whenever we use double quotes, compiler just prints the message ignoring what has been include there but when no quotes are used, actual values are processed according to instructions and executed accordingly.\u003c/div\u003e\n\u003c/div\u003e\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/439574701836045459/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2013/06/component-of-c-program.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/439574701836045459"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/439574701836045459"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2013/06/component-of-c-program.html","title":"BASIC COMPONENT OF A C PROGRAM"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-2444674469709113451"},"published":{"$t":"2013-11-18T00:41:00.000-08:00"},"updated":{"$t":"2014-04-16T01:21:09.484-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Fundamental"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"LOGIC BOOSTER AND BRAINSTORMING QUESTION"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eLOGIC BOOSTER AND BRAINSTORMING QUESTION\u003c/title\u003e\u003cbr /\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\u003cspan style\u003d\"color: yellow; font-size: large; font-weight: normal;\"\u003eLOGIC BOOSTER\u003c/span\u003e\u003c/h2\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003col\u003e\u003cli\u003eWhen an operation is to be performed on two values ( may be of different types ), the type of smaller value will automatically be converted into larger one and the result will be in large one's type.\u003c/li\u003e\n\u003cli\u003echar or short values will get converted into integer ( int ) type if involved in calculation part.\u003c/li\u003e\n\u003cli\u003efloat value is converted into double value:\u003c/li\u003e\n\u003c/ol\u003e\u003cul\u003e\u003cli\u003eIf either operand is double, the other is converted to double and the result is double.\u003c/li\u003e\n\u003cli\u003eOtherwise, if either operand is long, the other is converted to long, and the result is long.\u003c/li\u003e\n\u003cli\u003eOtherwise, if either operand is unsigned, the other is converted to unsigned, and the result is unsigned.\u003c/li\u003e\n\u003cli\u003eOtherwise, the operand must be int.\u003c/li\u003e\n\u003c/ul\u003e\u003cdiv\u003e\u003cb\u003eFor example:\u003c/b\u003e Suppose\u003c/div\u003e\u003cdiv\u003ec: char\u003c/div\u003e\u003cdiv\u003ed: double\u003c/div\u003e\u003cdiv\u003ei: int\u003c/div\u003e\u003cdiv\u003eu: unsigned\u003c/div\u003e\u003cdiv\u003es: short int\u003c/div\u003e\u003cdiv\u003el: long\u003c/div\u003e\u003cdiv\u003ef: float\u003c/div\u003e\u003cdiv\u003e\u003cbr /\u003e\n\u003c/div\u003e\u003cdiv\u003e\u003ctable border\u003d\"1\"\u003e\u003ctbody\u003e\n\u003ctr\u003e\u003ctd\u003e\u003cb\u003e\u0026nbsp;Expressions\u0026nbsp;\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u0026nbsp; Final data type \u0026nbsp; \u0026nbsp;\u0026nbsp;\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; Explanation\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;i\u0026nbsp;+ d\u003c/td\u003e\u003ctd\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;double\u003c/div\u003e\u003c/td\u003e\u003ctd\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u0026nbsp;One value is of type \u003ci\u003eint \u003c/i\u003eand second is of type \u003ci\u003edouble, \u003c/i\u003eso smaller one \u0026nbsp;\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u0026nbsp;(int) will be converted into \u003ci\u003edouble\u003c/i\u003e first ( without loss of information )\u0026nbsp;\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u0026nbsp;and then the result type of addition of two double is double.\u003c/div\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u0026nbsp; \u0026nbsp;20 * s\u0026nbsp;+3\u0026nbsp;\u003c/td\u003e\u003ctd\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; int\u003c/td\u003e\u003ctd\u003e\u0026nbsp;First \u003ci\u003eshort\u003c/i\u003e will be converted into \u003ci\u003eint\u003c/i\u003e. All values are of type \u003ci\u003eint\u003c/i\u003e, so\u003cbr /\u003e\n\u0026nbsp;result is of type \u003ci\u003eint\u003c/i\u003e.\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u0026nbsp; \u0026nbsp; 12.0 + c\u003c/td\u003e\u003ctd\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;double\u003c/td\u003e\u003ctd\u003e\u0026nbsp;First \"c\" is converted into \u003ci\u003eint\u003c/i\u003e\u0026nbsp;then to \u003ci\u003edouble\u003c/i\u003e. Result will be of\u003cbr /\u003e\n\u0026nbsp;type\u0026nbsp;\u003ci\u003edouble\u003c/i\u003e. \u0026nbsp; \u0026nbsp;\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u0026nbsp; \u0026nbsp; 3 * i / 4\u003c/td\u003e\u003ctd\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; int\u003c/td\u003e\u003ctd\u003e\u0026nbsp;As 3 and \"i\" are of typ\u0026nbsp;\u003ci\u003eint\u003c/i\u003e, so result of 3*i is of type \u003ci\u003eint\u003c/i\u003e, then \u003ci\u003eint\u003c/i\u003e\u003cbr /\u003e\n\u0026nbsp;divided\u0026nbsp;\u003cspan style\u003d\"text-align: justify;\"\u003eby int is again int.\u003c/span\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\u0026nbsp; \u0026nbsp; 3 * i / 4.0\u003c/td\u003e\u003ctd\u003e\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;double\u003c/td\u003e\u003ctd\u003e\u0026nbsp;The result of 3 * i is of type \u003ci\u003eint\u003c/i\u003e, then \u003ci\u003eint \u003c/i\u003edivided by \u003ci\u003edouble\u003c/i\u003e is\u003cbr /\u003e\n\u003ci\u003e\u0026nbsp;double.\u003c/i\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\u003c/table\u003e\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cul\u003e\u003cli\u003eYou must use \"\u0026amp;\" ( ampersand ) with \u003ci\u003escanf\u003c/i\u003e to enter integer or character value ( while using format specifier \"%d\" or \"%c\" or \"%f\" ). Omitting it will make the program not work correctly.\u003c/li\u003e\n\u003cli\u003eYou must not use \"\u0026amp;\" with \u003ci\u003eprintf\u003c/i\u003e while printing the values of any variable.\u003c/li\u003e\n\u003cli\u003eIf you use comma between format specifiers in \u003ci\u003escanf\u003c/i\u003e, user must have to provide comma between two values to differentiate them.\u003c/li\u003e\n\u003cli\u003eAll statements must be terminated with semicolon.\u003c/li\u003e\n\u003cli\u003eC is case sensitive - all keywords and standard library functions are in lowercase.\u003c/li\u003e\n\u003c/ul\u003e\u003cbr /\u003e\n\u003cbr /\u003e\n\u003ch2\u003e\u003cspan style\u003d\"color: yellow; font-size: large; font-weight: normal;\"\u003eBRAINSTORMING QUESTIONS\u003c/span\u003e\u003c/h2\u003e\u003c/div\u003e\u003cdiv\u003e1. How can we display the \u003ci\u003efloat \u003c/i\u003enumber in exponential notation.\u003c/div\u003e\u003cdiv\u003e\u003cul\u003e\u003cli\u003eWe can use the format specifier %e to print \u003ci\u003efloat\u003c/i\u003e value in exponential notation.\u003c/li\u003e\n\u003c/ul\u003e\u003cdiv\u003e2. Is \u003ci\u003eint a; \u003c/i\u003ea declaration or definition.\u003c/div\u003e\u003cdiv\u003e\u003cul\u003e\u003cli\u003eThe declaration of a variable means how it works but it does not allocate memory to an identifier. Since \u003ci\u003eint a; \u003c/i\u003estatement introduces type of \"a\" and also allocates memory, it becomes definition of variable \"a\".\u003c/li\u003e\n\u003c/ul\u003e\u003cdiv\u003e3. The following code finds the average of three numbers:\u003cbr /\u003e\n\u003cbr /\u003e\n\u003c/div\u003e\u003c/div\u003e\u003cdiv\u003e\u003cdiv class\u003d\"mokcode\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;conio.h\u0026gt; // Linux user - Remove this\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003eint main()\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003e{\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003eint a\u003d10, b\u003d20, c\u003d30, avg;\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003eavg\u003d a+b+c/3;\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003eprintf(\"Average is: %d\", avg);\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003egetch();\u0026nbsp;\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cbr /\u003e\n\u003cdiv\u003e\u003cspan style\u003d\"color: blue;\"\u003ereturn 0;\u003c/span\u003e\u003c/div\u003e\u003cspan style\u003d\"color: blue;\"\u003e}\u003c/span\u003e\u003c/div\u003e\u003c/div\u003eDoes the user get the correct answer?\u003cbr /\u003e\n\u003cdiv\u003e\u003cbr /\u003e\n\u003cul\u003e\u003cli\u003eNo, because of following reasons:\u003c/li\u003e\n\u003cli\u003ethe division operator have higher precedence than the addition operator. Hence expression is evaluated as \"avg \u003d a+b+(c/3);\"\u003c/li\u003e\n\u003cli\u003eThe division operator operates on integer operand. So the result will be in integer. When \"c\" is divided by 3, only integer part is returned and fraction part is removed.\u003c/li\u003e\n\u003c/ul\u003e\u003cdiv\u003e4. Every statement in C is terminated by a semicolon. Can we write the following codes which the first statement inside main is terminated by comma instead of a semicolon. Will it work?\u003cbr /\u003e\n\u003cbr /\u003e\n\u003c/div\u003e\u003cdiv\u003e\u003cdiv class\u003d\"mokcode\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;conio.h\u0026gt;\u0026nbsp;\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003eint main()\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003e{\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003eprintf(\"This is C \"),\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003eprintf(\"Programming.\");\u0026nbsp;\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003egetch();\u0026nbsp;\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cbr /\u003e\n\u003cdiv\u003e\u003cspan style\u003d\"color: blue;\"\u003ereturn 0;\u003c/span\u003e\u003c/div\u003e\u003cspan style\u003d\"color: blue;\"\u003e}\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003cul\u003e\u003cli\u003eYes, the code will work. The code has only one statement containing two expression separated by comma, i.e \u003ci\u003eprintf (\"This is C \") and printf (\"Programming.\"); \u003c/i\u003eAs the expression separated by comma are evaluated in left to right order, \u003ci\u003eprintf(\"This is C \")\u003c/i\u003e is evaluated followed by \u003ci\u003eprintf(\"Programming.\"). \u003c/i\u003eTherefore, the output is: \u003cb\u003eThis is C Programming.\u003c/b\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003cdiv\u003e\u003cb\u003e5. \u003c/b\u003eWill the following code work. The two expressions are separated by two commas.\u003cbr /\u003e\n\u003cbr /\u003e\n\u003c/div\u003e\u003cdiv\u003e\u003cdiv class\u003d\"mokcode\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003cbr /\u003e\n#include\u0026lt;conio.h\u0026gt;\u0026nbsp;\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cbr /\u003e\n\u003cdiv\u003e\u003cspan style\u003d\"color: blue;\"\u003eint main()\u003c/span\u003e\u003c/div\u003e\u003cspan style\u003d\"color: blue;\"\u003e{\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003eint x\u003d10, , y\u003d32;\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003eprintf(\"%d %d\"), x, y);\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003egetch();\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cbr /\u003e\n\u003cdiv\u003e\u003cspan style\u003d\"color: blue;\"\u003ereturn 0;\u003c/span\u003e\u003c/div\u003e\u003cspan style\u003d\"color: blue;\"\u003e}\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003cul\u003e\u003cli\u003eNo. The compiler gives compile time error. This is because two comma operators cannot appear consecutively.\u003c/li\u003e\n\u003c/ul\u003e\u003cdiv\u003e\u003cdiv\u003e\u003cspan style\u003d\"color: yellow;\"\u003eMore Informative Posts:\u003c/span\u003e\u003c/div\u003e\u003cdiv\u003e\u003cul\u003e\u003cli\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/learn-C.html\"\u003eComplete List Of Learn C\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-errors.html\"\u003eCommon Programming Errors\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/06/control-statements.html\"\u003eControl Statements\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/nested-if-else.html\"\u003eNested If-else Statement\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/2444674469709113451/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2013/11/logic-booster-brainstorming-questions.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/2444674469709113451"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/2444674469709113451"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2013/11/logic-booster-brainstorming-questions.html","title":"LOGIC BOOSTER AND BRAINSTORMING QUESTION"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-473472171935997281"},"published":{"$t":"2013-11-18T00:40:00.000-08:00"},"updated":{"$t":"2014-04-16T01:12:46.729-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Fundamental"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS - FUNDAMENTALS"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eCOMMON PROGRAMMING ERRORS - FUNDAMENTALS\u003c/title\u003e\u003cbr /\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003c/div\u003e\u003col\u003e\u003cli\u003eNot putting semicolon after C statements like \u003ci\u003e\u003cspan style\u003d\"color: lime;\"\u003eprintf() \u003c/span\u003e\u003c/i\u003eor\u003ci\u003e \u003cspan style\u003d\"color: lime;\"\u003escanf()\u003c/span\u003e\u003c/i\u003e\u003cspan style\u003d\"color: lime;\"\u003e.\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003eNot including required header files.\u003c/li\u003e\n\u003cli\u003e\u003cspan style\u003d\"color: lime;\"\u003eParenthesis\u003c/span\u003e not matching in \u003ci\u003e\u003cspan style\u003d\"color: lime;\"\u003eprintf()\u003c/span\u003e or \u003cspan style\u003d\"color: lime;\"\u003escanf().\u003c/span\u003e\u003c/i\u003e\u003c/li\u003e\n\u003cli\u003eNot including \u003cspan style\u003d\"color: lime;\"\u003edouble quotes\u003c/span\u003e in \u003cspan style\u003d\"color: lime;\"\u003e\u003ci\u003eprintf()\u003c/i\u003e.\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003eNot putting comma between identifiers.\u003c/li\u003e\n\u003cli\u003eIncluding space in identifiers.\u003c/li\u003e\n\u003cli\u003eusing \u003cspan style\u003d\"color: lime;\"\u003ewrong conversion character\u003c/span\u003e in \u003ci\u003escanf() \u003c/i\u003eor \u003ci\u003eprintf()\u003c/i\u003e.\u003c/li\u003e\n\u003cli\u003eNot including\u003cspan style\u003d\"color: lime;\"\u003e address of operator\u003c/span\u003e ( \u0026amp; ) in \u003ci\u003escanf().\u003c/i\u003e\u003c/li\u003e\n\u003cli\u003eUsing \u003cspan style\u003d\"color: lime;\"\u003eaddress of operator\u003c/span\u003e ( \u0026amp; ) in \u003ci\u003eprintf()\u003c/i\u003e.\u003c/li\u003e\n\u003cli\u003eNot giving precedence to expression wherever required like \u003cspan style\u003d\"color: lime;\"\u003ea\u0026nbsp;+ b / 2\u003c/span\u003e is different from\u003cspan style\u003d\"color: lime;\"\u003e ( a\u0026nbsp;+ b ) / 2.\u003c/span\u003e\u003c/li\u003e\n\u003c/ol\u003e\u003cdiv\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cspan style\u003d\"color: yellow;\"\u003eMore Informative Posts:\u003c/span\u003e\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003cul\u003e\u003cli\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/learn-C.html\"\u003eComplete List Of Learn C\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html\"\u003eCommon Programming Error - Complete List\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/06/common-programming-errors_25.html\"\u003eCommon Programming Error - Control Structures\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-function.html\"\u003eCommon Programming Error - Function\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/473472171935997281/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-errors.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/473472171935997281"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/473472171935997281"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2013/11/common-programming-errors.html","title":"COMMON PROGRAMMING ERRORS - FUNDAMENTALS"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}}]}});