#include<stdio.h>
#include<conio.h>
main()
{
long n,ans;
clrscr();
printf("Enter the sides of polygon: ");
scanf("%ld",&n);
ans=((n*n)-(3*n))/2;
printf("\nNumber of diagonals is %ld",ans);
getch();
}
#include<conio.h>
main()
{
long n,ans;
clrscr();
printf("Enter the sides of polygon: ");
scanf("%ld",&n);
ans=((n*n)-(3*n))/2;
printf("\nNumber of diagonals is %ld",ans);
getch();
}