This code prints different values for ++i||j++&&++k
depending on whether the printf
function or cout
is used. Why is that?
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
int i = 1,j=1,k=1;
cout<<++i||j++&&++k;
printf("%d", ++i||j++ && ++k);
}