Saturday, 27 July 2013

C-Program To Find The Product Of Natural Numbers Divisible by a particular Number Given by the user Upto a limit

#include<stdio.h>
main ()
{
int prdct=1,n,i,d;
printf("Enter the Limit\t");
scanf("%d",&n);
printf("Enter the Divisible\t");
scanf("%d",&d);
for(i=d;i<=n;i=i+d)
{
if(i%d==0)
{
prdct=prdct*i;
}
}
printf("Product of Numbers Divisible By %d upto %d is %d",d,n,prdct);
}




sakoncepts.blogspot.com
output

No comments:

Post a Comment