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#include <stdio.h>
2int main() {
3 int sum_tot = 0;
4 int num_1, num_2;
5 printf("Please, Enter First integer: ");
6 scanf("%d", &num_1);
7 printf("\nNow Please, Enter Second integer: ");
8 scanf("%d", &num_2);
9
10 sum_tot = num_1 + num_2;
11
12 printf("\n%d + %d = %d", num_1, num_2, sum_tot);
13 return 0;
14}
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}