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
Download Add numbers program executable.
In the expression (c = a + b) overflow may occur if sum of a and b is larger than maximum value which can be stored in variable c.
Addition without using third variable
C program to add two numbers repeatedly
Output of program:
Adding numbers in c using function
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.