Back to Home & C
//Program to find addition of two numbers using pass by value method
#include<stdio.h>
#include<conio.h>
int add(int,int);
void main()
{
clrscr();
int a,b,c;
printf("Enter two numbers\n");
scanf("%d%d",&a,&b);
c=add(a,b);
printf("addition=%d",c);
getch();
}
int add(int n,int m)
{
int s;
s=n+m;
return(s);
}
---------------------------------------------------------------
Output :
Enter two numbers
3
5
addition=8
=========================================================================
Back to Home & C
//Program to find addition of two numbers using pass by value method
#include<stdio.h>
#include<conio.h>
int add(int,int);
void main()
{
clrscr();
int a,b,c;
printf("Enter two numbers\n");
scanf("%d%d",&a,&b);
c=add(a,b);
printf("addition=%d",c);
getch();
}
int add(int n,int m)
{
int s;
s=n+m;
return(s);
}
---------------------------------------------------------------
Output :
Enter two numbers
3
5
addition=8
=========================================================================
Back to Home & C