In this program, we are going to share a C program to add two numbers using Pointer. If you are a beginner and want to start learning the C programming, then keep your close attention in this tutorial as I am going to share a C program to add two numbers using Pointer with the output.
We have designed this program for beginners for learning purpose. Copy below c program and execute it with c compiler to see the output of the program.
int num1, num2, *ptr1, *ptr2, sum=0;
printf("Enter the two number :");
ptr1 = &num1;
ptr2 = &num2;
sum = *ptr1 + *ptr2;
printf("Sum of the two number is %d",sum);
Enter the two number :1025
Sum of the two number is 35
Editorial Staff at FreeWebMentor is a team of professional developers leads by Prem Tiwari View all posts by Editorial Staff