Programming Fundamentals
Logic building/ Problem Solving is the most important part of programming fundamentals. Here, I have some questions for you. Read them carefully and try to find their logic by yourself. If you cannot, don't worry answers will be given below each question. Let's start: Question no. 01: Suppose you have two containers; 1st container has black balls and red balls. Number of black and red balls in this container is unknown. There might be only black balls or only red balls or any number of black and any number of red balls in 1st container. 2nd container has unlimited red balls. Now the game is that you have to pick up two balls from the 1st container without seeing the balls, after picking out you can see them and follow the following instruction: i) If both balls you picked up from 1st container are red, you have to place one red ball in the 1st container back. ii) If both balls you picked up from 1st container are black, you have to place one red ball in the 1st contai...