Program to add two integer numbers

 #include <stdio.h>

int main() {

  int num1, num2, sum;

  printf("Enter two integers: ");
  //Storing user input into variable num1 & num2
  scanf("%d %d", &num1, &num2);

  // Adding two input numbers
  sum = num1 + num2;

  printf("Sum of %d and %d is: %d", num1, num2, sum);
  return 0;
}

Output: User enters the numbers 25 and 35 and program prints sum of these two numbers 60 as an output.

Comments

Popular posts from this blog

Program to find the average of two numbers