{"id":5468,"date":"2022-02-27T10:14:53","date_gmt":"2022-02-27T10:14:53","guid":{"rendered":"https:\/\/erpconsultors.com\/?p=5468"},"modified":"2022-02-27T10:15:32","modified_gmt":"2022-02-27T10:15:32","slug":"create-and-use-function-in-c-language","status":"publish","type":"post","link":"https:\/\/erpconsultors.com\/create-and-use-function-in-c-language\/","title":{"rendered":"How to Create and Use FUNCTION in C Language"},"content":{"rendered":"\n

Create and Use FUNCTION in C Language:<\/h2>\n\n\n\n

(1) FUNCTION <\/strong>is a set of code that runs when it is called. In this blog, we will see how to create and called FUNCTION in C language.<\/p>\n\n\n\n

(2) Advantage of creating FUNCTION<\/strong> is that they are reused. Means defining the code once and using FUNCTION<\/strong> many times.<\/p>\n\n\n\n

(3) In C Language, there are Predefined functions such as MAIN(), PRINTF(), SCANF()<\/strong>.<\/p>\n\n\n\n

(4) Sample C language code and its output, as shown.<\/p>\n\n\n\n

\"Sample<\/figure><\/div>\n\n\n\n
#include <stdio.h>
#include <conio.h>
\/\/ Creation of new function
void\u00a0 myfirstfunction()
{
int x;
\u00a0\u00a0\u00a0 x = 2;
switch(x)
\u00a0\u00a0\u00a0 {
case 1:
printf(“LOW”);
break;
case 2:
printf(“Medium”);
break;
case 3:
printf(“High”);
break;
\u00a0\u00a0\u00a0 }
}
int main()
{
myfirstfunction(); \/\/call the function
getch();
return 0;
}<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

(3) After that go to the \u201cBuild\u201d menu and select the \u201cBuild\u201d option for publishing the code as shown.<\/p>\n\n\n\n

\"click<\/figure><\/div>\n\n\n\n

(4) After building the code, press the \u201cRun\u201d button, as shown.<\/p>\n\n\n\n

\"run<\/figure><\/div>\n\n\n\n

(5) After pressing the \u201crun\u201d button, the output screen is opened, as shown.<\/p>\n\n\n\n

\"Output<\/figure><\/div>\n\n\n\n
\n\n\n\n
Use of ASCII function in SQL<\/mark><\/a>
Use of CONCAT_WS Function in SQL<\/mark><\/a>
DATALENGTH (Transact-SQL)<\/mark><\/a>– Microsoft Docs
How to Create New Database in Microsoft SQL Server<\/mark><\/a><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"

Create and Use FUNCTION in C Language: (1) FUNCTION is a set of code that runs when it is called. In this blog, we will see how to create and called FUNCTION in C language. (2) Advantage of creating FUNCTION is that they are reused. Means defining the code once and using FUNCTION many times. (3) In C Language, there are Predefined functions such as MAIN(), PRINTF(), SCANF(). (4) Sample C language code and its output, as shown. #include <stdio.h>#include <conio.h>\/\/ Creation of new functionvoid\u00a0 myfirstfunction(){int x;\u00a0\u00a0\u00a0 x = 2;switch(x)\u00a0\u00a0\u00a0 {case 1:printf(“LOW”);break;case 2:printf(“Medium”);break;case 3:printf(“High”);break;\u00a0\u00a0\u00a0 }}int main(){myfirstfunction(); \/\/call the functiongetch();return 0;} <\/p>\n","protected":false},"author":1,"featured_media":5471,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[566],"tags":[643,641,640,642],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/erpconsultors.com\/wp-content\/uploads\/2022\/02\/Create-and-Use-FUNCTION-in-C-Language.jpg?fit=350%2C270&ssl=1","_links":{"self":[{"href":"https:\/\/erpconsultors.com\/wp-json\/wp\/v2\/posts\/5468"}],"collection":[{"href":"https:\/\/erpconsultors.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/erpconsultors.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/erpconsultors.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/erpconsultors.com\/wp-json\/wp\/v2\/comments?post=5468"}],"version-history":[{"count":0,"href":"https:\/\/erpconsultors.com\/wp-json\/wp\/v2\/posts\/5468\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/erpconsultors.com\/wp-json\/wp\/v2\/media\/5471"}],"wp:attachment":[{"href":"https:\/\/erpconsultors.com\/wp-json\/wp\/v2\/media?parent=5468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/erpconsultors.com\/wp-json\/wp\/v2\/categories?post=5468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/erpconsultors.com\/wp-json\/wp\/v2\/tags?post=5468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}