Function with no arguments and with return value (Non-void function without parameters/Upward communication)

Function with no arguments and with return value

(Non-void function without parameters/Upward communication) 

#include<stdio.h>
int add();
void main()
{
int c;
c=add();
printf(“Sum is =%d”,c);
}
int add()
{
int a,b,c;
printf(“Enter two integers\n”);
scanf(“%d%d”,&a,&b);
c=a+b;
return(c);
}

Comments