for(i = 65; i < N, i++)
{
if(i%65 == 0)
cout << "found" << i << endl;
}
this is not the same as divisible by 5 OR 13, of course. But the logic and general approach would be similar. I expect that is what you really wanted, so use this as an example, give it a try, and then ask again if you get stuck.
first, for loops do not have a ; on the end. That will compile and work, but it just loops and does nothing however many times, then does the apparent (but is not) loop body once.
Second, its hard to say without more code... give us everything (and put it in the code tags, <> button on the side when you post).
int n;
int I;
cout <<"enter the value of n : ";
cin>>n;
cout <<"all the numbers between 1 and N that are divisible
by 5 and 13 are:";
for (i=1 ; i <=n ; i++)
{
if (n%5==0 && n%13==0);
{
cout>>i;
}
}
return 0;
}
putting it all together:
int main()
{
int n;
int i;
cout <<"enter the value of n : ";
cin>>n;
cout <<"all the numbers between 1 and N that are divisible by 5 and 13 are:";
for (i=1 ; i <=n ; i++)
{
if (i%5==0 && i%13==0)
{
cout << i << endl;
}
}
return 0;
}
which you will note is the same as I said before (%65) except this approach does much more work. Actually
for(I = 65; I <=N, I+=65)
cout << I;
is the math nerd way to do it efficiently :)