Program To Add Two Numbers
Program To Add Two Numbers
C program to add two numbers: This c language program perform the basic arithmetic
operation of addition on two numbers and then prints the sum on the screen. For example if
the user entered two numbers as 5, 6 then 11 (5 + 6) will be printed on the screen.
C programming code
#include<stdio.h>
int main()
{
int a, b, c;
printf("Enter two numbers to add\n");
scanf("%d%d",&a,&b);
c = a + b;
printf("Sum of entered numbers = %d\n",c);
return 0;
}
return 0;
return 0;
long result;
result = a + b;
return result;
We have used long data type as it can handle large numbers, if you want to add still larger
numbers which doesn't fit in long range then use array, string or other data structure.