Add Two No Using Pointer Code

//Add Two No. using Pointer

#include<stdio.h>
int add(int *a,int *b);
int main()
{
 int a,b,x;
 printf("enter two no to add\n");scanf("%s%s",&a,&b);
 x=add(&a,&b);
 printf("Addition = %d ",x);
}
int add(int *p,int *q)
{
 int *p,*q,y;
 y=*p+*q;
 return(y);
}

No comments:

Post a Comment