[Solved] Why am I getting this output in C++? Explain the logic

NULL results in a false condition. You could imagine that NULL is a 0, so this: if(NULL) would be equivalent to this: if(0) thus your code would become: #include <stdio.h> #include <iostream> int main() { if(0) std::cout<<“hello”; else std::cout<<“world”; return 0; } where is obvious that because 0 results to false, the if condition is … Read more

[Solved] Advanced Rudimentary Computing? [closed]

I think you missed the most important one: algorithms. Understanding the complexity, know the situation to use them, why use them and more important, how to implement them. I’m pretty sure that you already know a lot about algorithms but if you think that your tool-knowledge (aka the programming languages) are good enough, you should … Read more

[Solved] Nested if-else statement not working probably [closed]

In your else-if statement, instead of comparing the two variables, you assigned numberOfPeople to maxRoomCapacity. The assignment evaluates to true, causing the body of that if-else to execute, causing the flow of your program to skip the else statement. The problem is here: else if (maxRoomCapacity = numberOfPeople) change it to: else if (maxRoomCapacity == … Read more