C-Program to Add Two Integers
In this Example user asked to Enter any two integers and Sum them and Print on the Output Screen.
Program to Add Two Integers
#include <stdio.h>
int main() {
int number1, number2, sum;
printf("Enter two integers: ");
scanf("%d %d", &number1, &number2);
// calculating sum
sum = number1 + number2;
printf("%d + %d = %d",number1,number2,sum);
return 0;
}
Output
Enter two integers: 12 11 12 + 11 = 23
In this Program User asked to Enter Two Integer . This integer value is Stored in Number 1 and number2 Respectively.
0 Comments
Do not Comment and any spam text