// API callback
relpostimgcuplik({"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$blogger":"http://schemas.google.com/blogger/2008","xmlns$georss":"http://www.georss.org/georss","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$thr":"http://purl.org/syndication/thread/1.0","id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268"},"updated":{"$t":"2023-07-30T02:11:08.392-07:00"},"category":[{"term":"C Programs"},{"term":"Learn C"},{"term":"Common Programming Error"},{"term":"searching and sorting"},{"term":"control sturctures"},{"term":"Fundamental"},{"term":"List of C Programs"},{"term":"string"},{"term":"Array"},{"term":"Pattern"},{"term":"Contents"},{"term":"Pointers"},{"term":"functions"},{"term":"Dynamic memory allcation"},{"term":"recursion"},{"term":"C Turbo Compiler"},{"term":"File Handling"},{"term":"Structures"}],"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.comp-psyche.com\/feeds\/posts\/default"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/-\/Learn+C?alt=json-in-script\u0026max-results=50"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/search\/label\/Learn%20C"},{"rel":"hub","href":"http://pubsubhubbub.appspot.com/"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"generator":{"version":"7.00","uri":"http://www.blogger.com","$t":"Blogger"},"openSearch$totalResults":{"$t":"12"},"openSearch$startIndex":{"$t":"1"},"openSearch$itemsPerPage":{"$t":"50"},"entry":[{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-6658161019040712282"},"published":{"$t":"2013-12-03T04:43:00.000-08:00"},"updated":{"$t":"2014-04-16T01:11:11.067-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"File Handling"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERROR - FILE HANDLING"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - FILE HANDLING\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: left;\"\u003E\u003C\/div\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EOpening an existing file for \u003Cspan style=\"color: lime;\"\u003Ewriting ( \"w\") \u003C\/span\u003Ewhen in fact, the user wants to preserve the file, discards the contents of file without warning.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EForgetting to open a file before attempting to \u003Cspan style=\"color: lime;\"\u003Ereference\u003C\/span\u003E it in a program is a \u003Cspan style=\"color: lime;\"\u003Elogic error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003Eopening a \u003Cspan style=\"color: lime;\"\u003Enonexistent file\u003C\/span\u003E for reading is an error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EOpening a file for reading or writing without having been granted the\u003Cspan style=\"color: lime;\"\u003E appropriate access rights\u003C\/span\u003E to the file ( this is \u003Cspan style=\"color: lime;\"\u003Eoperating-system dependent\u003C\/span\u003E) is an error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EOpening a file for writing when \u003Cspan style=\"color: lime;\"\u003Eno space\u003C\/span\u003E is available is a\u003Cspan style=\"color: lime;\"\u003E runtime error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EOpening a file in \u003Cspan style=\"color: lime;\"\u003Ewrite mode (\"w\")\u003C\/span\u003E when it should be opened in update \u003Cspan style=\"color: lime;\"\u003Emode (\"r+\")\u003C\/span\u003E causes the contents of the file to be \u003Cspan style=\"color: lime;\"\u003Ediscarded\u003C\/span\u003E.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts\u003C\/span\u003E\u003C\/div\u003E\u003Cul style=\"text-align: justify;\"\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors.html\"\u003ECommon Programming Error - Fundamentals\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/06\/common-programming-errors_25.html\"\u003ECommon Programming Error - Control Structures\u003C\/a\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003C\/div\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comp-psyche.com\/feeds\/6658161019040712282\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-file-handling.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/6658161019040712282"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/6658161019040712282"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-file-handling.html","title":"COMMON PROGRAMMING ERROR - FILE HANDLING"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-621331994500399760"},"published":{"$t":"2013-12-03T04:42:00.000-08:00"},"updated":{"$t":"2014-04-16T01:11:43.460-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Structures"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS - STRUCTURES"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - STRUCTURES\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: left;\"\u003E\u003C\/div\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EForgetting the \u003Cspan style=\"color: lime;\"\u003Esemicolon\u003C\/span\u003E that terminates a \u003Cspan style=\"color: lime;\"\u003Estructure definition\u003C\/span\u003E is a \u003Cspan style=\"color: lime;\"\u003Esyntax error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EAssigning a structure of one type to a structure of different type is a \u003Cspan style=\"color: lime;\"\u003Ecompilation error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EInserting \u003Cspan style=\"color: lime;\"\u003Espace\u003C\/span\u003E between the \u003Cspan style=\"color: lime;\"\u003E-\u003C\/span\u003E and \u003Cspan style=\"color: lime;\"\u003E\u0026gt;\u003C\/span\u003E components of the \u003Cspan style=\"color: lime;\"\u003Estructure pointer operator\u003C\/span\u003E is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EAttempting to refer to a member of a structure by using only the \u003Cspan style=\"color: lime;\"\u003Emember's name\u003C\/span\u003E is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003ENot using\u003Cspan style=\"color: lime;\"\u003E parentheses\u003C\/span\u003E when referring to a structure member that uses a pointer and structure member operator is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EAssuming that structures, like arrays, are automatically passed by reference and trying to modify the caller's structure values in the called function is a logic error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts\u003C\/span\u003E\u003C\/div\u003E\u003Cul style=\"text-align: justify;\"\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-file-handling.html\"\u003ECommon Programming Error - File Handling\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors.html\"\u003ECommon Programming Error - Fundamentals\u003C\/a\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003C\/div\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comp-psyche.com\/feeds\/621331994500399760\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-structures.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/621331994500399760"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/621331994500399760"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-structures.html","title":"COMMON PROGRAMMING ERRORS - STRUCTURES"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-8998084866353750682"},"published":{"$t":"2013-12-03T04:35:00.000-08:00"},"updated":{"$t":"2014-04-16T01:11:53.604-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"},{"scheme":"http://www.blogger.com/atom/ns#","term":"string"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS - STRING"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - STRING\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: left;\"\u003E\u003C\/div\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003ENot allocating sufficient space in a character array to store the\u003Cspan style=\"color: lime;\"\u003E null character\u003C\/span\u003E that terminates a string.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EPrinting a \u003Cspan style=\"color: lime;\"\u003E\"string\"\u003C\/span\u003E that does not contain \u003Cspan style=\"color: lime;\"\u003Eterminating null character.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EProcessing a single character as a string. A string is a pointer - probably a respectably large integer. However, a character is a small integer ( ASCII values range 0-255). On many systems this causes an error, because \u003Cspan style=\"color: lime;\"\u003Elow memory address\u003C\/span\u003E are reserved for special purposes such as operating system interrupt handlers. So\u003Cspan style=\"color: lime;\"\u003E \"access violation\"\u003C\/span\u003E occurs.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EPassing a character as an argument to a function when a string is expected (and vice versa) is a compilation error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003E\u0026nbsp;Not including the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003E\u0026lt;string.h\u0026gt;\u003C\/span\u003E\u0026nbsp;header when\u0026nbsp;using string functions from the \u003Cspan style=\"color: lime;\"\u003Estring-handling library.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003ENot appending a \u003Cspan style=\"color: lime;\"\u003Eterminating null character\u003C\/span\u003E to the first argument of a\u003Cspan style=\"color: lime;\"\u003E strncpy\u003C\/span\u003E when the third argument is less than or equal to the length of the string in the second argument.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cul\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-pointers.html\"\u003ECommon Programming Error - Pointers\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-structures.html\"\u003ECommon Programming Error - Structures\u003C\/a\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003C\/div\u003E\u003C\/div\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comp-psyche.com\/feeds\/8998084866353750682\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-string.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/8998084866353750682"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/8998084866353750682"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-string.html","title":"COMMON PROGRAMMING ERRORS - STRING"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-4403193895303350989"},"published":{"$t":"2013-12-03T04:28:00.000-08:00"},"updated":{"$t":"2014-06-17T03:38:15.798-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS IN C"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS IN C\u003C\/title\u003E\u003Cbr \/\u003E\nHere we discuss few common programming errors in c which we often commit. For better understanding we have listed the common programming errors according to topics.\u003Cbr \/\u003E\n\u003Ch2 style=\"text-align: left;\"\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#content\" name=\"content\"\u003E\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003ECONTENT\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Cdiv\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#fundamentals\"\u003EFundamentals\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#control\"\u003EControl Structures\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#function\"\u003EFunction\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#array\"\u003EArray\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#string\"\u003EString\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#pointer\"\u003EPointers\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#structure\"\u003EStructures\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#file\"\u003EFile Handling\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#informative\"\u003EMore Informative Posts\u003C\/a\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ch2 style=\"text-align: left;\"\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#fundamentals\" name=\"fundamentals\"\u003E\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003EFUNDAMENTALS\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#content\"\u003EBack to content\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Col\u003E\n\u003Cli\u003ENot putting semicolon after C statements like\u0026nbsp;\u003Ci\u003E\u003Cspan style=\"color: lime;\"\u003Eprintf()\u0026nbsp;\u003C\/span\u003E\u003C\/i\u003Eor\u003Ci\u003E\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Escanf()\u003C\/span\u003E\u003C\/i\u003E\u003Cspan style=\"color: lime;\"\u003E.\u003C\/span\u003E\u003C\/li\u003E\n\u003Cli\u003ENot including required header files.\u003C\/li\u003E\n\u003Cli\u003E\u003Cspan style=\"color: lime;\"\u003EParenthesis\u003C\/span\u003E\u0026nbsp;not matching in\u0026nbsp;\u003Ci\u003E\u003Cspan style=\"color: lime;\"\u003Eprintf()\u003C\/span\u003E\u0026nbsp;or\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Escanf().\u003C\/span\u003E\u003C\/i\u003E\u003C\/li\u003E\n\u003Cli\u003ENot including\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Edouble quotes\u003C\/span\u003E\u0026nbsp;in\u0026nbsp;\u003Cspan style=\"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\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ewrong conversion character\u003C\/span\u003E\u0026nbsp;in\u0026nbsp;\u003Ci\u003Escanf()\u0026nbsp;\u003C\/i\u003Eor\u0026nbsp;\u003Ci\u003Eprintf()\u003C\/i\u003E.\u003C\/li\u003E\n\u003Cli\u003ENot including\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;address of operator\u003C\/span\u003E\u0026nbsp;( \u0026amp; ) in\u0026nbsp;\u003Ci\u003Escanf().\u003C\/i\u003E\u003C\/li\u003E\n\u003Cli\u003EUsing\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Eaddress of operator\u003C\/span\u003E\u0026nbsp;( \u0026amp; ) in\u0026nbsp;\u003Ci\u003Eprintf()\u003C\/i\u003E.\u003C\/li\u003E\n\u003Cli\u003ENot giving precedence to expression wherever required like\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ea\u0026nbsp;+ b \/ 2\u003C\/span\u003E\u0026nbsp;is different from\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;( a\u0026nbsp;+ b ) \/ 2.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ol\u003E\n\u003Ch2 style=\"text-align: left;\"\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#control\" name=\"control\"\u003E\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003ECONTROL STRUCTURES\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#content\"\u003EBack to content\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Col\u003E\n\u003Cli\u003EInserting semicolons at the end of expression in for loop or while loop or if or switch.\u0026nbsp;\u003C\/li\u003E\n\u003C\/ol\u003E\n\u003Cdiv\u003E\n\u003Cb\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003C\/b\u003E\u003Cspan style=\"color: yellow;\"\u003EFor example:\u003C\/span\u003E\u003C\/div\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;\u003C\/span\u003E\u003Cspan style=\"color: lime;\"\u003E \u0026nbsp;for ( a = 4; a \u0026lt;= 10; a++);\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; printf ( \"%d\", a );\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; }\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u0026nbsp; \u0026nbsp; 2. \u0026nbsp; Not inserting semicolon at the end of expression of while in do-while loop.\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u0026nbsp; \u0026nbsp; 3. \u0026nbsp; Not including curly braces to include if or loop statements.\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u0026nbsp; \u0026nbsp; 4. \u0026nbsp; Using an assignment operator in if expression instead of equality operator.\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Ch2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#function\" name=\"function\"\u003E\u003Cspan style=\"font-weight: normal;\"\u003E\u003Cspan style=\"color: yellow;\"\u003ECOMMON PROGRAMMING ERRORS - FUNCTION\u003C\/span\u003E\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#content\"\u003EBack to content\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv\u003E\n\u003Cdiv\u003E\n\u003Cul\u003E\n\u003Cli\u003EForget to put a semicolon at the end of prototype or function declaration.\u003C\/li\u003E\n\u003Cli\u003ESpecifying function parameters of the same type as\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Edouble x,y\u003C\/span\u003E\u0026nbsp;instead of\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Edouble x, double y\u003C\/span\u003E\u0026nbsp;results in a compilation error.\u003C\/li\u003E\n\u003Cul\u003E\u003C\/ul\u003E\n\u003C\/ul\u003E\n\u003Cul\u003E\n\u003Cli\u003EPut a semicolon at the end of function header while defining the function.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: yellow;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;For example:\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;float division(float a, int b); \u0026nbsp;\/\/ error\u0026nbsp;\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; return a\/b;\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; }\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cul\u003E\n\u003Cli\u003EType mismatch error due to difference in the types in function declaration and function definition. The types of parameter may differ.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul\u003E\n\u003Cli\u003EType mismatch error due to difference in the order of parameters in function declaration and function definition.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul\u003E\n\u003Cli\u003EType mismatch error due to difference in the number of actual arguments and the number of formal arguments.\u003C\/li\u003E\n\u003Cli\u003EDefining a function inside another function is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul\u003E\n\u003Cli\u003EDefining a local variable within a function with the same name as formal argument name.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: yellow;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;For example:\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;float division(float a, int b)\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; int a; \/\/error defining the same variable\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; }\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cul\u003E\n\u003Cli\u003ENot returning any value when the function return type is not valid.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: yellow;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; For example:\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; float division(float a, int b)\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;{\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; return ;\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;}\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cbr \/\u003E\n\u003Ch2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#array\" name=\"array\"\u003E\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003EARRAY\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#content\"\u003EBack to content\u003C\/a\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EDeclaring an array\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ewithout specifying any value\u003C\/span\u003E\u0026nbsp;as size of array.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EDeclaring an array taking\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Evariable n\u003C\/span\u003E\u0026nbsp;as size of array.\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003EC\u003C\/span\u003E\u0026nbsp;does not allow a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Evariable length array.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EInitializing\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Emore values\u003C\/span\u003E\u0026nbsp;than the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Especified size.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EAccessing array elements\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ebeyond the range limits.\u003C\/span\u003E\u0026nbsp;\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EArray elements are to be used from\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003E0 to maxsize-1.\u0026nbsp;\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003EC\u003C\/span\u003E\u0026nbsp;does not report any error if user tries to access elements beyond this range but some\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Egarbage value is printed.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EDeclaring array of\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Etype void.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Ch2\u003E\n\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E\u003C\/h2\u003E\n\u003Ch2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#string\" name=\"string\"\u003E\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003ESTRING\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#content\"\u003EBack to content\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003ENot allocating sufficient space in a character array to store the\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;null character\u003C\/span\u003E\u0026nbsp;that terminates a string.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EPrinting a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003E\"string\"\u003C\/span\u003E\u0026nbsp;that does not contain\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Eterminating null character.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EProcessing a single character as a string. A string is a pointer - probably a respectably large integer. However, a character is a small integer ( ASCII values range 0-255). On many systems this causes an error, because\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Elow memory address\u003C\/span\u003E\u0026nbsp;are reserved for special purposes such as operating system interrupt handlers. So\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;\"access violation\"\u003C\/span\u003E\u0026nbsp;occurs.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EPassing a character as an argument to a function when a string is expected (and vice versa) is a compilation error.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003E\u0026nbsp;Not including the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003E\u0026lt;string.h\u0026gt;\u003C\/span\u003E\u0026nbsp;header when\u0026nbsp;using string functions from the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Estring-handling library.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003ENot appending a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Eterminating null character\u003C\/span\u003E\u0026nbsp;to the first argument of a\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;strncpy\u003C\/span\u003E\u0026nbsp;when the third argument is less than or equal to the length of the string in the second argument.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ch2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#pointer\" name=\"pointer\"\u003E\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003ECOMMON PROGRAMMING ERRORS - POINTERS\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#content\"\u003EBack to content\u003C\/a\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EThe\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Easterisk(*)\u003C\/span\u003E\u0026nbsp;notation used to declare pointer variables does not distribute to all variable names in a declaration. Each pointer must be declared with the\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;*\u003C\/span\u003E\u0026nbsp;prefixed to the name. Eg:\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Eint *x,*y;\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EDereferencing a pointer that has not been properly initialized or that has not been assigned to point to a specific location in memory is an error. This could cause a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Efatal execution time error,\u003C\/span\u003E\u0026nbsp;or it could accidently\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Emodify important data\u003C\/span\u003E\u0026nbsp;and allow the program to run to completion with\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;incorrect result.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EBeing unaware that a \u0026nbsp;function is expecting pointers as arguments for\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Epass-by-reference\u003C\/span\u003E\u0026nbsp;and\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;passing arguments by value.\u003C\/span\u003E\u0026nbsp;Some compilers take the values assuming they're pointers and dereference the values as pointers. At run time,\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ememory-access\u003C\/span\u003E\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Eviolation\u003C\/span\u003E\u0026nbsp;or\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Esegmentation faults\u003C\/span\u003E\u0026nbsp;are often generated. Other compilers catch the mismatch in types between arguments and parameters and generate error messages.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EUsing pointer arithmetic on a pointer that does not refer to an element in an array.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003ESubtracting\u003C\/span\u003E\u0026nbsp;or\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ecomparing\u003C\/span\u003E\u0026nbsp;two pointers that do not refer to elements in the same array.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003ERunning off\u003C\/span\u003E\u0026nbsp;either end of an array when using\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Epointer arithmetic.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003EAssigning pointer\u003C\/span\u003E\u0026nbsp;of one type to a pointer of another type if neither is of type\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Evoid *\u003C\/span\u003E\u0026nbsp;is a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Esyntax error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003EDereferencing\u003C\/span\u003E\u0026nbsp;a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Evoid *\u003C\/span\u003E\u0026nbsp;pointer is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EAttempting to\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Emodify an array name\u003C\/span\u003E\u0026nbsp;with\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;pointer arithmetic\u003C\/span\u003E\u0026nbsp;is a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ecompilation error.\u003C\/span\u003E\u0026nbsp;\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cbr \/\u003E\n\u003Ch2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#structure\" name=\"structure\"\u003E\u003Cspan style=\"color: yellow; font-weight: normal;\"\u003ESTRUCTURES\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#content\"\u003EBack to content\u003C\/a\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EForgetting the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Esemicolon\u003C\/span\u003E\u0026nbsp;that terminates a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Estructure definition\u003C\/span\u003E\u0026nbsp;is a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Esyntax error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EAssigning a structure of one type to a structure of different type is a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ecompilation error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EInserting\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Espace\u003C\/span\u003E\u0026nbsp;between the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003E-\u003C\/span\u003E\u0026nbsp;and\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003E\u0026gt;\u003C\/span\u003E\u0026nbsp;components of the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Estructure pointer operator\u003C\/span\u003E\u0026nbsp;is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EAttempting to refer to a member of a structure by using only the\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Emember's name\u003C\/span\u003E\u0026nbsp;is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003ENot using\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;parentheses\u003C\/span\u003E\u0026nbsp;when referring to a structure member that uses a pointer and structure member operator is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EAssuming that structures, like arrays, are automatically passed by reference and trying to modify the caller's structure values in the called function is a logic error.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cbr \/\u003E\n\u003Ch2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#file\" name=\"file\"\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Cspan style=\"font-weight: normal;\"\u003EFILE HANDLING\u003C\/span\u003E\u003C\/span\u003E\u003C\/a\u003E\u003C\/h2\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#content\"\u003EBack to content\u003C\/a\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EOpening an existing file for\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ewriting ( \"w\")\u0026nbsp;\u003C\/span\u003Ewhen in fact, the user wants to preserve the file, discards the contents of file without warning.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EForgetting to open a file before attempting to\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ereference\u003C\/span\u003E\u0026nbsp;it in a program is a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Elogic error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003Eopening a\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Enonexistent file\u003C\/span\u003E\u0026nbsp;for reading is an error.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EOpening a file for reading or writing without having been granted the\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;appropriate access rights\u003C\/span\u003E\u0026nbsp;to the file ( this is\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Eoperating-system dependent\u003C\/span\u003E) is an error.\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EOpening a file for writing when\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Eno space\u003C\/span\u003E\u0026nbsp;is available is a\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp;runtime error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli style=\"text-align: justify;\"\u003EOpening a file in\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Ewrite mode (\"w\")\u003C\/span\u003E\u0026nbsp;when it should be opened in update\u0026nbsp;\u003Cspan style=\"color: lime;\"\u003Emode (\"r+\")\u003C\/span\u003E\u0026nbsp;causes the contents of the file to be \u003Cspan style=\"color: lime;\"\u003Ediscarded.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: left;\"\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#informative\" name=\"informative\" span=\"\" style=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/a\u003E\u003C\/div\u003E\n\u003C\/div\u003E\n\u003C\/div\u003E\n\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cspan style=\"line-height: 24px;\"\u003E\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"http:\/\/www.comp-psyche.com\/2013\/10\/pointers-and-structures.html\"\u003EPointers And Structures\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/10\/array-of-structures.html\"\u003EArray Of Structures\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/10\/structure-and-funciton.html\"\u003EStructure And Function\u003C\/a\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003C\/div\u003E\n\u003C\/div\u003E\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comp-psyche.com\/feeds\/4403193895303350989\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/4403193895303350989"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/4403193895303350989"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html","title":"COMMON PROGRAMMING ERRORS IN C"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"},"georss$featurename":{"$t":"United States"},"georss$point":{"$t":"37.09024 -95.712891000000013"},"georss$box":{"$t":"23.559521500000002 -116.36718800000001 50.6209585 -75.058594000000014"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-7709750115090501216"},"published":{"$t":"2013-11-29T00:05:00.000-08:00"},"updated":{"$t":"2014-04-16T01:12:09.939-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Pointers"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS - POINTERS"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - POINTERS\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: left;\"\u003E\u003C\/div\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EThe \u003Cspan style=\"color: lime;\"\u003Easterisk(*)\u003C\/span\u003E notation used to declare pointer variables does not distribute to all variable names in a declaration. Each pointer must be declared with the\u003Cspan style=\"color: lime;\"\u003E *\u003C\/span\u003E prefixed to the name. Eg: \u003Cspan style=\"color: lime;\"\u003Eint *x,*y;\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EDereferencing a pointer that has not been properly initialized or that has not been assigned to point to a specific location in memory is an error. This could cause a \u003Cspan style=\"color: lime;\"\u003Efatal execution time error,\u003C\/span\u003E or it could accidently \u003Cspan style=\"color: lime;\"\u003Emodify important data\u003C\/span\u003E and allow the program to run to completion with\u003Cspan style=\"color: lime;\"\u003E incorrect result.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EBeing unaware that a \u0026nbsp;function is expecting pointers as arguments for \u003Cspan style=\"color: lime;\"\u003Epass-by-reference\u003C\/span\u003E and\u003Cspan style=\"color: lime;\"\u003E passing arguments by value.\u003C\/span\u003E Some compilers take the values assuming they're pointers and dereference the values as pointers. At run time, \u003Cspan style=\"color: lime;\"\u003Ememory-access\u003C\/span\u003E \u003Cspan style=\"color: lime;\"\u003Eviolation\u003C\/span\u003E or \u003Cspan style=\"color: lime;\"\u003Esegmentation faults\u003C\/span\u003E are often generated. Other compilers catch the mismatch in types between arguments and parameters and generate error messages.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EUsing pointer arithmetic on a pointer that does not refer to an element in an array.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003ESubtracting\u003C\/span\u003E or \u003Cspan style=\"color: lime;\"\u003Ecomparing\u003C\/span\u003E two pointers that do not refer to elements in the same array.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003ERunning off\u003C\/span\u003E either end of an array when using \u003Cspan style=\"color: lime;\"\u003Epointer arithmetic.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003EAssigning pointer\u003C\/span\u003E of one type to a pointer of another type if neither is of type \u003Cspan style=\"color: lime;\"\u003Evoid *\u003C\/span\u003E is a \u003Cspan style=\"color: lime;\"\u003Esyntax error.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003EDereferencing\u003C\/span\u003E a \u003Cspan style=\"color: lime;\"\u003Evoid *\u003C\/span\u003E pointer is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EAttempting to \u003Cspan style=\"color: lime;\"\u003Emodify an array name\u003C\/span\u003E with\u003Cspan style=\"color: lime;\"\u003E pointer arithmetic\u003C\/span\u003E is a \u003Cspan style=\"color: lime;\"\u003Ecompilation error.\u003C\/span\u003E\u0026nbsp;\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cul\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-structures.html\"\u003ECommon Programming Error - Structures\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-file-handling.html\"\u003ECommon Programming Error - File Handling\u003C\/a\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003C\/div\u003E\u003C\/div\u003E"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comp-psyche.com\/feeds\/7709750115090501216\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-pointers.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/7709750115090501216"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/7709750115090501216"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-pointers.html","title":"COMMON PROGRAMMING ERRORS - POINTERS"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-1749873683105783588"},"published":{"$t":"2013-11-26T00:36:00.001-08:00"},"updated":{"$t":"2014-04-16T01:12:59.608-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Array"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS - ARRAY"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - ARRAY\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: left;\"\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: left;\"\u003E\u003C\/div\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EDeclaring an array \u003Cspan style=\"color: lime;\"\u003Ewithout specifying any value\u003C\/span\u003E as size of array.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EDeclaring an array taking \u003Cspan style=\"color: lime;\"\u003Evariable n\u003C\/span\u003E as size of array. \u003Cspan style=\"color: lime;\"\u003EC\u003C\/span\u003E does not allow a \u003Cspan style=\"color: lime;\"\u003Evariable length array.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EInitializing \u003Cspan style=\"color: lime;\"\u003Emore values\u003C\/span\u003E than the \u003Cspan style=\"color: lime;\"\u003Especified size.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EAccessing array elements \u003Cspan style=\"color: lime;\"\u003Ebeyond the range limits.\u003C\/span\u003E\u0026nbsp;\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EArray elements are to be used from \u003Cspan style=\"color: lime;\"\u003E0 to maxsize-1.\u0026nbsp;\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003EC\u003C\/span\u003E does not report any error if user tries to access elements beyond this range but some \u003Cspan style=\"color: lime;\"\u003Egarbage value is printed.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul style=\"text-align: left;\"\u003E\u003Cli style=\"text-align: justify;\"\u003EDeclaring array of \u003Cspan style=\"color: lime;\"\u003Etype void.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cdiv\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv\u003E\u003Cul\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-string.html\"\u003ECommon Programming Error - String\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-pointers.html\"\u003ECommon Programming Error - Pointers\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\/1749873683105783588\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-array.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/1749873683105783588"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/1749873683105783588"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-array.html","title":"COMMON PROGRAMMING ERRORS - ARRAY"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-5273556307859903472"},"published":{"$t":"2013-11-24T02:04:00.000-08:00"},"updated":{"$t":"2014-04-23T22:51:33.996-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"functions"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERROR - FUNCTION"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Cdiv style=\"text-align: justify;\"\u003EHere is a list of few common programming errors committed by us in function. For complete list of common programming errors visit : \u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html\" target=\"_blank\"\u003ECommon Programming Errors In C\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cul\u003E\u003Cli\u003EForget to put a semicolon at the end of prototype or function declaration.\u003C\/li\u003E\n\u003Cli\u003ESpecifying function parameters of the same type as \u003Cspan style=\"color: lime;\"\u003Edouble x,y\u003C\/span\u003E instead of \u003Cspan style=\"color: lime;\"\u003Edouble x, double y\u003C\/span\u003E results in a compilation error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul\u003E\u003Cli\u003EPut a semicolon at the end of function header while defining the function.\u003C\/li\u003E\n\u003C\/ul\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;For example:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;float division(float a, int b); \u0026nbsp;\/\/ error\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; return a\/b;\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; }\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cul\u003E\u003Cli\u003EType mismatch error due to difference in the types in function declaration and function definition. The types of parameter may differ.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul\u003E\u003Cli\u003EType mismatch error due to difference in the order of parameters in function declaration and function definition.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul\u003E\u003Cli\u003EType mismatch error due to difference in the number of actual arguments and the number of formal arguments.\u003C\/li\u003E\n\u003Cli\u003EDefining a function inside another function is a syntax error.\u003C\/li\u003E\n\u003C\/ul\u003E\u003Cul\u003E\u003Cli\u003EDefining a local variable within a function with the same name as formal argument name.\u003C\/li\u003E\n\u003C\/ul\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;For example:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;float division(float a, int b)\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; {\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; int a; \/\/error defining the same variable\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; }\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cul\u003E\u003Cli\u003ENot returning any value when the function return type is not valid.\u003C\/li\u003E\n\u003C\/ul\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; For example:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; float division(float a, int b)\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;{\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; return ;\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: lime;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;}\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cbr \/\u003E\n\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cdiv\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv\u003E\u003Cul\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/learn-C.html\"\u003ELearn C\u003C\/a\u003E\u003C\/span\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"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=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-array.html\"\u003ECommon Programming Error - Array\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-string.html\"\u003ECommon Programming Error - String\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\/5273556307859903472\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-function.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/5273556307859903472"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/5273556307859903472"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-function.html","title":"COMMON PROGRAMMING ERROR - FUNCTION"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-3214615755517805421"},"published":{"$t":"2013-11-18T07:20:00.000-08:00"},"updated":{"$t":"2014-04-16T01:12:37.357-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS - CONTROL STRUCTURES"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - CONTROL STRUCTURES\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\u003C\/div\u003E\u003Col\u003E\u003Cli\u003EInserting semicolons at the end of expression in for loop or while loop or if or switch.\u0026nbsp;\u003C\/li\u003E\n\u003C\/ol\u003E\u003Cdiv\u003E\u003Cb\u003EFor example:\u003C\/b\u003E\u003C\/div\u003E\u003Cdiv class=\"mokcode\"\u003E\u003Cspan style=\"color: blue;\"\u003Efor ( a = 4; a \u0026lt;= 10; a++);\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u0026nbsp; \u0026nbsp;printf ( \"%d\", a );\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E}\u003C\/span\u003E\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\u0026nbsp; \u0026nbsp; 2. \u0026nbsp; Not inserting semicolon at the end of expression of while in do-while loop.\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u0026nbsp; \u0026nbsp; 3. \u0026nbsp; Not including curly braces to include if or loop statements.\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u0026nbsp; \u0026nbsp; 4. \u0026nbsp; Using an assignment operator in if expression instead of equality operator.\u003C\/div\u003E\u003Cdiv\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u0026nbsp; \u003Cbr \/\u003E\n\u003Cdiv\u003E\u003Cdiv\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv\u003E\u003Cul\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-function.html\"\u003ECommon Programming Error - Function\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-errors-array.html\"\u003ECommon Programming Error - Array\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"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comp-psyche.com\/feeds\/3214615755517805421\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/06\/common-programming-errors_25.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/3214615755517805421"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/3214615755517805421"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/06\/common-programming-errors_25.html","title":"COMMON PROGRAMMING ERRORS - CONTROL STRUCTURES"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"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=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\nThere are two ways of writing comments:\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n1. Single line comment\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\nSyntax:\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\/\/Your comments here\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\nexample:\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u0026nbsp;\/\/ Hello this is my first C program\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n2. Multiline comment \u0026nbsp;\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\nSyntax:\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\/* Your comment\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\nYour comment*\/\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\nexample:\u0026nbsp;\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\/* This is my first C program\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\nand i am very excited about it *\/\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cspan style=\"color: yellow;\"\u003ESYNTAX:\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"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=\"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=\"text-align: justify;\"\u003E\n#include\u0026lt;conio.h\u0026gt; \/\/It is used for getch() function\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\nint \u0026nbsp;main() \/\/ It is the entry point of a program\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n{ \/\/ Progam begins with this curly braces\u003C\/div\u003E\n\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\n\u003Cdiv style=\"-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=\"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=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cspan style=\"color: yellow;\"\u003EOUTPUT:\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\nCongratulation you successfully run your \u0026nbsp;first program\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cspan style=\"color: yellow;\"\u003EEXPLANATION:\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cspan style=\"color: yellow;\"\u003EPROGRAM EXAMPLE:\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cb\u003E\u003Cbr \/\u003E\n\u003C\/b\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cb\u003E#\u003C\/b\u003Einclude\u0026lt;stdio.h\u0026gt;\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\nint main()\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n{\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\nprintf(\"%d\", 5+6); \/\/ %d is conversion character for integer\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\nreturn 0;\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n}\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cspan style=\"color: yellow;\"\u003EOUTPUT:\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n11\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cspan style=\"color: yellow;\"\u003EEXPLANATION:\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\n\u003Cb\u003E\u003Cbr \/\u003E\n\u003C\/b\u003E\u003C\/div\u003E\n\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\n\u003Cbr \/\u003E\u003C\/div\u003E\n\u003Cdiv style=\"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":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"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=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ELOGIC BOOSTER AND BRAINSTORMING QUESTION\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Ch2 style=\"text-align: left;\"\u003E\u003Cspan style=\"color: yellow; font-size: large; font-weight: normal;\"\u003ELOGIC BOOSTER\u003C\/span\u003E\u003C\/h2\u003E\u003Cdiv style=\"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=\"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=\"text-align: justify;\"\u003E\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;double\u003C\/div\u003E\u003C\/td\u003E\u003Ctd\u003E\u003Cdiv style=\"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=\"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=\"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=\"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=\"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=\"mokcode\"\u003E\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;stdio.h\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;conio.h\u0026gt; \/\/ Linux user - Remove this\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Eint main()\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Eint a=10, b=20, c=30, avg;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Eavg= a+b+c\/3;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Eprintf(\"Average is: %d\", avg);\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Egetch();\u0026nbsp;\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv\u003E\u003Cspan style=\"color: blue;\"\u003Ereturn 0;\u003C\/span\u003E\u003C\/div\u003E\u003Cspan style=\"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 = 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=\"mokcode\"\u003E\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;stdio.h\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;conio.h\u0026gt;\u0026nbsp;\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Eint main()\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Eprintf(\"This is C \"),\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Eprintf(\"Programming.\");\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Egetch();\u0026nbsp;\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv\u003E\u003Cspan style=\"color: blue;\"\u003Ereturn 0;\u003C\/span\u003E\u003C\/div\u003E\u003Cspan style=\"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=\"mokcode\"\u003E\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;stdio.h\u0026gt;\u003Cbr \/\u003E\n#include\u0026lt;conio.h\u0026gt;\u0026nbsp;\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv\u003E\u003Cspan style=\"color: blue;\"\u003Eint main()\u003C\/span\u003E\u003C\/div\u003E\u003Cspan style=\"color: blue;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Eint x=10, , y=32;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Eprintf(\"%d %d\"), x, y);\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Egetch();\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cdiv\u003E\u003Cspan style=\"color: blue;\"\u003Ereturn 0;\u003C\/span\u003E\u003C\/div\u003E\u003Cspan style=\"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=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv\u003E\u003Cul\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"http:\/\/www.comp-psyche.com\/2013\/06\/control-statements.html\"\u003EControl Statements\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"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":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"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=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - FUNDAMENTALS\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"text-align: justify;\"\u003E\u003C\/div\u003E\u003Col\u003E\u003Cli\u003ENot putting semicolon after C statements like \u003Ci\u003E\u003Cspan style=\"color: lime;\"\u003Eprintf() \u003C\/span\u003E\u003C\/i\u003Eor\u003Ci\u003E \u003Cspan style=\"color: lime;\"\u003Escanf()\u003C\/span\u003E\u003C\/i\u003E\u003Cspan style=\"color: lime;\"\u003E.\u003C\/span\u003E\u003C\/li\u003E\n\u003Cli\u003ENot including required header files.\u003C\/li\u003E\n\u003Cli\u003E\u003Cspan style=\"color: lime;\"\u003EParenthesis\u003C\/span\u003E not matching in \u003Ci\u003E\u003Cspan style=\"color: lime;\"\u003Eprintf()\u003C\/span\u003E or \u003Cspan style=\"color: lime;\"\u003Escanf().\u003C\/span\u003E\u003C\/i\u003E\u003C\/li\u003E\n\u003Cli\u003ENot including \u003Cspan style=\"color: lime;\"\u003Edouble quotes\u003C\/span\u003E in \u003Cspan style=\"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=\"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=\"color: lime;\"\u003E address of operator\u003C\/span\u003E ( \u0026amp; ) in \u003Ci\u003Escanf().\u003C\/i\u003E\u003C\/li\u003E\n\u003Cli\u003EUsing \u003Cspan style=\"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=\"color: lime;\"\u003Ea\u0026nbsp;+ b \/ 2\u003C\/span\u003E is different from\u003Cspan style=\"color: lime;\"\u003E ( a\u0026nbsp;+ b ) \/ 2.\u003C\/span\u003E\u003C\/li\u003E\n\u003C\/ol\u003E\u003Cdiv\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv style=\"text-align: justify;\"\u003E\u003Cul\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"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=\"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":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-1751055533285805299"},"published":{"$t":"2013-11-17T07:46:00.000-08:00"},"updated":{"$t":"2016-05-17T09:39:47.526-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Contents"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"Learn C"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Cul type=\"square\"\u003E\n\u003Cli style=\"color: yellow;\"\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/03\/c-programming-in-linux.html\"\u003EC Under Linux\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli style=\"color: yellow;\"\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2013\/11\/common-programming-error-complete-list.html\"\u003ECommon Programming Errors\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli style=\"color: yellow;\"\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs.html\"\u003EC Programs\u003C\/a\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003C\/div\u003E\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comp-psyche.com\/feeds\/1751055533285805299\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/learn-C.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/1751055533285805299"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/1751055533285805299"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2013\/11\/learn-C.html","title":"Learn C"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}}]}});