### Arithmetic Operation in C using Pointer Variable

Write a program which perform arithmetic operation (+, -, *, / , %) which would be an example of demonstrating pointer arithmetic

1. #include
main()
{
int p,q,*x,*y,a,b,c,d;
p=30,q=10;
x=&p;
y=&q;
a=(*x)*(*y);
b=a+(*x);
c=5-((*x)/(*y));
d=(*x)%(*y);
printf("the values are:\n");
printf("%d\n %d\n %d\n %d\n",a,b,c,d);
}

2. #include
#include
int funcx();
int main()
{
int shohan;
int (*pFn)(void);
pFn=funcx;
printf("\n Arithmatic programme using pointer:");
printf("\n Arithmatic value are:");
shohan=(*pFn)();
getch();
return 0;
}

int funcx()
{
int a,b,*x,*y,p,q,r,s,t;
a=20;
b=10;
x=&a;
y=&b;
p=(*x)*(*y);
q=(*x)+(*y);
r=p-(*x);
s=q/(*y);
t=r%(*x);
printf("\n%d %d %d %d %d",p,q,r,s,t);
}

3. #include
#include
main()
{
int p,q,*x,*y,a,b,c,d;
p=40,q=15;
x=&p;
y=&q;
a=(*x)*(*y);
b=a+(*x);
c=5-((*x)/(*y));
d=(*x)%(*y);
printf("the values are:\n");
printf("%d\n %d\n %d\n %d\n",a,b,c,d);
}

4. #include
#include
main()
{
int p,q,*x,*y,a,b,c,d;
p=30,q=25;
x=&p;
y=&q;
a=(*x)*(*y);
b=a+(*x);
c=5-((*x)/(*y));
d=(*x)%(*y);
printf("the values are:\n");
printf("%d\n %d\n %d\n %d\n",a,b,c,d);
}

5. #include
main()
{
int a,b,out,*x,*y,out1,out2,out3,out4;
printf("The value of A : ");
scanf("%d",&a);
printf("\nThe value of B : ");
scanf("%d",&b);
x=&a;y=&b;
out=(*x + *y);
out1=(*x - *y);
out2=(*x * *y);
out3=(*x / *y);
out4=(*x % *y);