C programming provides a straightforward approach to adding two numbers. This involves declaring variables to store the numbers, taking user input for the numbers, and performing the addition operation using the ‘+’ operator. Finally, the result is displayed to the user.
![c program for addition](https://gangforcode.com/wp-content/uploads/2023/11/c-program-to-add-two-numbers-jpg.webp)
C Program to Add Two Number
The following C code perform addition of two number and displays the result
#include <stdio.h>
void main()
{
int num1, num2, sum;
printf("Enter the first number: ");
scanf("%d", &num1);
printf("Enter the second number: ");
scanf("%d", &num2);
sum = num1 + num2;
printf("%d + %d = %d\n", num1, num2, sum);
}
Output
![c program to add two numbers](https://gangforcode.com/wp-content/uploads/2023/11/image-15-1024x201.png)