C program to add two numbers using function
Posted by Spider on 7:31 AM
#include<stdio.h> long addition(long, long); main() { long first, second, sum;
printf("Enter two numbers : \n");
scanf("%ld%ld", &first, &second);
sum = addition(first, second);
printf("\n Sum is : %ld\n", sum);
return 0;
}
long addition(long a, long b)
{
long result;
result = a + b;
return result;
}
/*
Output :
Enter two numbers :53Sum is : 8*/
Tags
C Basics