Sum of Two Number Using C Language

ALGORITHM:-

1. Add header files and create main() function
2. Defined variables
3. Get input in first variable and second variable
4. Perform addition between first and second variables
5. Store sum into another variable called result
6. Simple print result variable.
#include<stdio.h>
int main() {
    int var2;
    int var1;
    int result;

    printf(“Type your first value to add : “);
    scanf(“%i”, &var1);

    printf(“Type your second value to add : “);
    scanf(“%i”, &var2);

    result = var2 + var1;
    printf(“Total of your value =  %i”,result);
    return 0;
}
OUTPUT:

Type your first value to add : 10
Type your second value to add : 20
Total of your value = 30