Below program will take two numbers as input and print the sum of both numbers. If the user will enter 5 and 10 as input, then the output will be 15. C Program to find sum of two numbers with the output.
See the below example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #include<stdio.h> int main() { int x, y, sum; printf("\nEnter two no: "); scanf("%d %d", &x, &y); sum = x + y; printf("Sum : %d", sum); return(0); } |
Output
1 2 | Enter two no: 5 10 Sum: 15 |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: find the sum of two numbers, sum of two number, sum of two numbers, the sum of 2 numbers, the sum of two numbers, what is the sum of two numbers