In this program, you'll learn to add two numbers using pointers.
#include<stdio.h>
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:
48
98
Sum of given two nos = 146