1. Home
  2. C Programming
  3. Examples
  4. Sum of two numbers

Sum of two numbers

C – Calculate Sum of Two Integers

This is a simple C program to take the input of two integer numbers from the user and calculate the sum of both integers and pint on screen.

C Program to Add Two Integers

Create a new file using the below content. This script will ask to enter two integer values and calculate the sum of both numbers.

Run above program. Output:

Enter 1'st number:10
Enter 2'nd number:20
Sum is: 30