{"id":81460,"date":"2021-07-02T09:00:17","date_gmt":"2021-07-02T03:30:17","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=81460"},"modified":"2021-07-02T09:00:17","modified_gmt":"2021-07-02T03:30:17","slug":"functions-in-c","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/","title":{"rendered":"Functions in C"},"content":{"rendered":"<p>In every programming language, functions are one of the key features available to the programmer. The C programming language also has a bunch of built-in functions. Apart from the built-in functions, we can also define our own function to C.<\/p>\n<p>Functions are very useful to all programming languages. Functions help in code reusability and it is easy to understand the code with functions.<\/p>\n<h3>What are functions in C?<\/h3>\n<p>In C, we can divide large programs into building blocks which are known as functions.<\/p>\n<p>Suppose, you have a block of code and you want to execute those blocks of code again and again to perform some specific task then you can make use of functions.<\/p>\n<p>Function includes a set of statements enclosed by {}. To provide reusability and modularity to the code, you can call functions multiple times. Standard C library has numerous built-in functions that your program can call.<\/p>\n<h3>Advantages of functions in C<\/h3>\n<ul>\n<li>It provides code reusability and modularity.<\/li>\n<li>You can call the provided function from anywhere in your code.<\/li>\n<li>Also used to avoid writing the same block of code again and again in the program.<\/li>\n<li>With the help of functions, it is easy to understand and analyze the program.<\/li>\n<\/ul>\n<h3>Function aspects in C<\/h3>\n<ul>\n<li><strong>Function Declaration:-<\/strong> Functions must be declared globally.<\/li>\n<li><strong>Function Call:-<\/strong> A function can be called from anywhere in the program.<\/li>\n<li><strong>Function Definition:-<\/strong> It includes the statements which are to be executed. But only one value can be returned from the function.<\/li>\n<\/ul>\n<table style=\"height: 199px\" width=\"710\">\n<tbody>\n<tr>\n<td><b>Function Aspects<\/b><\/td>\n<td><b>Syntax<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Function Declaration<\/span><\/td>\n<td><span style=\"font-weight: 400\">return_type function_name (arguments);<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Function call<\/span><\/td>\n<td><span style=\"font-weight: 400\">function_name (arguments)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Function definition<\/span><\/td>\n<td><span style=\"font-weight: 400\">return_type function_name (arguments) {statements;}<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Defining a function in C<\/h3>\n<p>Syntax of creating function in c programming language:-<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">return_type function_name(parameter list){  \n\/\/ body of the function\n}\n<\/pre>\n<p><strong>Example of defining C Function<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int sum(int n1, int n2){\nint final;\nfinal = n1 + n2;\nreturn final;\n}\n<\/pre>\n<p>Below are the some parts of a function:-<\/p>\n<ul>\n<li><strong>Return Type:-<\/strong> It is the data type of the value that the function returns. Some functions do not return any value. In that case, the return type is <strong>void.<\/strong><\/li>\n<li><strong>Function name:<\/strong>&#8211; It is the actual name given to the function.<\/li>\n<li><strong>Parameters:-<\/strong> When a function is defined, you pass a value to the parameter. It is optional. A function may not contain any parameters.<\/li>\n<li><strong>Function Body:-<\/strong> It contains statements that define what the function does.<\/li>\n<\/ul>\n<h3>Types of Functions in C<\/h3>\n<p>Two types of functions available in C:-<\/p>\n<p><strong>1<\/strong><strong>. Library Functions:-<\/strong> These functions are declared in C header files like printf(), scanf(), gets(), puts() etc.<\/p>\n<p><strong>2. User-Defined Functions:-<\/strong> In C, you can create your own function. They are known as user-defined functions.<\/p>\n<h4>Advantages of user-defined function in C<\/h4>\n<ul>\n<li>It&#8217;s easy to understand and debug the code.<\/li>\n<li>Don\u2019t have to use the same block of code again and again.<\/li>\n<\/ul>\n<h4>Working of C User-Defined functions<\/h4>\n<p>Execution of the C program starts from the main() function.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\nvoid functionName()\n{\n\/\/ body of the function!\n}\nint main()\n{\n... .. ...\n... .. ...\nfunctionName();\n... .. ...\n... .. ...\n}\n<\/pre>\n<p><strong>Basic Example of user defined function in C:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\n\/\/ function minimum()!\nint minimum(int i, int j)\n{\nif (i &lt; j)\nreturn i;\nelse\nreturn j;\n}\nint main(void)\n{\nint x = 555, y = 69;\nprintf(\"TechVidvan Tutorials: Basic Example of C!\");\nint min = minimum(x, y); \/\/ function calling!\nprintf(\"m is %d!\", min);\nreturn 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">TechVidvan Tutorials: Basic Example of C!<br \/>\nm is 69!<\/div>\n<h4>User Defined Function prototype:-<\/h4>\n<p>It is generally the declaration of a function that specifies the function&#8217;s name, parameters and return type.<br \/>\n<strong>Syntax:-<\/strong><br \/>\nreturnType functionName(type1 argument1, type2 argument2, &#8230;);<\/p>\n<p><strong>Example:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int sum_of_numbers(int a, int b);\n\n<\/pre>\n<p>In the above example, the name of the function is sum_of_numbers, return type is int and two int arguments are passed to the function. If a user defined function is defined before the main() function, then function prototype is not needed.<\/p>\n<h4>Calling a function:-<\/h4>\n<p>To use the function, you will have to call it first.<br \/>\n<strong>Syntax:-<\/strong><br \/>\nfunctionName(argument 1, argument 2, &#8230;);<\/p>\n<h4>User-Defined function definition:-<\/h4>\n<p>In C, you can define a block of code as a function to perform a specific task.<\/p>\n<p><strong>Syntax:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">return_type function_name(type1 argument1, type2 argument2, ...)\n{\n    \/\/ function body\n}\n<\/pre>\n<h3>Function Declarations in C<\/h3>\n<p>Function declaration helps the compiler in many ways.<\/p>\n<p>With the help of function declaration, the compiler will know the number of parameters that the function takes, Data types of the parameters, and Return type of the function.<\/p>\n<p>It is optional to put parameter names in function declaration. But you do have to put them in the definition.<\/p>\n<p><strong>Example of Function Declaration<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int min(int x, int y);\nint max(int, int);\nint local(char, int);\n<\/pre>\n<p>It is always a must to declare functions before they are used.<\/p>\n<h3>Passing parameters to function in C:-<\/h3>\n<p>Parameters passed to the function are known as<strong> actual parameters<\/strong>. In the above code, 555 and 69 are actual parameters.<\/p>\n<p>Received parameters by the function are known as <strong>formal parameters<\/strong>. In the above code, i and j are formal parameters.<\/p>\n<p>In C, we can use two popular ways to pass parameter:-<\/p>\n<h4>1. pass by value<\/h4>\n<p>Values of the actual parameters are copied into the function\u2019s formal parameters. And these two types of parameters are stored in different memory locations.<\/p>\n<p>In C, this is the most used passing technique.<\/p>\n<p><strong>For Example:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\nint local(int i)\n{\ni= 60;\nreturn i;\n}\nint main()\n{\nint i= 20;\nlocal(i);\nprintf(\"i= %d\", i);\nreturn 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">i= 20<\/div>\n<h4>2. pass by reference<\/h4>\n<p>In this, the actual and formal parameters refer to the same memory locations. To implement it, we have to use pointers.<\/p>\n<p><strong>For Example:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\nint local(int *i)\n{\n*i=60;\nreturn *i;\n}\nint main()\n{\nint i= 20;\nlocal(&amp;i);\nprintf(\"i= %d\", i);\nreturn 0;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">i= 60<\/div>\n<h3>Function Calling in C<\/h3>\n<p>A function contains a block of code which will perform a specific task. You will have to call the function which will perform that specific task.<\/p>\n<p>To call a function, you will have to pass the required parameters and the function name. And if the function returns value then you can store it.<\/p>\n<p><strong>For Example:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;stdio.h&gt;\nint sum(int n1, int n2); \/\/ function declaration!\nint main () {\nint num1 = 6;\nint num2 = 15;\nint final;\nfinal = sum(num1, num2); \/\/ function calling!\nprintf(\"TechVidvan Tutorials: Basic Example of function calling...\\n\\n\");\nprintf( \"Max value is : %d\\n\", final );\nreturn 0;\n}\nint sum(int n1, int n2){ \/\/ function to return the sum of two values!\nint res;\nres = n1 + n2;\nreturn res;\n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">\n<p>TechVidvan Tutorials: Basic Example of function calling&#8230;<\/p>\n<p>Max value is : 21<\/p>\n<\/div>\n<h4>Return Value:-<\/h4>\n<p>C function may or may not return a value. If you do not want to return any value then use the <strong>void<\/strong> keyword.<\/p>\n<p><strong>Syntax:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">return (expression);<\/pre>\n<p><strong>For Example:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">return a;\nreturn (a+b);\n<\/pre>\n<p><strong>Example of a C program that does not return value:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">void final(){  \nprintf(\"TechVidvan Tutorials: Example of a C program that does not return value\");  \n}\n<\/pre>\n<p>And, if you want to return value from the function, then you will have to use the data types like int, float, char, long etc.<\/p>\n<p><strong>Example with return value:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int sum(){  \nreturn 40;  \n} \n<\/pre>\n<p>In the above, the return type is int. To get the value of the function, you need to call it.<\/p>\n<h3>Different aspects of function calling<\/h3>\n<p>Four different aspects of function calling:-<\/p>\n<ul>\n<li>function without arguments and without return value<\/li>\n<li>function without arguments and with return value<\/li>\n<li>function with arguments and without return value<\/li>\n<li>function with arguments and with return value<\/li>\n<\/ul>\n<p><strong>Example of function without arguments and return value:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include&lt;stdio.h&gt;  \nvoid bestblog();  \nint main ()  \n{  \nbestblog();  \n}  \nvoid bestblog()  \n{  \nprintf(\"Hey, Please Like and Share TechVidvan Tutorials..\");  \n} \n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">Hey, Please Like and Share TechVidvan Tutorials..<\/div>\n<p><strong>Example of function without arguments and with return value:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include&lt;stdio.h&gt;  \nint main()  \n{  \nfloat area = square();  \nprintf(\"The area of the square: %f\\n\",area);  \n}  \nint square()  \n{  \nfloat a = 5;  \nreturn a * a;  \n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">The area of the square: 25.000000<\/div>\n<p><strong>Example of function with arguments and without return value:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include&lt;stdio.h&gt;  \nvoid average(float, float, float, float, float);  \nint main()  \n{  \nfloat i=1,j=5.2,k=4,l=4,m=1.2;   \naverage(i,j,k,l,m);  \n}  \nvoid average(float i, float j, float k, float l, float m)  \n{  \nfloat avg;   \navg = (i+j+k+l+m)\/5;\nprintf(\"TechVidvan Tutorials: Find Average!\\n\");\nprintf(\"Average is: %f\",avg);  \n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">TechVidvan Tutorials: Find Average!<br \/>\nAverage is: 3.080000<\/div>\n<p><strong>Example of function with arguments and return value:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include&lt;stdio.h&gt;  \nint checkprime(int);  \nvoid main()  \n{  \nint a=17,result;  \nresult = checkprime(a);  \nprintf(\"TechVidvan Tutorials: Check Prime or not!\\n\\n\");\nif(result == 0)  \n{  \nprintf(\"The number is odd!\");  \n}  \nelse   \n{  \nprintf(\"The number is even!\");  \n}  \n}  \nint checkprime(int a)  \n{  \nif(a%2 == 0)  \n{  \nreturn 1;  \n}  \nelse   \n{  \nreturn 0;  \n}  \n}\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<div class=\"code-output\">\n<p>TechVidvan Tutorials: Check Prime or not!<\/p>\n<p>The number is odd!<\/p>\n<\/div>\n<h3>C Library Functions<\/h3>\n<p>These functions are the built-in functions in C. These library functions are used to perform some specific task. There are different header files available in C which contain these C library functions. The header files are defined with .h extension. To make use of these library functions, we have to include these header files at the start of our code.<\/p>\n<p>Suppose, you want to use printf() and scanf() functions in your program then you have to include stdio.h in your program.<\/p>\n<p>Below is the table for mostly used header files:-<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Header File<\/b><\/td>\n<td><b>What it does<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">stdio.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Contains all the library functions regarding standard input\/output.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">conio.h\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">It is a console input\/output header file.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">string.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Contains all string related functions like gets(), puts() etc.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">stdlib.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Contains all the general library functions like malloc(), calloc(), exit() etc.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">math.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Contains all math operations related functions like sqrt(), pow() etc.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">time.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Contains all time related functions.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">ctype.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Contains all character handling functions.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">signal.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Contains all signal handling functions.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">setjmp.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Contains all jump functions.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">locale.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Contains locale functions.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">errno.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Contains error handling functions.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">assert.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Contains diagnostics functions.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">stdarg.h<\/span><\/td>\n<td><span style=\"font-weight: 400\">Contains variable argument functions.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Important points about functions in C<\/h4>\n<ul>\n<li>There has to be a function called main() in every C program.<\/li>\n<li>Every C function may or may not return value. If it does not return any value, then the void keyword is used.<\/li>\n<li>C function can return any type of data except arrays and functions.<\/li>\n<li>In C, a function is called before its declaration. After that the compiler automatically knows that the declaration of function is as:- <strong>int functionName();.<\/strong><\/li>\n<\/ul>\n<h3>Main Function in C<\/h3>\n<p>This function is a special one. Every C program must contain a main() function. main() function is the entry point of C programs.<\/p>\n<h4>Types of C main function:-<\/h4>\n<p><strong>1. main function without parameters:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int main()\n{\n   \/\/ body\n   return 0;\n}\n<\/pre>\n<p><strong>2. main function with parameters:-<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int main(int argc, char * const argv[])\n{\n   \/\/ body\n   return 0;\n}\n<\/pre>\n<h3>Summary<\/h3>\n<p>There are two types of functions present in C such as Library Functions and User-Defined functions. In C, there are various standard library functions available. Also, you can declare your own function. To make use of these library functions, we have to include these header files at the start of our code. To make use of the function, you will have to call it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In every programming language, functions are one of the key features available to the programmer. The C programming language also has a bunch of built-in functions. Apart from the built-in functions, we can also&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":81681,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3510],"tags":[3660,3661,3662,3663,3664,3665],"class_list":["post-81460","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-programming","tag-c-library-functions","tag-defining-function-in-c","tag-function-calling-in-c","tag-functions-in-c","tag-main-function-in-c","tag-types-of-functions-in-c"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Functions in C - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn what are functions in C and two types of functions present in C such as Library Functions and User-Defined functions with examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Functions in C - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn what are functions in C and two types of functions present in C such as Library Functions and User-Defined functions with examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-02T03:30:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Functions-in-C-or-C.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Functions in C - TechVidvan","description":"Learn what are functions in C and two types of functions present in C such as Library Functions and User-Defined functions with examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/","og_locale":"en_US","og_type":"article","og_title":"Functions in C - TechVidvan","og_description":"Learn what are functions in C and two types of functions present in C such as Library Functions and User-Defined functions with examples.","og_url":"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2021-07-02T03:30:17+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Functions-in-C-or-C.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Functions in C","datePublished":"2021-07-02T03:30:17+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/"},"wordCount":1475,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Functions-in-C-or-C.jpg","keywords":["C Library Functions","Defining Function in C","Function Calling in C","Functions in C","Main Function in C","Types of Functions in C"],"articleSection":["C Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/functions-in-c\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/","url":"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/","name":"Functions in C - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Functions-in-C-or-C.jpg","datePublished":"2021-07-02T03:30:17+00:00","description":"Learn what are functions in C and two types of functions present in C such as Library Functions and User-Defined functions with examples.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/functions-in-c\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Functions-in-C-or-C.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Functions-in-C-or-C.jpg","width":1200,"height":628,"caption":"Functions in C"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/functions-in-c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Functions in C"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/81460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=81460"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/81460\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/81681"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=81460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=81460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=81460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}