Given two numbers A and B. The task is to write a program to find the addition of these two numbers.
Input: A = 2, B = 3 Output: 5 Input: A = 3, B = 6 Output: 9
In the below program to add two numbers, the user is first asked to enter two numbers and the input is scanned using the scanf() function and stored in the variables and . Then, the variables and are added using the arithmetic operator and the result is stored in the variable sum.
Below is the C program to add two numbers:
Enter two numbers A and B : 2 3 Sum of A and B is: 5
- Recursive program to print formula for GCD of n integers
- Program to print N minimum elements from list of integers
- Even-odd turn game with two integers
- Sum of integers upto N with given unit digit
- Longest Subarray of non-negative Integers
- Check if a number can be written as sum of three consecutive integers
- C Program for Program to find area of a circle
- C Program for Program for array rotation
- How does a C program executes?
- Program for n-th even number
- Program to find sum of 1 + x/2! + x^2/3! +...+x^n/(n+1)!
- Program for n-th odd number
- Program to calculate value of nCr
- C Program for Cutting a Rod | DP-13
- Program to print Hut
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.