Function with arguments and with return value (Non-void function with parameters/Up-down communication)
Function with arguments and with return value
(Non-void function with parameters/Up-down communication)
#include<stdio.h>
int add(int a, int b);
void main()
{
int a, b, c;
printf(“Enter two integers\n”);
scanf(“%d%d”,&a,&b);
c=add(a, b);
printf(“Sum is =%d”,c);
}
int add(int a, int b)
{
int c;
c=a+b;
return(c);
}
Comments
Post a Comment