With Arguments and No Return Values Function

This “With Arguments and No Return Values Function” page providing clearly how to define a function in C programming which is taking input but not giving output.


With arguments and No return values function :

  • The function is taking input(arguments) but not return the values.
  • Return value must be specified by using “void” data type.
  • In this program, add() represents above classification.
  • In the declaration of prototype, no need to specify name of variables.


void add(int,int);
void main(void)
int a,b;
printf(“Enter two numbers\n”);
void add(int a, int b)
int c;
printf(“sum : %d\n”,c);


  • Arguments of a function working like local variables.
  • Local variables get memory allocation inside the Function Frame.
  • Once Function execution has been completed, Frame will by deleted.
  • All the local variables get destroyed along with Function Frame.


Program to check input number is Even or not:
void isEven(int);
void main(void)
int n;
printf(“Enter n value : \n”);
void isEven(int x)
printf(“%d is Even \n”);
printf(“%d is not Even \n”);

Share this