C Program to Add Two Numbers Using Pointers

In this program, you'll learn to add two numbers using pointers.

Source Code
int main()
    int a, b, sum;
    int *p, *q;

    printf("Enter two numbers: ");
    scanf("%d%d", &a, &b);

    p = &a;
    q= &b;
    sum = *p + *q;

    printf("\nSum of given two nos = %d", sum);
    return 0;
Enter two numbers:

Sum of given two nos = 146

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