The output of the below code should be the numbers between 21 and 29. But the output is numbers between 15 and 30. Where is the mistake? Why is if statement inside for loop not working?
1 2 3 4 5 6 7 8 9 10 11
#include <iostream>
usingnamespace std;
int main()
{
int i,num=15;
for(i=num; i<=num+15; i++)
{
if(20<i<30)
cout<<i<<endl;
}
return 0;