strange output

Hello.Take a look at:

1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
using namespace std;
int main()
{
   int a = 2, b = 2;
   cin >> a, b;
   cout << a << ' ' << b << ' ' <<b/a;
   
    for(int i =9;i<300000000;++i);
    return 0;
}


Suppose
10 27
is entered in the console.

My interpretation:a is assigned the first number entered from the output. number 10.b is still 2.But why is a/b equal to 0?

Thanks in advance!
With your current code, a will be 10, b will be 2, and b/a will be 0.

Note:
1
2
3
cin>>a,b; //same as below pretty much
cin>>a;
b;

and
b/a
does integer division.
Now, would you please explain to me the output of:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
using namespace std;

int main()
{
    
    
       for(int i=0;i < 8;i++) 
       {
               cout << i << endl;
          if(i++%2 == 0) cout << i++ ;
        else if (i%3 == 0)
        continue;
        else if (i%5 == 0)
            break;           
        }
    cin.get();
    return 0;
}
Sorry, why no one answers me?
What don't you understand specifically about it?
Oh, sorry, got it.
Very tricky code indeed!

Thank you
Topic archived. No new replies allowed.