C Program for Addition and Multiplication of Two Numbers

In this program, the user is asked to enter two integer numbers. Then the addition and multiplication is calculated and displayed on console.



Source Code
#include<stdio.h>
#include<conio.h>
void main()
{
    int n1, n2, add, mul;
    clrscr();
    printf("Enter the two numbers: ");
    scanf("%d %d",&n1, &n2);

    add = n1 + n2;
    mul = n1 * n2;

    printf("a + b = %d", add);
    printf("\na * b = %d", mul);
    getch();
}
Output
Enter the two numbers: 5 8
a + b = 13
a * b = 40





"Coding Hub - Learn to code" app now available on Google Play Store