Untitled
#include <stdio.h> // Function to add two numbers int sum(int a, int b) { return a + b; } int main() { int num1, num2, result; // Input two numbers printf("Enter first number: "); scanf("%d", &num1); printf("Enter second number: "); scanf("%d", &num2); // Call the sum function result = sum(num1, num2); // Print the result printf("The sum is: %d\n", result); return 0; }
Leave a Comment