When I type the following code, I dont get the required output and I fail to understand why.
Problem:
Write a program to find the product of all the positive even numbers less than or equal to 30.
Possible solution according to me:
#include <stdio.h>
void main(void)
{
int n, prod, even;
prod=1;
n<=30;
{
for(even=2;even<n;even=even+2)
prod=prod*even;
even=even+2;
printf("Product of all the positive even numbers less than %d is %d\n", n, prod);
}
}