Program to add two numbers using pointers in C

#include <stdio.h>

int main()
   int first, second, *p, *q, sum;

   printf("Enter two integers to addn");
   scanf("%d%d", &first, &second);

   p = &first;
   q = &second;

   sum = *p + *q;

   printf("Sum of entered numbers = %dn",sum);

   return 0;

Enter two integers to add
Sum of entered numbers =8

Leave a Reply

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

Live Updates COVID-19 CASES
%d bloggers like this: