Program to find sum of two numbers using Pointer

#include<stdio.h>
#include<conio.h>
void main()
{
  clrscr();
  int a,b,c,*p,*q;
  printf("\n enter a:");
  scanf("%d",&a);
  p=&a;
  printf("\n enter b:");
  scanf("%d",&b);
  q=&b;
  c=*p+*q;
  printf("\n result=%d",c);
  getch();
}

Leave a Reply