C Program to find sum of two numbers using functions without returning the value
Program
#include<stdio.h>
void add(int a, int b)
{
int sum = 0;
sum = a + b;
printf("Sum of %d and %d is %d\n", a, b, sum);
}
void main()
{
int a, b;
printf("Enter two numbers: a and b\n");
scanf("%d %d", &a, &b);
add(a, b);
}
Output
Enter two numbers: a and b
23
6
Sum of 23 and 6 is 29