Skip to main content

4.) With argument and With return

In this type of function arguments and parameters must be passed to any function and function return a single value.The type of function depends up on the return value.
syntax:-
datatype of function name(datatype arg 1,datatype arg2)
{
statement;
...........
...........
return(exp);
}
                 
ex:-main()
{
int fact(int);
printf("\n factorial =%d",fact(5));
getch();
}
int fact(int n)
{
int f=1;
while(n>1)
{
f=f*n;
n--;
}
return(f);
}

Comments

Popular posts from this blog

Math notes

Supremum   math Logical math Recurrence Relation  

What is sequential flow chart?

These types of flow chart indicates that the flow of control normally passes from one instructions to the next in a sequence with in a programme. Example :- design a flow chart to calculate addition of two number                          

React Js interview questions