Addition of two numbers in C using functions?

All QuestionsCategory: C LanguageAddition of two numbers in C using functions?
Chetan Shidling Staff asked 4 years ago

I need short information.

1 Answers
Chetan Shidling Staff answered 4 years ago
#include<stdio.h>

int main() {
int num1, num2, res;

printf("\nEnter the two numbers : ");
scanf("%d %d", &num1, &num2);

//Call Function
res = sum(num1, num2);

printf("Addition of two number is : %d ",res);
return (0);
}

int sum(int num1, int num2) {
int num3;
num3 = num1 + num2;
return (num3);
}