C program for addition two numbers using pointer

C program for addition two numbers using pointer:
If you are using any software then below program will not give an error, but if you are using TURBO C then you have to make some changes like: void main() and some function like clrscr() or getch().

 int a,b,*ptr1,*ptr2;
 int num;

 printf("Enter two numbers : ");


 num= *ptr1 + *ptr2;

 printf("Sum = %d", num);


Enter two numbers : 5 7
Sum = 12


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.