Add Two Integers in C programming
Add Two Integers in C programming with source code and output.
Before proceeding with this tutorial, you should have a basic understanding of Computer Programming terminologies. A basic understanding of any of the programming languages will help you in understanding the C programming concepts and move fast on the learning track.
Add Two Integers
/* Add Two Integers in C Program - CODE SCRATCHER */
int main( )
int num1, num2, sum;
printf("Enter two integers: ");
scanf("%d %d",&num1,&num2); /* Stores the two integer entered by user in variable num1 and num2 */
sum=num1+num2; /* Performs addition and stores it in variable sum */
printf("Sum: %d",sum); /* Displays sum */
Enter two integers: 12