C-Program To Find Product Of odd Natural Numbers Up to a Limit
#include<stdio.h>
main ()
{
int prdct=1,n,i;
printf("Enter the Limit\t");
scanf("%d",&n);
for(i=1;i<=n;i=i+2)
{
if(i%2!=0)
{
prdct=prdct*i;
}
}
printf("Product of OddNumbers Upto %d is %d",n,prdctOO);
}
 |
| output |
No comments:
Post a Comment