This is the question for C++ expert, what will be the output of following codes and why?
Thanks a lot in advance!
Code:#include <iostream> int main() { int a = 5; int d = a++; a = 5; int b = a++ * ++a; a = 5; int c = ++a * a++; a = 5; int e = (a++) * (1); std::cout << "b = " << b << std::endl; std::cout << "c = " << c << std::endl; std::cout << "d = " << d << std::endl; std::cout << "e = " << e << std::endl; }




Reply With Quote