I have to write a program in C which calculates and displays the following expression:
P=1*2*(1/3)*4*5*(1/6)
I tried running this code ( this is the whole code) but I cant compile it because it shows errors in the fourth and eleventh row in C++..What am I doing wrong?
#include <stdio.h>
int i,n,f=1;
for(i=1;i<=n;i++)
{
if(i%3==0)
f=f/i;
else
f=f*i;
}
printf("%d\n", f);
return 0;
I cant write here the erros because they are soooo many..