Functions
Add Two Numbers Using a Function
Write a function that takes two integers and returns their sum.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Write a function that takes two integers and returns their sum.
#include <stdio.h>
int add(int a, int b) {
return a + b;
}
int main() {
int a, b;
scanf("%d %d", &a, &b);
printf("Sum = %d\n", add(a, b));
return 0;
}
4 6
Sum = 10