Wednesday, September 8, 2010

program of pointers
# include
# include
void main(void)
{
int n,tn,sn;
printf("type the no.of terms");
scanf("%d",&n);
math(n,&tn,&sn);
printf("tn=2n+1=%2d",tn);
printf("sn=(n*n)+2*n=%2d",sn);
getch();
clrscr();
}
void math(int a,int*p1,int*p2)
{
*p1=2*a+1;
*p2=(a*a)+2*a;
}