Function with arguments & no return value in C
Notes:
Function with arguments and no return value in C Programming:
Function with arguments and without return value in C:
Function with parameters and without return value in C:
- How to create a function; which accepts parameters and does not return any value
Ex:
#include <stdio.h>
void square(int num);
void sum(int num1,int num2);
int main()
{
square(2);
square(3);
printf("\n");
sum(2,3);
sum(3,4);
return 0;
}
void square(int num)
{
printf("%d\n", num * num);
}
void sum(int num1,int num2)
{
printf("%d\n", num1 + num2);
}