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 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.
3 thoughts on “C Program for Addition of Two Numbers”