Functions in C
##########
FUNCTION
#########
what is function
1 Function is piece of code to accomplish any certain opration
2 it has a name for identification
3 Function are two types
. pre defined functions [ exapmle= clrscr(); ]
. user defined function [ example= made by user like you can see in source code ]
TERMS OF FUNCTION.
. Function defenation ( funcation defenation are 4 types)
1. takes nothing returns nothing
2. takes something returns nothing
3. takes nothing returns something
4. takes something returns something
. function declaration ( function prototype ) you can read from source code.
. function call
--------------------------------
function run screen
--------------------------------
****************
Source Code
*****************
#include<stdio.h>
#include<conio.h>
void add(void); // function declaration or prototype //
void main()
{
clrscr();
add(); // function call //
getch();
}
void add() // function defenation //
{
int a,b,c;
printf("enter two number= ");
scanf("%d %d",&a,&b);
c=a+b;
printf("sum is [ %d ]",c);
}
#######################
All rights goes to $[UB codes]$
#######################
<--------------------------------------------->