20160721

Add Two Number Using Pointers

#include <stdio.h>
 
int main()
{
   int first, second, *p, *q, sum;
 
   printf("Enter two integers to add\n");
   scanf("%d%d", &first, &second);
 
   p = &first;
   q = &second;
 
   sum = *p + *q;
 
   printf("Sum of entered numbers = %d\n",sum);
 
   return 0;
}





OUTPUT

Enter two integers to add
33
4
Sum of entered numbers = 37

Disqus Shortname

Recent Post Number

Related Post Number

Comments system