C Program to Add Two Integers

Code of the Program

#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

Insert Two Numbers: 12
11
12 + 11 = 23

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *