Hello friends!!!!!

Sum of two numbers in C

Fuction without Argument value and with return value

C LANGUAGE

9/27/20241 min read

#include <stdio.h>

int sum();

int main() {

int r;

printf("We are going to calculate the sum n");

r = sum();

printf("result is %d", r);

}

int sum() {

int a,b;

printf("Enter two numbers : ");

scanf("%d%d", &a, &b);

return a+b;

}

Output :

We are going to calculate the sum

Enter two numbers : 2 5

result is 7

=== Code Execution Successful ===