Skip to main content

2.) With argument and No return

In this type of function argument and parameter must be specified and function doesn't return any value so the datatype of function must be "void"
syntax:-
void function name(datatype arg 1,datatype arg 2)
{
statement;
.........
..........
}
example:-write  a program to input 3 number and calculate sum using function with argument and no return.
         
Ex:-
void main()
{
int a,b,c;
void sum(int,int,int);
printf("\n enter three number");
scanf("%d%d%d",&a,&b,&c);
sum(a,b,c);
getch();
}
void sum(int x,int y,int z)
{
int add;
add=x+y+z;
printf("\n sum of three number=%d",add);
}

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