Write a c program to find the entropy of given probability

//Write a c program to find the entropy of given probability



#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
intc,i;
floatp,sum=0,it;
clrscr();
printf("**** INFORMATION CONTENT OF FIVE MESSEGES *****\n\n");
printf("Enter No Of Messages : ");
scanf("%d",&c);
printf("\n");
for(i=1;i< =c;i++)
{
printf("\tEnter The %d Probability\t: ",i);
scanf("%f",&p);
it = p* (log(1/p)) / log(2);
sum=sum+it;
}
printf("\nEntropy Of The Given Message : %f",sum);
getch();
}