Hi this is the code for life, universe and everything problem, where the program stops only when the user inputs the number "42"
I tried to understand the problem, but could not make it that how the program stops at exactly 42. Any help would be extremely appreciated.
#include <iostream>
int main(void) {
char c, d=10;
while(std::cin.get(c) && (c!='2' || d!='4') && std::cout.put(d))
d=c;
}