1#include <stdio.h>
2int main() {
3
4 int number1, number2, sum;
5
6 printf("Enter two integers: ");
7 scanf("%d %d", &number1, &number2);
8
9 // calculating sum
10 sum = number1 + number2;
11
12 printf("%d + %d = %d", number1, number2, sum);
13 return 0;
14}
15
1/*Program for adding two numbers*/
2#include <stdio.h>
3int main(){
4 int a, b, sum; //declare the variables that will be used, a will store the first number, b second number and sum, the sum.
5 printf("Enter the first number: \n"); //Prompts user to enter the first number.
6 scanf("%d", &a);//Accepts input and saves it to variable a
7 printf("Enter the second number: \n");
8 scanf("%d", &b);
9 sum = a + b; //Formular to add the two numbers.
10 printf("Sum is %d", sum);
11}