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