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
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.