A program to explain FUNCTION WITHOUT ARGUMENTS and WITH RETURN VALUES
C Programming Language 077
- Write a program to explain FUNCTION WITHOUT ARGUMENTS and WITH RETURN VALUES
Program
#include <stdio.h>
int sum();
void main()
{
int c;
c = sum();
printf("Sum = %d", c);
printf("\n");
}
int sum()
{
int a, b;
printf("Enter two numbers: ");
scanf("%d %d", &a, &b);
return a + b;
}
Result
Enter two numbers: 4 5
Sum = 9
Last Updated on
Comments