Addition is one of the basic operation in the world of computer programming. In This article we are going to see a c program for addition of two numbers.
![c code for addition](https://gangforcode.com/wp-content/uploads/2023/11/C-Program-for-Addition-of-Two-Numbers.jpg)
C Program for Addition of Two Numbers
#include <stdio.h>
void main(){
int a, b;
printf("enter the first numbner");
scanf("%d", &a);
printf("enter the 2nd number");
scanf("%d", &b);
printf("%d + %d = %d", a, b, a + b);
}
In the C program above, we first declare two variables named a and b. After that, we ask the user to enter two numbers. Finally, we print the sum of the two given numbers.
Output
![C Program for Addition of Two Numbers](https://gangforcode.com/wp-content/uploads/2023/11/image-3-1024x132.png)
3 thoughts on “C Program for Addition of Two Numbers”