Pointer Sum and Average in C

POINTER SUM: 

  1. #include < stdio.h >  
  2.     main()   
  3.     {  
  4.         intx,  
  5.         y,  
  6.         z;  
  7.         int * p1 = & x;  
  8.         int * p2 = & y;  
  9.         int * p3 = & z;  
  10.         printf("\n enter the first number");  
  11.         scanf("%d", p1);  
  12.         printf("\n enter the second number");  
  13.         scanf("%d", p2); * p3 = * p1 + * p2;  
  14.         printf("\n sum os=%d", * p3);  
  15.         printf("\n address of sum =%p", p3);  
  16.   
  17.     }  
POINTER AVERAGE NUMBERS:

  1. #include < stdio.h >  
  2.     main()  
  3.     {  
  4.         float x, y, z, z1;  
  5.         floatavg;  
  6.         float * p1 = & x;  
  7.         float * p2 = & y;  
  8.         float * p3 = & z;  
  9.         float * p4 = & z1;  
  10.         float * p5 = & avg;  
  11.         printf("\n enter the first number");  
  12.         scanf("%f", p1);  
  13.         printf("\n enter the second number");  
  14.         scanf("%f", p2);  
  15.         printf("\n enter the third number");  
  16.         scanf("%f", p3); * p4 = * p1 + * p2 + * p3; * p5 = * p4 / 3;  
  17.         printf("\n sum is=%f", * p4);  
  18.         printf("\n avrage of sum=%f", * p5);  
  19.     }