C Program to add two integers.
- C program to add two integers using C program.
#include <stdio.h>
int main() {
int number1, number2, sum;
printf("Enter first integer: ");
scanf("%d", &number1);
printf("Enter second integer: ");
scanf("%d", &number2);
// calculating sum
sum = number1 + number2;
printf("Sum of above two integers is: %d + %d = %d", number1, number2, sum);
return 0;
}
OUTPUT
Enter first integer: 30 Enter second integer: 20 Sum of above two integers is: 30 + 20 = 50
Comments
Post a Comment