Thursday 24 December 2015

Add Integers using Pointers in C

#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;
}

1 comment:

  1. informative article , keep posting and intresting to learn python visit python course in pune

    ReplyDelete