Function programs (1)
Function programs (1)
#include<conio.h>
int c;
c = x + y;
return c;
void main()
int a = 3, b = 2;
return 0;
getch();
int main()
{
// function call
printf("Sum of x and y is %d", sum());
getch();
}
4) Function With Arguments and No Return Value
#include <stdio.h>
#include<conio.h>
void sum (int x, int y)
{
printf("Sum of %d and %d is: %d", x, y, x + y);
}
void main()
{
int x, y;
printf("Enter x and y\n");
scanf("%d %d", &x, &y);
// function call
sum (x, y);
getch();
}