Forum: C++ Sep 16th, 2008 |
| Replies: 8 Views: 2,830 Your program is write up to if(m==n)
in the above program n will become zero
after the loop. So assign n value to any other variable,then compare with m. |
Forum: C++ Aug 13th, 2008 |
| Replies: 4 Views: 4,649 void main()
{int n=1,i=0;
clrscr();
while(i<1500)
{ n++;
if(n%2==0||n%3==0||n%5==0)
i++;
}
printf("%d",n); |