Adding numbers in c using function

Adding numbers in c using function
 
We have used long data type as it can handle large numbers.
#include<stdio.h>
long addition(long, long);
main()
{
   long first, second, sum;
   scanf(“%ld%ld”, &first, &second);
   sum = addition(first, second);
   printf(“%ldn“, sum);
   return 0;
}
long addition(long a, long b)
{
   long result;
   result = a + b;
   return result;
}
This entry was posted in C Programs. Bookmark the permalink.