Skip to main content

3.) No argument and with return

In this type of function,parameter and argument are not passed to any f\unction and function must return a value.So the datatype of function depends up on the datatype of return value of the function.
syntax:-
datatype function name()
{
statement;
..........
................
return(exp);
}
             
* Ex:-
void main()
{
int x;
int sum();
x=sum();
printf("\n sum=%d",x);
getch();
}
int sum()
{
int a,b,c;
printf("\n enter two number");
scanf("%d%d",&a,&b);
c=a+b;
return(c);
}

Comments

Post a Comment

Popular posts from this blog

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

 

Math notes

Supremum   math Logical math Recurrence Relation