Function Passing Arguments and Returning Value

0
6
digitalample eye

Write  a program to illustrate function passing arguments and returning value in c programming.

C program to demonstrate function passing arguments and returning value.

Write a program to add two numbers by using function passing arguments and returning value.

C Code

#include <stdio.h>
#include <conio.h>

int sum (int, int);

void main()
{
int a,b,c;
printf("enter two numbers :");
scanf("%d%d",&a,&b);
c = sum(a,b);
printf("n the sum of two numbers is : %d", c);
getch();
}
int sum(int s, int t){
int add;
add = s+t;
return (add);
}

Output

Function Passing Arguments and Returning Value

LEAVE A REPLY

Please enter your comment!
Please enter your name here