Addition of two integer numbers using C

Question - 
Given two numbers , your task is to calculate their sum.
Example - 
Input : 2, 3
Output : sum is : 5
Input : 10, 45
Output : sum is : 55

Approach - 
we solve this question with the help of basic maths.

Implementation -
#include <stdio.h>
int main()
{
    int num1,num2,sum;
    printf("Enter first integer numbers : ");
    scanf("%d",&num1);
    printf("Enter second integer numbers : ");
    scanf("%d",&num2);
    sum=num1+num2;
    
    printf("Sum is : %d",sum);

    return 0;
}






Comments