C Program for function with argument and no return value


In this program, You will learn how to create a function with argument and no return value in C.


void sum(int x, int y) { }


Example: How to create a function with argument and no return value in C

Run it Now
#include<stdio.h>

void sum(int x, int y) {
    int z;

    z = x + y;
   printf("\nSum is : %d",z);
}

int main() {

   int x, y, s;

   printf("Enter two numbers : ");
   scanf("%d%d", &x, &y);

   sum(x, y);

   return 0;
}

Output:

Enter two numbers : 13 10
Sum is : 23