Category : auto-increment

Something that I don’t understand happened today when I ran a simple C++ code as is pasted below: #include<bits/stdc++.h> using namespace std; int main() { int a=4,b; b= ++a + ++a; cout<<a<<" "<<b<<endl; //cin>>a; } The above code when executed gives an output 6 12 Whereas… #include<bits/stdc++.h> using namespace std; int main() { int a=4,b; ..

Read more