Problem Statement - Excluding Numbers divisible by 2 or by 3
Write the output of the following program. Assume that required header files are included.
int main()
{
for(int i=1;i<=30;++i)
{
if(i%2==0 || i%3==0) continue;
else cout<<i<<" ";
}
return 0 ;
}
Solution
Created: 1-Jan-2018 22:45 | Updated: 22-Mar-2026 20:17|
