Home >>c programs >c program to find sum of two numbers
In c language the addition of two numbers is the arithmetic operation of adding them and printing the sum of both two numbers on the screen.
For display the sum of these numbers we are using printf() function.
For example-the input is 10 and 20 the output is 30.
Let's take an example :
#include<stdio.h> int main() { int x=0,y=0,result=0; printf("enter first number:"); scanf("%d",&x); printf("enter second number:"); scanf("%d",&y); result=x+y; printf("sum of 2 numbers:%d ",result); return 0; }