SlideShare una empresa de Scribd logo
1 de 4
C ProgrammingLanguage WorkingwithFunctions1
Agenda:
What is a Functions?
A function is a named, independent section of C code that performs a specific task and optionally returns a value
to the callingprogram
A function is named. Each function has a unique name. By usingthat name in another partof the program, you
can execute the statements contained in the function.This is known as callingthefunction. A function can be
called fromwithin another function.
A function is independent. A function can perform its task without interference from or interferingwith other
parts of the program.
A function performs a specific task. This is the easy partof the definition.A task is a discretejob that your
program must perform as partof its overall operation,such as sendinga lineof text to a printer, sortingan array
into numerical order,or calculatinga cuberoot.
function can return a value to the calling program. When your program callsa function,the statements it
contains areexecuted. If you want them to, these statements can pass information back to the callingprogram.
Benefits of the functions
program
Function Terminology
Function prototype: A function's prototype contains the name of the function,return type, a lis tof variables that
must be passed to it, and the type of variableitreturns, if any..
Function Definition: The function itself is called the function definition.The definition contains the code that will
be executed.
C ProgrammingLanguage WorkingwithFunctions2
Function header: The function header is atthe startof a function,and itgives the function's name. The header
also gives the function's return type and describes its arguments.Note that the function header is identical to the
function prototype (minus the semicolon).
Function Body: The statements written within function arecalled function body. Statements are enclosed in
braces.These statements are executed when the function is called.
Arguments: When a function is called,the program can send the function information in the form of one or more
arguments. An argument is programdata needed by the function to perform its task.Arguments are enclosed in
parentheses followingthe function's name.
Return statement: If the function return type is anythingother than void, a return statement should be included,
returning a valuematching the return type.
/* Demonstrates a simple function */
#include<stdio.h>
longcube(long x);
longinput, answer;
main()
{
printf("Enter an integer value: ");
scanf("%d", &input);
answer = cube(input); /*here input is actual argument.
/* Note: %ld is the conversion specifier for */
/* a long integer */
printf("nThe cube of %ld is %ld.n", input, answer);
return 0;
}
/* Function: cube() - Calculates thecubed valueof a variable*/
longcube(long x) /*here x is formal argument*/
{
longx_cubed;
x_cubed = x * x * x;
return x_cubed;
}
How does a Function Works
program.
C ProgrammingLanguage WorkingwithFunctions3
m of one or more arguments.
An argument is programdata needed by the function to perform its task.The statements in the function then
execute, performing whatever task each was designed to do.
sses back to the same location in the program that
called the function. Functions can send information back to the program in the form of a return value.
xecution passes
back to the placefrom which the function was called.A function can be called as many times as needed, and
functions can be called in any order.
#include<stdio.h>
void printline(char ch,intn);
int add(inta,intb,int c);
main()
{
int result;
printline('#',70);
result=add(10,3,4);
printf("n resultis %d",result);
getch();
return 0;
}
void printline(char ch,intn)
{
int i;
for(i=0;i<n;i++)
printf("%c",ch);
}
int add(inta,intb,int c)
{ C ProgrammingLanguage WorkingwithFunctions4
return a+b+c;
} /* Program to check the given value is vowel */
#include<stdio.h>
void main()
{
char ch;
printf("nEnter any character …');
ch=getch();
if(checkvowel(ch)==1)
printf("n It is a vowel");
else
printf("n try again");
}
int checkvowel(char ch)
{
if(ch=='a'||ch=='c'||ch=='i'||ch=='o'||ch=='u'||ch='A'||ch=='E'||ch=='I'||ch=='O'||ch=='U')
return (1);
else
return (0);
}

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

User defined functions
User defined functionsUser defined functions
User defined functions
 
user defined function
user defined functionuser defined function
user defined function
 
User defined functions in C
User defined functions in CUser defined functions in C
User defined functions in C
 
Functionincprogram
FunctionincprogramFunctionincprogram
Functionincprogram
 
Functions
FunctionsFunctions
Functions
 
Function & Recursion
Function & RecursionFunction & Recursion
Function & Recursion
 
Function
FunctionFunction
Function
 
Pointers and call by value, reference, address in C
Pointers and call by value, reference, address in CPointers and call by value, reference, address in C
Pointers and call by value, reference, address in C
 
Function
FunctionFunction
Function
 
User Defined Functions
User Defined FunctionsUser Defined Functions
User Defined Functions
 
Function Parameters
Function ParametersFunction Parameters
Function Parameters
 
Functions
FunctionsFunctions
Functions
 
Scope of variables
Scope of variablesScope of variables
Scope of variables
 
Modular Programming in C
Modular Programming in CModular Programming in C
Modular Programming in C
 
Method parameters in c#
Method parameters in c#Method parameters in c#
Method parameters in c#
 
Functions in c++
Functions in c++Functions in c++
Functions in c++
 
Function in c++
Function in c++Function in c++
Function in c++
 
Basic information of function in cpu
Basic information of function in cpuBasic information of function in cpu
Basic information of function in cpu
 
C language for Semester Exams for Engineers
C language for Semester Exams for Engineers C language for Semester Exams for Engineers
C language for Semester Exams for Engineers
 
Function
FunctionFunction
Function
 

Destacado

South Florida Real Estate 2017 Outlook Survey
South Florida Real Estate 2017 Outlook SurveySouth Florida Real Estate 2017 Outlook Survey
South Florida Real Estate 2017 Outlook Surveycutmytaxes
 
A non residents guide to buying property in florida
A non residents guide to buying property in  floridaA non residents guide to buying property in  florida
A non residents guide to buying property in floridaJames Lavigne
 
Make It Happen Homes Listing Presentation for North Texas Real Estate
Make It Happen Homes Listing Presentation for North Texas Real EstateMake It Happen Homes Listing Presentation for North Texas Real Estate
Make It Happen Homes Listing Presentation for North Texas Real EstateMary Lou Jaimes
 
Listing Presentation
Listing PresentationListing Presentation
Listing PresentationLenneaA
 
Realty Elite | Listing Presentation
Realty Elite  |  Listing PresentationRealty Elite  |  Listing Presentation
Realty Elite | Listing PresentationRealty Elite
 
Luxury Real Estate Listing Presentation
Luxury Real Estate Listing PresentationLuxury Real Estate Listing Presentation
Luxury Real Estate Listing PresentationGary Grimes
 
25 Real Estate Marketing Ideas The Pro's Use
25 Real Estate Marketing Ideas The Pro's Use25 Real Estate Marketing Ideas The Pro's Use
25 Real Estate Marketing Ideas The Pro's UseFit Small Business
 
Listing presentation Dawn Bahr
Listing presentation Dawn BahrListing presentation Dawn Bahr
Listing presentation Dawn BahrDawn Bahr
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017Drift
 

Destacado (11)

South Florida Real Estate 2017 Outlook Survey
South Florida Real Estate 2017 Outlook SurveySouth Florida Real Estate 2017 Outlook Survey
South Florida Real Estate 2017 Outlook Survey
 
A non residents guide to buying property in florida
A non residents guide to buying property in  floridaA non residents guide to buying property in  florida
A non residents guide to buying property in florida
 
Make It Happen Homes Listing Presentation for North Texas Real Estate
Make It Happen Homes Listing Presentation for North Texas Real EstateMake It Happen Homes Listing Presentation for North Texas Real Estate
Make It Happen Homes Listing Presentation for North Texas Real Estate
 
La Jolla Agent Listing Presentation
La Jolla Agent Listing PresentationLa Jolla Agent Listing Presentation
La Jolla Agent Listing Presentation
 
Listing Presentation
Listing PresentationListing Presentation
Listing Presentation
 
Real Estate Listing Presentation
Real Estate Listing PresentationReal Estate Listing Presentation
Real Estate Listing Presentation
 
Realty Elite | Listing Presentation
Realty Elite  |  Listing PresentationRealty Elite  |  Listing Presentation
Realty Elite | Listing Presentation
 
Luxury Real Estate Listing Presentation
Luxury Real Estate Listing PresentationLuxury Real Estate Listing Presentation
Luxury Real Estate Listing Presentation
 
25 Real Estate Marketing Ideas The Pro's Use
25 Real Estate Marketing Ideas The Pro's Use25 Real Estate Marketing Ideas The Pro's Use
25 Real Estate Marketing Ideas The Pro's Use
 
Listing presentation Dawn Bahr
Listing presentation Dawn BahrListing presentation Dawn Bahr
Listing presentation Dawn Bahr
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
 

Similar a C programming language working with functions 1

Similar a C programming language working with functions 1 (20)

CH.4FUNCTIONS IN C_FYBSC(CS).pptx
CH.4FUNCTIONS IN C_FYBSC(CS).pptxCH.4FUNCTIONS IN C_FYBSC(CS).pptx
CH.4FUNCTIONS IN C_FYBSC(CS).pptx
 
Functions
Functions Functions
Functions
 
cp Module4(1)
cp Module4(1)cp Module4(1)
cp Module4(1)
 
unit3 part2 pcds function notes.pdf
unit3 part2 pcds function notes.pdfunit3 part2 pcds function notes.pdf
unit3 part2 pcds function notes.pdf
 
Ch4 functions
Ch4 functionsCh4 functions
Ch4 functions
 
Function in c
Function in cFunction in c
Function in c
 
User defined function in C.pptx
User defined function in C.pptxUser defined function in C.pptx
User defined function in C.pptx
 
Functions
FunctionsFunctions
Functions
 
FUNCTIONS IN C PROGRAMMING.pdf
FUNCTIONS IN C PROGRAMMING.pdfFUNCTIONS IN C PROGRAMMING.pdf
FUNCTIONS IN C PROGRAMMING.pdf
 
C function
C functionC function
C function
 
Unit-III.pptx
Unit-III.pptxUnit-III.pptx
Unit-III.pptx
 
Lecture 11 - Functions
Lecture 11 - FunctionsLecture 11 - Functions
Lecture 11 - Functions
 
Chapter_1.__Functions_in_C++[1].pdf
Chapter_1.__Functions_in_C++[1].pdfChapter_1.__Functions_in_C++[1].pdf
Chapter_1.__Functions_in_C++[1].pdf
 
Chapter 1. Functions in C++.pdf
Chapter 1.  Functions in C++.pdfChapter 1.  Functions in C++.pdf
Chapter 1. Functions in C++.pdf
 
Chapter 13.1.6
Chapter 13.1.6Chapter 13.1.6
Chapter 13.1.6
 
Function in c
Function in cFunction in c
Function in c
 
Function C programming
Function C programmingFunction C programming
Function C programming
 
[ITP - Lecture 12] Functions in C/C++
[ITP - Lecture 12] Functions in C/C++[ITP - Lecture 12] Functions in C/C++
[ITP - Lecture 12] Functions in C/C++
 
Functions assignment
Functions assignmentFunctions assignment
Functions assignment
 
Module 3-Functions
Module 3-FunctionsModule 3-Functions
Module 3-Functions
 

Último

办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一A SSS
 
美国SU学位证,雪城大学毕业证书1:1制作
美国SU学位证,雪城大学毕业证书1:1制作美国SU学位证,雪城大学毕业证书1:1制作
美国SU学位证,雪城大学毕业证书1:1制作ss846v0c
 
Digital Marketing Training Institute in Mohali, India
Digital Marketing Training Institute in Mohali, IndiaDigital Marketing Training Institute in Mohali, India
Digital Marketing Training Institute in Mohali, IndiaDigital Discovery Institute
 
Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713Riya Pathan
 
Protection of Children in context of IHL and Counter Terrorism
Protection of Children in context of IHL and  Counter TerrorismProtection of Children in context of IHL and  Counter Terrorism
Protection of Children in context of IHL and Counter TerrorismNilendra Kumar
 
Nathan_Baughman_Resume_copywriter_and_editor
Nathan_Baughman_Resume_copywriter_and_editorNathan_Baughman_Resume_copywriter_and_editor
Nathan_Baughman_Resume_copywriter_and_editorNathanBaughman3
 
AI ppt introduction , advandtage pros and cons.pptx
AI ppt introduction , advandtage pros and cons.pptxAI ppt introduction , advandtage pros and cons.pptx
AI ppt introduction , advandtage pros and cons.pptxdeepakkrlkr2002
 
ME 205- Chapter 6 - Pure Bending of Beams.pdf
ME 205- Chapter 6 - Pure Bending of Beams.pdfME 205- Chapter 6 - Pure Bending of Beams.pdf
ME 205- Chapter 6 - Pure Bending of Beams.pdfaae4149584
 
定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一
定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一
定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一lvtagr7
 
Ioannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfIoannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfjtzach
 
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewCrack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewNilendra Kumar
 
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一A SSS
 
LinkedIn for Your Job Search in April 2024
LinkedIn for Your Job Search in April 2024LinkedIn for Your Job Search in April 2024
LinkedIn for Your Job Search in April 2024Bruce Bennett
 
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一Fs
 
8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCR8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCRdollysharma2066
 
Escorts Service Near Surya International Hotel, New Delhi |9873777170| Find H...
Escorts Service Near Surya International Hotel, New Delhi |9873777170| Find H...Escorts Service Near Surya International Hotel, New Delhi |9873777170| Find H...
Escorts Service Near Surya International Hotel, New Delhi |9873777170| Find H...nitagrag2
 
Human Rights are notes and helping material
Human Rights are notes and helping materialHuman Rights are notes and helping material
Human Rights are notes and helping materialnadeemcollege26
 
定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一Fs sss
 
Introduction to phyton , important topic
Introduction to phyton , important topicIntroduction to phyton , important topic
Introduction to phyton , important topicakpgenious67
 

Último (20)

办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
办理学位证(UoM证书)北安普顿大学毕业证成绩单原版一比一
 
美国SU学位证,雪城大学毕业证书1:1制作
美国SU学位证,雪城大学毕业证书1:1制作美国SU学位证,雪城大学毕业证书1:1制作
美国SU学位证,雪城大学毕业证书1:1制作
 
Digital Marketing Training Institute in Mohali, India
Digital Marketing Training Institute in Mohali, IndiaDigital Marketing Training Institute in Mohali, India
Digital Marketing Training Institute in Mohali, India
 
Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713
 
Protection of Children in context of IHL and Counter Terrorism
Protection of Children in context of IHL and  Counter TerrorismProtection of Children in context of IHL and  Counter Terrorism
Protection of Children in context of IHL and Counter Terrorism
 
Nathan_Baughman_Resume_copywriter_and_editor
Nathan_Baughman_Resume_copywriter_and_editorNathan_Baughman_Resume_copywriter_and_editor
Nathan_Baughman_Resume_copywriter_and_editor
 
AI ppt introduction , advandtage pros and cons.pptx
AI ppt introduction , advandtage pros and cons.pptxAI ppt introduction , advandtage pros and cons.pptx
AI ppt introduction , advandtage pros and cons.pptx
 
ME 205- Chapter 6 - Pure Bending of Beams.pdf
ME 205- Chapter 6 - Pure Bending of Beams.pdfME 205- Chapter 6 - Pure Bending of Beams.pdf
ME 205- Chapter 6 - Pure Bending of Beams.pdf
 
定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一
定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一
定制(UQ毕业证书)澳洲昆士兰大学毕业证成绩单原版一比一
 
Ioannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfIoannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdf
 
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewCrack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
 
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
办理学位证(Massey证书)新西兰梅西大学毕业证成绩单原版一比一
 
LinkedIn for Your Job Search in April 2024
LinkedIn for Your Job Search in April 2024LinkedIn for Your Job Search in April 2024
LinkedIn for Your Job Search in April 2024
 
Students with Oppositional Defiant Disorder
Students with Oppositional Defiant DisorderStudents with Oppositional Defiant Disorder
Students with Oppositional Defiant Disorder
 
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
 
8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCR8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Pitampura Delhi NCR
 
Escorts Service Near Surya International Hotel, New Delhi |9873777170| Find H...
Escorts Service Near Surya International Hotel, New Delhi |9873777170| Find H...Escorts Service Near Surya International Hotel, New Delhi |9873777170| Find H...
Escorts Service Near Surya International Hotel, New Delhi |9873777170| Find H...
 
Human Rights are notes and helping material
Human Rights are notes and helping materialHuman Rights are notes and helping material
Human Rights are notes and helping material
 
定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
 
Introduction to phyton , important topic
Introduction to phyton , important topicIntroduction to phyton , important topic
Introduction to phyton , important topic
 

C programming language working with functions 1

  • 1. C ProgrammingLanguage WorkingwithFunctions1 Agenda: What is a Functions? A function is a named, independent section of C code that performs a specific task and optionally returns a value to the callingprogram A function is named. Each function has a unique name. By usingthat name in another partof the program, you can execute the statements contained in the function.This is known as callingthefunction. A function can be called fromwithin another function. A function is independent. A function can perform its task without interference from or interferingwith other parts of the program. A function performs a specific task. This is the easy partof the definition.A task is a discretejob that your program must perform as partof its overall operation,such as sendinga lineof text to a printer, sortingan array into numerical order,or calculatinga cuberoot. function can return a value to the calling program. When your program callsa function,the statements it contains areexecuted. If you want them to, these statements can pass information back to the callingprogram. Benefits of the functions program Function Terminology Function prototype: A function's prototype contains the name of the function,return type, a lis tof variables that must be passed to it, and the type of variableitreturns, if any.. Function Definition: The function itself is called the function definition.The definition contains the code that will be executed. C ProgrammingLanguage WorkingwithFunctions2
  • 2. Function header: The function header is atthe startof a function,and itgives the function's name. The header also gives the function's return type and describes its arguments.Note that the function header is identical to the function prototype (minus the semicolon). Function Body: The statements written within function arecalled function body. Statements are enclosed in braces.These statements are executed when the function is called. Arguments: When a function is called,the program can send the function information in the form of one or more arguments. An argument is programdata needed by the function to perform its task.Arguments are enclosed in parentheses followingthe function's name. Return statement: If the function return type is anythingother than void, a return statement should be included, returning a valuematching the return type. /* Demonstrates a simple function */ #include<stdio.h> longcube(long x); longinput, answer; main() { printf("Enter an integer value: "); scanf("%d", &input); answer = cube(input); /*here input is actual argument. /* Note: %ld is the conversion specifier for */ /* a long integer */ printf("nThe cube of %ld is %ld.n", input, answer); return 0; } /* Function: cube() - Calculates thecubed valueof a variable*/ longcube(long x) /*here x is formal argument*/ { longx_cubed; x_cubed = x * x * x; return x_cubed; } How does a Function Works program. C ProgrammingLanguage WorkingwithFunctions3
  • 3. m of one or more arguments. An argument is programdata needed by the function to perform its task.The statements in the function then execute, performing whatever task each was designed to do. sses back to the same location in the program that called the function. Functions can send information back to the program in the form of a return value. xecution passes back to the placefrom which the function was called.A function can be called as many times as needed, and functions can be called in any order. #include<stdio.h> void printline(char ch,intn); int add(inta,intb,int c); main() { int result; printline('#',70); result=add(10,3,4); printf("n resultis %d",result); getch(); return 0; } void printline(char ch,intn) { int i; for(i=0;i<n;i++) printf("%c",ch); } int add(inta,intb,int c) { C ProgrammingLanguage WorkingwithFunctions4
  • 4. return a+b+c; } /* Program to check the given value is vowel */ #include<stdio.h> void main() { char ch; printf("nEnter any character …'); ch=getch(); if(checkvowel(ch)==1) printf("n It is a vowel"); else printf("n try again"); } int checkvowel(char ch) { if(ch=='a'||ch=='c'||ch=='i'||ch=='o'||ch=='u'||ch='A'||ch=='E'||ch=='I'||ch=='O'||ch=='U') return (1); else return (0); }