Sum of two values in C
###### Posted by Samath
Last Updated: November 09, 2014

Write a C program that reads two integer values from the keyboard via the scanf  function, then adds them together, stores the result into a variable called sum, and then prints out the value of the variable sum.

Code:

```#include <stdio.h>
int main(int argc, char *argv[])
{
int num1;
int num2;
int sum;

scanf("%d",&num1);

scanf("%d",&num2);

sum = num1 + num2;

printf("\nResult: %d",sum);

return 0;
}
```
###### C Program to find sum of two numbers
Samath | Jan 02, 2017
###### C++ Calculate the sum from 1 to 100
Samath | Jan 05, 2017
###### Write a C++ program that find the sum of all even numbers between 1 and 30 excluding 6, 8, 24 and 28
Samath | Nov 02, 2014
###### Sum of the first 30 squares in C
Samath | Dec 21, 2014
###### Java program that uses a loop to compute the sum of all odd digits of an input. (For example, if the input is 32677, the sum would be 3 + 7 + 7 = 17.)
Samath | Apr 03, 2022
###### Recursive function that find the sum of digits in a integer using C++
Samath | Dec 24, 2014
###### C Program to calculate sum of 5 subjects, calculate percentage and grade
Samath | Jan 02, 2017
###### C program to find sum of elements of the array
Samath | Jan 02, 2017
###### Java program that prints the sum of the first ten positive integers
Samath | Jan 08, 2021
###### Java program that uses a loop to compute the sum of all even numbers between 2 and 100 (inclusive)
Samath | Apr 03, 2022
###### C program that prompts the user for a positive integer and then computes the sum of all the digits of the number
Samath | May 04, 2016
###### C Program to Compute sum of the array elements using pointers
Samath | Jan 02, 2017
###### Java program that uses a loop to compute the sum of all squares between 1 and 100 (inclusive)
Samath | Apr 03, 2022
###### Java program that uses a loop to compute the sum of all even numbers between a and b (inclusive), where a and b are inputs
Samath | Apr 03, 2022