🔹 How It Works:
✅ Takes two numbers as input using
scanf().✅ Adds them using
sum = num1 + num2;.✅ Prints the result using
printf().#includeint main() { int num1, num2, sum; // Taking input from the user printf("Enter first number: "); scanf("%d", &num1); printf("Enter second number: "); scanf("%d", &num2); // Calculating sum sum = num1 + num2; // Printing the result printf("Sum: %d\n", sum); return 0; }
Output:
Enter first number: 5
Enter second number: 7
The sum of 5 and 7 is: 12
Enter first number: 5
Enter second number: 7
The sum of 5 and 7 is: 12