TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
User defined Function In C
Ashish Srivastava
Apr 21
2016
Code
563
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
#include <stdio.h>
#include <conio.h>
int
add(
int
a,
int
b);
//function prototype(declaration)
void
main()
{
int
num1,num2,sum;
printf(
"Enters two number to add\n"
);
scanf(
"%d %d"
,&num1,&num2);
sum=add(num1,num2);
//function call
printf(
"sum=%d"
,sum);
getch();
}
int
add(
int
a,
int
b)
//function declarator
{
/* Start of function definition. */
int
add;
add=a+b;
return
add;
//return statement of function
/* End of function definition. */
}
C
User defined function