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

React Js interview questions

 

What is Increament or decrement operator?

They are (++) increment operator in c. (--)decrement operator in c. These two operators are called unary operator as they require only one operand.The operand should be a variable not a constant. * (++) operator :- Add one to the value of operand. *(--) operator :- substract one to the value of operand. # These operators are used in two form 1 pastfix form 2 prefix form          

Math notes

Supremum   math Logical math Recurrence Relation