[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-388514-105":59,"doc-detail-388514-en":131,"doc-similar-388514":166},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":124,"head_meta":126,"extra_data":128,"updated_unix":130},105,"en","est-102-cpc-module-4-working-with-functions","EST 102 CPC MODULE-4 - WORKING WITH FUNCTIONS","","Working with Functions introduces C functions as self-contained code blocks that take input from the main program and return results, with internal implementation hidden from other parts. The module explains why user-defined functions are needed, how modular programming improves readability, debugging, testing, and maintenance, and how modules communicate through calling relationships. It also covers writing functions, program flow from main to called functions, and the three key elements of user-defined functions: definition, call, and declaration, including function header and body.",{"@graph":69,"@context":123},[70,84,106],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/est-102-cpc-module-4-working-with-functions/388514/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/est-102-cpc-module-4-working-with-functions/388514.png","ImageObject",300,407,{"name":92,"@type":93},"Chumphorn","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-25","2026-09-25",true,{"@type":102,"interactionType":103,"userInteractionCount":105},"InteractionCounter",{"@type":104},"ViewAction",12,{"@type":107,"mainEntity":108},"FAQPage",[109,115,119],{"name":110,"@type":111,"acceptedAnswer":112},"What is a function in C, and what does a program know about it?","Question",{"text":113,"@type":114},"A function is a self-contained block of code that performs a specific task. Other parts of the program can only see what goes in and what comes out; the internal details remain invisible.","Answer",{"name":116,"@type":111,"acceptedAnswer":117},"Why should programmers use user-defined functions instead of only the main function?",{"text":118,"@type":114},"Using only main makes programs large, complex, and harder to debug, test, and maintain. Splitting code into functional parts creates subprograms that are easier to understand and reuse.",{"name":120,"@type":111,"acceptedAnswer":121},"What are the three elements required to use a user-defined function?",{"text":122,"@type":114},"The three elements are function definition, function call, and function declaration (function prototype). The calling program uses the declaration before the later call.","https://schema.org",{"og:url":83,"og:type":125,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":127,"canonical":83},"index,follow",{"doc_id":129,"site_id":62},388514,1790437373,{"code":4,"msg":5,"data":132},{"doc_id":129,"user_id":133,"nickname":92,"user_avatar":134,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":135,"file_id":136,"file_url":137,"file_type":138,"file_size":139,"view_count":105,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":140,"language":141,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":142,"faqs":143,"seo_title":144,"seo_description":67,"update_tm":145,"read_time":146,"preview_page_count":24,"preview_urls":147},2336475401981,"https://ap-avatar.wpscdn.com/avatar/22000c94efd8d5204d?x-image-process=image/resize,m_fixed,w_180,h_180&k=1786935347598174694","EST 102 CPC MODULE-4  \nWORKING WITH FUNCTIONS  \nIntroduction to Functions:  \n● C functions is one of the strengths of C language .  \n● A function is a self-contained block of code that performs a particular task.  \n● Once a function has been designed and packed, it can be treated as a blackbox that takes some data from the main program and returns a value.  \n● The inner details of operation are invisible to the rest of the program .  \n● All that a program knows about a function is: what goes in and what comes out.  \n● Functions in C can be classified into two;  \n○ Library functions: Not required to be written by the user.  \n■ Eg:printf, scanf, strcat etc .,  \n○ User-defined functions: developed by user at the time of writing a program .  \n■ Eg:main  \nNeed for user-deﬁned functions:  \n● Even though it is possible to code any program utilizing only main function, it leads to a number of problems.  \n○ The program may become too large and complex .  \n○ Debugging, testing and maintaining becomes difficult.  \n● If a program is divided into functional parts, then each part may be independently coded and later combined into a single unit.  \n● These independently coded programs are called subprograms that are much easier to understand, debug and test.  \n● Such subprograms are called functions.  \nModular Programming:  \n● It is defined as organizing a large program into small, independent program segments called modules that are separately named and individually callable program units.  \n● These modules are carefully integrated to become a software system that satisfies the system requirements.  \n●  Characteristics of Modular Programming:  \n○ Each module should do only one thing.  \n○ Communication between modules is allowed only by calling a module.  \n○ A module can be called only by one and only one higher module.  \n○ No communication can take place directly between modules that do not have calling-called relationship.  \n○ All modules are designed as single-entry, single-exit systems using control structures .  \nWriting Functions:  \n●  Eg:C program to print a message using function.  \n\\#include\u003Cstdio.h> void main( )  \n{  \nprintf(“This is the main function”);  \nprintmessage( );  \n}  \nvoid printmessage( )  \n{  \nprintf(“This is user defined function”);  \n}  \nOUTPUT:  \nThis is main Function!  \nThis is user defined function  \n● The program execution begins with the main function.  \n● During execution of the main, after execution of printf statement, the following statement is encountered,  \nprintmessage( );  \nwhich indicates that the function printmessage is to be executed.  \n● At this point, the program control is transferred to the function printmessage .  \n● printmessage function is executed and then the main function execution ends.  \nElements of user deﬁned functions:  \n● In order to make use of a user-defined function, we need to establish three elements that are related to functions.  \n○ Function definition.  \n○ Function call.  \n○ Function declaration.  \n● The function definition is an independent program module that is specially written to implement the requirements of the function.  \n● In order to use this function, we need to invoke it a required place in the program . This is function call.  \n● The program (or a function) that calls the function is referred to as the calling program or calling function.  \n● The calling program should declare any function that is to be used later in the program . This is called function declaration or function prototype.  \nFunction Definition:  \n● A function definition include the following;  \n1. Function name .  \n2. Function type.  \n3. List of parameters .  \n4. Local variable declarations.  \n5. Function statements  \n6. Return statement  \n● All these 6 elements are grouped into two parts;  \n○ Function header (First three elements)  \n○ Function body (Second three elements)  \n● The first line function_type function_name(parameter list) is known as the function header and the statements within the ope","cbCaik3w5awYX2sm","https://ap.wps.com/l/cbCaik3w5awYX2sm","pdf",1088008,46,"English","# Introduction to Functions\n## Need for User-Defined Functions\n# Modular Programming\n# Writing Functions\n## Elements of User-Defined Functions\n# Function Definition\n## Function Header","[{\"question\":\"What is a function in C, and what does a program know about it?\",\"answer\":\"A function is a self-contained block of code that performs a specific task. Other parts of the program can only see what goes in and what comes out; the internal details remain invisible.\"},{\"question\":\"Why should programmers use user-defined functions instead of only the main function?\",\"answer\":\"Using only main makes programs large, complex, and harder to debug, test, and maintain. Splitting code into functional parts creates subprograms that are easier to understand and reuse.\"},{\"question\":\"What are the three elements required to use a user-defined function?\",\"answer\":\"The three elements are function definition, function call, and function declaration (function prototype). The calling program uses the declaration before the later call.\"}]","EST 102 CPC MODULE-4 - WORKING WITH FUNCTIONS | PDF",1790305095,116,[148,152,155,159,162],{"page_no":8,"url":149,"width":150,"height":151},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/83a5c80d699940a271607d3bdfbdf5da.webp",983,552,{"page_no":14,"url":153,"width":154,"height":151},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/27e2f58d0c0bbad3a6e05ec060033226.webp",982,{"page_no":81,"url":156,"width":157,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/e117f7691152f481da3946d5ac6fce4d.webp",981,551,{"page_no":19,"url":160,"width":161,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/83f5ce24796ea198ad33b2a49cc5eaab.webp",980,{"page_no":24,"url":163,"width":164,"height":165},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-16/0725851d879d883a819c443b85657b1b.webp",979,550,{"list":167,"token":66},[168,174,180,186,192,198,205,211,217,223],{"doc_id":169,"doc_title":170,"file_type":138,"home_preview_img_url":171,"slug":172,"view_count":29,"category_name":30,"create_tm":173},673424,"UNIT: 1 - Flowchart and Algorithm - Introduction and C Program Basics","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229990584774/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796134739&Signature=vKwOxgCI6LwiboiP8eq0CxR3D18%3D","unit-1-flowchart-and-algorithm-introduction-and-c-program-basics",1793637912,{"doc_id":175,"doc_title":176,"file_type":138,"home_preview_img_url":177,"slug":178,"view_count":44,"category_name":30,"create_tm":179},228465,"OS/VS2 System - Programming Library - Debugging Handbook - Volume 2 - Second Edition - December 1978","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229891835783/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796134739&Signature=z5jlb2l5dXUBn%2BcyKAXtbbQkyjc%3D","osvs2-system-programming-library-debugging-handbook-volume-2-second-edition-december-1978",1789025581,{"doc_id":181,"doc_title":182,"file_type":138,"home_preview_img_url":183,"slug":184,"view_count":19,"category_name":30,"create_tm":185},685653,"Introduction to Programming Languages and Tools of the Trade - Lesson Overview","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999685614/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796134739&Signature=CmamSKH3h26%2BNT7jWlYq4RL%2FzmY%3D","introduction-to-programming-languages-and-tools-of-the-trade-lesson-overview",1794016330,{"doc_id":187,"doc_title":188,"file_type":138,"home_preview_img_url":189,"slug":190,"view_count":39,"category_name":30,"create_tm":191},347393,"Intro to C Programming - Course Talk Slides","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229911501576/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796134739&Signature=aqYcAnUU676XpaD7iSgV%2FqnHx1Y%3D","intro-to-c-programming-course-talk-slides",1790066765,{"doc_id":193,"doc_title":194,"file_type":138,"home_preview_img_url":195,"slug":196,"view_count":19,"category_name":30,"create_tm":197},689000,"DM3 RM En C0 - Product Manual","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001492866/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796134739&Signature=qtn5DLQfVlXHrjtWzm35gcBS9N0%3D","dm3-rm-en-c0-product-manual",1794093386,{"doc_id":199,"doc_title":200,"file_type":138,"home_preview_img_url":201,"slug":202,"view_count":203,"category_name":30,"create_tm":204},347403,"C Programming for the Absolute Beginner - Overview","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229911501711/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796134739&Signature=%2FwuhEDFGeYAhhHr4CUt%2FYRsi8gs%3D","c-programming-for-the-absolute-beginner-overview",17,1790066796,{"doc_id":206,"doc_title":207,"file_type":138,"home_preview_img_url":208,"slug":209,"view_count":34,"category_name":30,"create_tm":210},687848,"AutomationInterface Configurator - DaVinci Configurator Development Documentation - Release Version Alignment 6","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000651021/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796134739&Signature=pMvV431sYe1DU5GHGiZTaTI8vvU%3D","automationinterface-configurator-davinci-configurator-development-documentation-release-version-alignment-6",1794085232,{"doc_id":212,"doc_title":213,"file_type":138,"home_preview_img_url":214,"slug":215,"view_count":34,"category_name":30,"create_tm":216},692314,"CS 116 Course Specific Style Guide - Document","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230003205286/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796134739&Signature=r5RyNPYr3jpPRx7xXSQ2ISYLEcQ%3D","cs-116-course-specific-style-guide-document",1794193120,{"doc_id":218,"doc_title":219,"file_type":138,"home_preview_img_url":220,"slug":221,"view_count":29,"category_name":30,"create_tm":222},708709,"powersoft - ARMONIA 2.4.0 - User Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230015911571/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796134739&Signature=1zCMABkoJfIKCSPkQX02opcdibk%3D","powersoft-armonia-240-user-guide",1794723033,{"doc_id":224,"doc_title":225,"file_type":138,"home_preview_img_url":226,"slug":227,"view_count":24,"category_name":30,"create_tm":228},700119,"nRF54L15 DK Hardware - User Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012012756/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796134739&Signature=4ln2MagNtfdyjJ8VfyJ9ApQyck8%3D","nrf54l15-dk-hardware-user-guide",1794515975]