Irregular Is Tough, Regular Is Easy!

Dr. Bari is working on some chemical formation. He believes that chemicals and shapes that are regular in shape, are always easy to deal with. But Dr. Khan believes that Dr. Bari is wrong. To challenge Dr. Bari, Dr. Khan asks him to count the number of intersections of the diagonals of a regular polygon. “I know it is easy to find the number of intersection points made by irregular polygon, but can you find it for regular convex n-gon? To make things easy for you, find only the values for odd n-gon .”


This is a companion discussion topic for the original entry at https://toph.co/p/irregular-is-tough-regular-is-easy

#include <stdio.h>

int main() {
long long int N,i,d,T,j,p=0,k;
scanf("%lld",&T);
for(j=1;j<=T;j++)
{
scanf("%lld",&N);
if(N<=3)
printf("%lld",&p);
else{
d=2;
for(i=5,k=3;i<=N;i++,k++)
{
d=d+k;
}
printf("%lld\n",d);
}
}
return 0;
}
Whats the problem with this code?

Why u used &p ,in print function?